ปรับปรุงให้แนบไฟล์ ผลสัมฤทธิ์ของงาน ได้หลายไฟล์
This commit is contained in:
403
ApiControllers/eva_evaluation_achievement_attachControllers.cs
Normal file
403
ApiControllers/eva_evaluation_achievement_attachControllers.cs
Normal file
@@ -0,0 +1,403 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_evaluation_achievement_attach")]
|
||||
public class eva_evaluation_achievement_attachController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_evaluation_achievement_attachController> _logger;
|
||||
private Ieva_evaluation_achievement_attachService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_evaluation_achievement_attachController(ILogger<eva_evaluation_achievement_attachController> logger, Ieva_evaluation_achievement_attachService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_evaluation_achievement_attachWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(eva_evaluation_achievement_attachWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by achievement_id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("")]
|
||||
[ProducesResponseType(typeof(List<eva_evaluation_achievement_attachViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(int? achievement_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByachievement_id(achievement_id));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_evaluation_achievement_attachViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_evaluation_achievement_attachSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("eva_evaluation_achievement_attach_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_evaluation_achievement_attach_report(eva_evaluation_achievement_attachReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_evaluation_achievement_attachInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(int id, [FromBody] eva_evaluation_achievement_attachInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(int id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_evaluation_achievement_attachInputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,8 @@ namespace TTSW.EF {
|
||||
public DbSet<eva_limit_frame_planEntity> eva_limit_frame_plan { get; set; }
|
||||
|
||||
public DbSet<eva_idp_planEntity> eva_idp_plan { get; set; }
|
||||
|
||||
public DbSet<eva_evaluation_achievement_attachEntity> eva_evaluation_achievement_attach { get; set; }
|
||||
protected override void OnModelCreating (ModelBuilder modelBuilder) {
|
||||
|
||||
base.OnModelCreating (modelBuilder);
|
||||
|
||||
BIN
EXCEL/eva_evaluation_achievement_attach.xlsx
Normal file
BIN
EXCEL/eva_evaluation_achievement_attach.xlsx
Normal file
Binary file not shown.
999
Migrations/20210411122053_AddAttach.Designer.cs
generated
Normal file
999
Migrations/20210411122053_AddAttach.Designer.cs
generated
Normal file
@@ -0,0 +1,999 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using TTSW.EF;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20210411122053_AddAttach")]
|
||||
partial class AddAttach
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("command_no")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<DateTime?>("imported_date");
|
||||
|
||||
b.Property<string>("imported_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit");
|
||||
|
||||
b.Property<decimal?>("limit_frame");
|
||||
|
||||
b.Property<decimal?>("limit_frame_quota");
|
||||
|
||||
b.Property<decimal?>("limit_quota");
|
||||
|
||||
b.Property<int?>("managed_by");
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<string>("report_type")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("theDate");
|
||||
|
||||
b.Property<int?>("theRound");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("achievement_final");
|
||||
|
||||
b.Property<int?>("adjust_postponement_id");
|
||||
|
||||
b.Property<int?>("adjust_postponement_quota_id");
|
||||
|
||||
b.Property<decimal?>("competency_final");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<string>("employee_no_at_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("fullname_at_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<bool?>("is_for_postponement");
|
||||
|
||||
b.Property<string>("level_score_final")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<string>("migration_eva_result")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("migration_total_score");
|
||||
|
||||
b.Property<decimal?>("new_cost_living");
|
||||
|
||||
b.Property<decimal?>("new_sarary");
|
||||
|
||||
b.Property<decimal?>("new_sarary_with_quota");
|
||||
|
||||
b.Property<int?>("order_at_this_time");
|
||||
|
||||
b.Property<int?>("org_at_this_time");
|
||||
|
||||
b.Property<decimal?>("other_money_at_this_time");
|
||||
|
||||
b.Property<decimal?>("position_allowance_at_this_time");
|
||||
|
||||
b.Property<string>("position_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<decimal?>("receive_quota");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("sarary");
|
||||
|
||||
b.Property<decimal?>("score_final");
|
||||
|
||||
b.Property<decimal?>("total_promote");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("adjust_postponement_id");
|
||||
|
||||
b.HasIndex("adjust_postponement_quota_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<decimal?>("score1");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<int?>("supervisor1_id");
|
||||
|
||||
b.Property<int?>("supervisor2_id");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_create_evaluation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("Final_summary_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("achievement_chief");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor2A");
|
||||
|
||||
b.Property<int?>("chief");
|
||||
|
||||
b.Property<int?>("chief_a");
|
||||
|
||||
b.Property<DateTime?>("chief_a_date");
|
||||
|
||||
b.Property<string>("chief_a_reject_reason")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("chief_a_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("chief_a_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<decimal?>("competency_chief");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor2A");
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<int?>("eva_employee_id");
|
||||
|
||||
b.Property<int?>("help_org_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_score_chief")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor1A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor2A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<int?>("order_of_data");
|
||||
|
||||
b.Property<decimal?>("score_chief");
|
||||
|
||||
b.Property<decimal?>("score_supervisor");
|
||||
|
||||
b.Property<decimal?>("score_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("score_supervisor2A");
|
||||
|
||||
b.Property<string>("status_chief")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_chief_a")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_chief_a_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_chief_click_date");
|
||||
|
||||
b.Property<string>("status_self")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_self_a")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_self_a_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_self_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_supervisor1A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor1A_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor2A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor2A_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_supervisor_click_date");
|
||||
|
||||
b.Property<int?>("supervisor1");
|
||||
|
||||
b.Property<int?>("supervisor1A");
|
||||
|
||||
b.Property<DateTime?>("supervisor1A_date");
|
||||
|
||||
b.Property<string>("supervisor1A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor1_date");
|
||||
|
||||
b.Property<int?>("supervisor1_id");
|
||||
|
||||
b.Property<string>("supervisor1_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor2");
|
||||
|
||||
b.Property<int?>("supervisor2A");
|
||||
|
||||
b.Property<DateTime?>("supervisor2A_date");
|
||||
|
||||
b.Property<string>("supervisor2A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor2_date");
|
||||
|
||||
b.Property<int?>("supervisor2_id");
|
||||
|
||||
b.Property<string>("supervisor2_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<decimal?>("total_summary_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor2A");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("work_period");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_id");
|
||||
|
||||
b.ToTable("eva_create_evaluation_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("achievement")
|
||||
.HasMaxLength(8000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("thefile")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("achievement_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("the_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("achievement_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement_attach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("behavior")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_behavior");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("main_dept_id");
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<string>("thegroup")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_evaluation_group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.ToTable("eva_evaluation_group_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("indicators")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("mission_detail")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<int?>("mission_no");
|
||||
|
||||
b.Property<string>("target")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_operating_agreement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("develop")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("development_method")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("period_text")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_idp_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_level_score");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<decimal?>("cost_of_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("frame_group_guid");
|
||||
|
||||
b.Property<int?>("help_org_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_text")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("monthly_remuneration");
|
||||
|
||||
b.Property<int?>("order_of_data");
|
||||
|
||||
b.Property<int?>("org_id");
|
||||
|
||||
b.Property<decimal?>("position_allowance");
|
||||
|
||||
b.Property<string>("position_text")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("salary");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("frame_group_guid");
|
||||
|
||||
b.ToTable("eva_limit_frame_employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<Guid?>("frame_plan_guid");
|
||||
|
||||
b.Property<Guid?>("group_guid");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit_frame_295");
|
||||
|
||||
b.Property<int?>("main_dept_id");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<decimal?>("total_salary");
|
||||
|
||||
b.Property<decimal?>("total_salary_limit");
|
||||
|
||||
b.Property<decimal?>("total_salary_limit_rounded");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("frame_plan_guid");
|
||||
|
||||
b.HasIndex("group_guid");
|
||||
|
||||
b.ToTable("eva_limit_frame_group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("executed_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit_frame_005");
|
||||
|
||||
b.Property<decimal?>("limit_frame_005_total");
|
||||
|
||||
b.Property<decimal?>("limit_frame_005_total_rounded");
|
||||
|
||||
b.Property<Guid?>("plan_guid");
|
||||
|
||||
b.Property<DateTime?>("salary_adjustment_date");
|
||||
|
||||
b.Property<string>("status_chief")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_self")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor1");
|
||||
|
||||
b.Property<DateTime?>("supervisor1_date");
|
||||
|
||||
b.Property<string>("supervisor1_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<decimal?>("total_salary");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("plan_guid");
|
||||
|
||||
b.ToTable("eva_limit_frame_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("percent");
|
||||
|
||||
b.Property<int?>("theTime");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_performance_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("list_no");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<string>("step")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_performance_plan_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("level_score_id");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("level_score_id");
|
||||
|
||||
b.ToTable("eva_promoted_percentage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<int?>("position_level");
|
||||
|
||||
b.Property<int?>("position_type");
|
||||
|
||||
b.Property<decimal?>("temporary_min");
|
||||
|
||||
b.Property<decimal?>("themax");
|
||||
|
||||
b.Property<decimal?>("themin");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_salary_cylinder");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_quota_id")
|
||||
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation_create_evaluation_id")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement_achievement_id")
|
||||
.WithMany()
|
||||
.HasForeignKey("achievement_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid")
|
||||
.WithMany()
|
||||
.HasForeignKey("frame_group_guid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_limit_frame_planEntity", "eva_limit_frame_plan_frame_plan_guid")
|
||||
.WithMany()
|
||||
.HasForeignKey("frame_plan_guid");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid")
|
||||
.WithMany()
|
||||
.HasForeignKey("group_guid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan_plan_guid")
|
||||
.WithMany()
|
||||
.HasForeignKey("plan_guid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
|
||||
.WithMany()
|
||||
.HasForeignKey("level_score_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Migrations/20210411122053_AddAttach.cs
Normal file
44
Migrations/20210411122053_AddAttach.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddAttach : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "eva_evaluation_achievement_attach",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false),
|
||||
created = table.Column<DateTime>(nullable: false),
|
||||
updated = table.Column<DateTime>(nullable: false),
|
||||
isActive = table.Column<bool>(nullable: false),
|
||||
achievement_id = table.Column<int>(nullable: true),
|
||||
the_file = table.Column<string>(maxLength: 1000, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_eva_evaluation_achievement_attach", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_attach_eva_evaluation_achievemen~",
|
||||
column: x => x.achievement_id,
|
||||
principalTable: "eva_evaluation_achievement",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_evaluation_achievement_attach_achievement_id",
|
||||
table: "eva_evaluation_achievement_attach",
|
||||
column: "achievement_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "eva_evaluation_achievement_attach");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,6 +431,28 @@ namespace tb320eva.Migrations
|
||||
b.ToTable("eva_evaluation_achievement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("achievement_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("the_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("achievement_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement_attach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
@@ -903,6 +925,13 @@ namespace tb320eva.Migrations
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement_achievement_id")
|
||||
.WithMany()
|
||||
.HasForeignKey("achievement_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public interface Ieva_evaluation_achievement_attachService : IBaseService2<int, eva_evaluation_achievement_attachInputModel, eva_evaluation_achievement_attachViewModel>
|
||||
{
|
||||
new eva_evaluation_achievement_attachViewModel Insert(eva_evaluation_achievement_attachInputModel model, bool is_force_save);
|
||||
new eva_evaluation_achievement_attachViewModel Update(int id, eva_evaluation_achievement_attachInputModel model, bool is_force_save);
|
||||
List<eva_evaluation_achievement_attachViewModel> GetListByachievement_id(int? achievement_id);
|
||||
List<eva_evaluation_achievement_attachViewModel> GetListBySearch(eva_evaluation_achievement_attachSearchModel model);
|
||||
|
||||
string UpdateMultiple(List<eva_evaluation_achievement_attachInputModel> model, bool is_force_save);
|
||||
eva_evaluation_achievement_attachWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_evaluation_achievement_attachWithSelectionViewModel GetBlankItem();
|
||||
|
||||
void RefreshAutoFieldOfAllData();
|
||||
eva_evaluation_achievement_attachEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using System.IO;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachEntity : BaseEntity2<int>
|
||||
{
|
||||
|
||||
|
||||
[ForeignKey("achievement_id")]
|
||||
public eva_evaluation_achievementEntity eva_evaluation_achievement_achievement_id { get; set; }
|
||||
public int? achievement_id { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string the_file { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string the_fileDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string.IsNullOrEmpty(the_file) ? "" :
|
||||
FileUtil.GetFileInfo(TTSW.Constant.FilePathConstant.DirType.FilesTestUpload, id, the_file).RelativePath).Replace(@"\", "/");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetAutoField(DataContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DoAfterInsertUpdate(DataContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public int? achievement_id { get; set; }
|
||||
|
||||
public string the_file { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachReportRequestModel : eva_evaluation_achievement_attachSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public int? achievement_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,332 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachService : Ieva_evaluation_achievement_attachService
|
||||
{
|
||||
private IBaseRepository2<eva_evaluation_achievement_attachEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
|
||||
public eva_evaluation_achievement_attachService(IBaseRepository2<eva_evaluation_achievement_attachEntity, int> repository, IMyDatabase mydb, Iexternal_linkageService inext)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_evaluation_achievement_attachEntity GetEntity(eva_evaluation_achievement_attachInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_evaluation_achievement_attachEntity>(model);
|
||||
}
|
||||
private List<eva_evaluation_achievement_attachEntity> GetEntityList(List<eva_evaluation_achievement_attachInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_evaluation_achievement_attachEntity>>(models);
|
||||
}
|
||||
private eva_evaluation_achievement_attachViewModel GetDto(eva_evaluation_achievement_attachEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_evaluation_achievement_attachViewModel>(entity);
|
||||
}
|
||||
private List<eva_evaluation_achievement_attachViewModel> GetDtoList(List<eva_evaluation_achievement_attachEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_evaluation_achievement_attachViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_evaluation_achievement_attachViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_evaluation_achievement_attachEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_evaluation_achievement_attachWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_evaluation_achievement_attachWithSelectionViewModel>(entity);
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_evaluation_achievement_attachWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_evaluation_achievement_attachWithSelectionViewModel();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_evaluation_achievement_attachViewModel> GetListByachievement_id(int? achievement_id)
|
||||
{
|
||||
var model = new eva_evaluation_achievement_attachSearchModel();
|
||||
model.achievement_id = achievement_id;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_evaluation_achievement_attachViewModel> GetListBySearch(eva_evaluation_achievement_attachSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_evaluation_achievement_attach in _repository.Context.eva_evaluation_achievement_attach
|
||||
|
||||
join fk_eva_evaluation_achievement1 in _repository.Context.eva_evaluation_achievement on m_eva_evaluation_achievement_attach.achievement_id equals fk_eva_evaluation_achievement1.id
|
||||
into eva_evaluation_achievementResult1
|
||||
from fk_eva_evaluation_achievementResult1 in eva_evaluation_achievementResult1.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (!model.achievement_id.HasValue || m_eva_evaluation_achievement_attach.achievement_id == model.achievement_id)
|
||||
|
||||
|
||||
orderby m_eva_evaluation_achievement_attach.created descending
|
||||
select new eva_evaluation_achievement_attachViewModel()
|
||||
{
|
||||
id = m_eva_evaluation_achievement_attach.id,
|
||||
achievement_id = m_eva_evaluation_achievement_attach.achievement_id,
|
||||
the_file = m_eva_evaluation_achievement_attach.the_file,
|
||||
the_fileDisplay = m_eva_evaluation_achievement_attach.the_fileDisplay,
|
||||
|
||||
achievement_id_eva_evaluation_achievement_create_evaluation_detail_id = fk_eva_evaluation_achievementResult1.create_evaluation_detail_id,
|
||||
|
||||
isActive = m_eva_evaluation_achievement_attach.isActive,
|
||||
Created = m_eva_evaluation_achievement_attach.created,
|
||||
Updated = m_eva_evaluation_achievement_attach.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_evaluation_achievement_attach
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
|
||||
public eva_evaluation_achievement_attachViewModel Insert(eva_evaluation_achievement_attachInputModel model, bool is_force_save)
|
||||
{
|
||||
var entity = GetEntity(model);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
|
||||
if (!string.IsNullOrEmpty(model.the_file))
|
||||
{
|
||||
//Move file from temp to physical
|
||||
string the_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
model.the_file, FilePathConstant.DirType.FilesTestUpload, entity.id);
|
||||
entity.the_file = the_fileFileName;
|
||||
}
|
||||
entity.SetAutoField(_repository.Context);
|
||||
|
||||
if (is_force_save)
|
||||
{
|
||||
var inserted = _repository.Insert(entity);
|
||||
entity.DoAfterInsertUpdate(_repository.Context);
|
||||
return Get(inserted.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
entity.DoAfterInsertUpdate(_repository.Context);
|
||||
return Mapper.Map<eva_evaluation_achievement_attachViewModel>(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public eva_evaluation_achievement_attachViewModel Update(int id, eva_evaluation_achievement_attachInputModel model, bool is_force_save)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.achievement_id = model.achievement_id;
|
||||
if (!string.IsNullOrEmpty(model.the_file))
|
||||
{
|
||||
if (model.the_file.StartsWith("Uploads"))
|
||||
{
|
||||
var the_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
model.the_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.the_file);
|
||||
existingEntity.the_file = the_fileFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.the_file = model.the_file;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.the_file = null;
|
||||
}
|
||||
|
||||
|
||||
existingEntity.SetAutoField(_repository.Context);
|
||||
|
||||
if (is_force_save)
|
||||
{
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
existingEntity.DoAfterInsertUpdate(_repository.Context);
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_repository.UpdateWithoutCommit(id, existingEntity);
|
||||
existingEntity.DoAfterInsertUpdate(_repository.Context);
|
||||
return Mapper.Map<eva_evaluation_achievement_attachViewModel>(existingEntity);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
public string UpdateMultiple(List<eva_evaluation_achievement_attachInputModel> model, bool is_force_save)
|
||||
{
|
||||
foreach(var i in model)
|
||||
{
|
||||
if (i.active_mode == "1" && i.id.HasValue) // update
|
||||
{
|
||||
var existingEntity = _repository.Get(i.id.Value);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.achievement_id = i.achievement_id;
|
||||
if (!string.IsNullOrEmpty(i.the_file))
|
||||
{
|
||||
if (i.the_file.StartsWith("Uploads"))
|
||||
{
|
||||
var the_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
i.the_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.the_file);
|
||||
existingEntity.the_file = the_fileFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.the_file = i.the_file;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.the_file = null;
|
||||
}
|
||||
|
||||
|
||||
existingEntity.SetAutoField(_repository.Context);
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
}
|
||||
else if (i.active_mode == "1" && !i.id.HasValue) // add
|
||||
{
|
||||
var entity = GetEntity(i);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
entity.SetAutoField(_repository.Context);
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
}
|
||||
else if (i.active_mode == "0" && i.id.HasValue) // remove
|
||||
{
|
||||
_repository.DeleteWithoutCommit(i.id.Value);
|
||||
}
|
||||
else if (i.active_mode == "0" && !i.id.HasValue)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
if (is_force_save)
|
||||
{
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
return model.Count().ToString();
|
||||
}
|
||||
|
||||
public eva_evaluation_achievement_attachViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_evaluation_achievement_attachViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public void RefreshAutoFieldOfAllData()
|
||||
{
|
||||
var all_items = from i in _repository.Context.eva_evaluation_achievement_attach
|
||||
select i;
|
||||
foreach (var item in all_items)
|
||||
{
|
||||
item.SetAutoField(_repository.Context);
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
private Dictionary<string,string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("achievement_id", "อ้างอิงตาราง eva_create_evaluation_detail");
|
||||
i.Add("achievement_id_eva_evaluation_achievement_create_evaluation_detail_id", "อ้างอิงตาราง eva_create_evaluation_detail");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public int? achievement_id { get; set; }
|
||||
|
||||
public string the_file { get; set; }
|
||||
public string the_fileDisplay { get; set; }
|
||||
|
||||
public string txt_the_file
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string.IsNullOrEmpty(the_file) ? "" :
|
||||
$"<a href='../{the_fileDisplay}' target='_blank'>{the_file}</a>");
|
||||
}
|
||||
}
|
||||
|
||||
public int? achievement_id_eva_evaluation_achievement_create_evaluation_detail_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_evaluation_achievement_attachWithSelectionViewModel: eva_evaluation_achievement_attachViewModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -327,6 +327,9 @@ namespace Test01
|
||||
|
||||
services.AddScoped<Ivw_eva_performance_planService, vw_eva_performance_planService>();
|
||||
|
||||
services.AddScoped<IBaseRepository2<eva_evaluation_achievement_attachEntity, int>, BaseRepository2<eva_evaluation_achievement_attachEntity, int>>();
|
||||
services.AddScoped<Ieva_evaluation_achievement_attachService, eva_evaluation_achievement_attachService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -610,6 +613,10 @@ namespace Test01
|
||||
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planViewModel>();
|
||||
cfg.CreateMap<eva_limit_frame_planEntity, vw_limit_frame_planWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_evaluation_achievement_attachInputModel, eva_evaluation_achievement_attachEntity>();
|
||||
cfg.CreateMap<eva_evaluation_achievement_attachEntity, eva_evaluation_achievement_attachViewModel>();
|
||||
cfg.CreateMap<eva_evaluation_achievement_attachEntity, eva_evaluation_achievement_attachWithSelectionViewModel>();
|
||||
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TodoAPI2.Models;
|
||||
using STAFF_API.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using TodoAPI2.Controllers;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
public class eva_evaluation_achievement_attachViewController : Controller
|
||||
{
|
||||
private ILogger<eva_evaluation_achievement_attachController> _logger;
|
||||
private Ieva_evaluation_achievement_attachService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_evaluation_achievement_attachViewController(ILogger<eva_evaluation_achievement_attachController> logger, Ieva_evaluation_achievement_attachService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IActionResult eva_evaluation_achievement_attach()
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
return View();
|
||||
}
|
||||
|
||||
// public IActionResult eva_evaluation_achievement_attach_d()
|
||||
// {
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
// }
|
||||
|
||||
//public IActionResult eva_evaluation_achievement_attach_report()
|
||||
//{
|
||||
// if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
//}
|
||||
|
||||
//public IActionResult eva_evaluation_achievement_attach_inline()
|
||||
//{
|
||||
// if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
//}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,15 +118,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_evaluation_achievement_thefile" for="eva_evaluation_achievement_thefile">แนบไฟล์</label>
|
||||
<p>
|
||||
<a id="eva_evaluation_achievement_thefile_linkurl" href="#" target="_blank" class="btn btn-info">ดูหรือดาวโหลดไฟล์ของคุณ</a>
|
||||
<a id="eva_evaluation_achievement_thefile_remove" href="javascript:removeFile('eva_evaluation_achievement_thefile');" class="btn btn-danger">ลบไฟล์</a>
|
||||
</p>
|
||||
|
||||
นำเข้าไฟล์ใหม่
|
||||
<input type="file" id="eva_evaluation_achievement_thefile_file" />
|
||||
<input type="hidden" id="eva_evaluation_achievement_thefile_hidURL" iLabel="แนบไฟล์" iRequire="false" iGroup="eva_evaluation_achievement" />
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:open_manage_file()">แนบเอกสาร</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:none;" class='row'>
|
||||
@@ -428,7 +420,6 @@
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_evaluation_achievement/eva_evaluation_achievement.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior_inline.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_idp_plan_owner/eva_idp_plan_owner.js?version=@MyHelper.GetDummyText()"></script>
|
||||
@@ -462,11 +453,11 @@
|
||||
});
|
||||
|
||||
function CheckPermission() {
|
||||
if (status_self === "Y") {
|
||||
$(".status_self").hide();
|
||||
$(".status_self_text").attr("disabled", true);
|
||||
$("#status").text("คุณส่งแบบประเมินไปแล้ว");
|
||||
}
|
||||
//if (status_self === "Y") {
|
||||
// $(".status_self").hide();
|
||||
// $(".status_self_text").attr("disabled", true);
|
||||
// $("#status").text("คุณส่งแบบประเมินไปแล้ว");
|
||||
//}
|
||||
}
|
||||
|
||||
function OnWeightChanged(c) {
|
||||
@@ -494,7 +485,6 @@
|
||||
w1 += parseFloat(eva_evaluation_behavior.weight);
|
||||
});
|
||||
$("#sum_weight_eva_evaluation_behavior").text(w1);
|
||||
//console.log(w1);
|
||||
}
|
||||
|
||||
function print_report() {
|
||||
@@ -505,6 +495,14 @@
|
||||
|
||||
}
|
||||
|
||||
function open_manage_file() {
|
||||
window_open(appsite +"/eva_evaluation_achievement_attachView/eva_evaluation_achievement_attach?id="+$("#eva_evaluation_achievement_id").val());
|
||||
}
|
||||
|
||||
function open_manage_file_id(id) {
|
||||
window_open(appsite + "/eva_evaluation_achievement_attachView/eva_evaluation_achievement_attach?id=" + id);
|
||||
}
|
||||
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_evaluation_achievement_attach";
|
||||
Layout = "_LayoutDirect";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_evaluation_achievement_attachModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_evaluation_achievement_attachModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_evaluation_achievement_attachModelLabel">แนบเอกสาร ผลสัมฤทธิ์ของงาน</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_evaluation_achievement_attach_id" />
|
||||
<input class="form-control" type="hidden" id="eva_evaluation_achievement_attach_achievement_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_evaluation_achievement_attach_the_file" for="eva_evaluation_achievement_attach_the_file">ไฟล์เอกสาร</label>
|
||||
<p>
|
||||
<a id="eva_evaluation_achievement_attach_the_file_linkurl" href="#" target="_blank" class="btn btn-info">ดูหรือดาวโหลดไฟล์ของคุณ</a>
|
||||
<a id="eva_evaluation_achievement_attach_the_file_remove" href="javascript:removeFile('eva_evaluation_achievement_attach_the_file');" class="btn btn-danger">ลบไฟล์</a>
|
||||
</p>
|
||||
|
||||
นำเข้าไฟล์ใหม่
|
||||
<input type="file" id="eva_evaluation_achievement_attach_the_file_file" accept="application/pdf,image/jpeg" />
|
||||
<input type="hidden" id="eva_evaluation_achievement_attach_the_file_hidURL" iLabel="ไฟล์เอกสาร" iRequire="false" iGroup="eva_evaluation_achievement_attach" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_achievement_attach_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">แนบเอกสาร ผลสัมฤทธิ์ของงาน</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>แนบเอกสาร ผลสัมฤทธิ์ของงาน</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<input class="form-control" type="hidden" id="s_eva_evaluation_achievement_attach_achievement_id" />
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_evaluation_achievement_attach_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button type="button" class="btn btn-danger" onclick="javascript:window_close();"><i class="fa fa-repeat"></i> กลับ</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_evaluation_achievement_attachTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_evaluation_achievement_attach_the_file'>ไฟล์เอกสาร</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_evaluation_achievement_attach/eva_evaluation_achievement_attach.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_evaluation_achievement_attach_InitiateDataTable();
|
||||
eva_evaluation_achievement_attach_InitialForm();
|
||||
SetupValidationRemark("eva_evaluation_achievement_attach");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -69,11 +69,7 @@
|
||||
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc_d.cshtml" />
|
||||
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior.cshtml" />
|
||||
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_d.cshtml" />
|
||||
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_inline.cshtml" />
|
||||
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_report.cshtml" />
|
||||
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_wizardform.cshtml" />
|
||||
<None Include="Views\eva_evaluation_achievement_attachView\eva_evaluation_achievement_attach.cshtml" />
|
||||
<None Include="Views\eva_evaluation_operating_agreementView\eva_evaluation_operating_agreement.cshtml" />
|
||||
<None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group.cshtml" />
|
||||
<None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group_d.cshtml" />
|
||||
@@ -88,6 +84,7 @@
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc_d.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_review0A\eva_create_evaluation_detail_review0A_d.js" />
|
||||
<None Include="wwwroot\js\eva_evaluation_achievement_attach\eva_evaluation_achievement_attach.js" />
|
||||
<None Include="wwwroot\js\eva_evaluation_operating_agreement\eva_evaluation_operating_agreement.js" />
|
||||
<None Include="wwwroot\js\eva_limit_frame_employee\eva_limit_frame_employee.js" />
|
||||
<None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group.js" />
|
||||
|
||||
126
tb320eva.xml
126
tb320eva.xml
@@ -2146,6 +2146,124 @@
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_evaluation_achievement_attachController},TodoAPI2.Models.Ieva_evaluation_achievement_attachService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.Get(System.Int32)">
|
||||
<summary>
|
||||
Get specific item by id
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return Get specific item by id</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.GetBlankItem">
|
||||
<summary>
|
||||
Get Blank Item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return a blank item</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.GetList(System.Nullable{System.Int32})">
|
||||
<summary>
|
||||
Get list items by achievement_id
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.GetListBySearch(TodoAPI2.Models.eva_evaluation_achievement_attachSearchModel)">
|
||||
<summary>
|
||||
Get list items by search
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.eva_evaluation_achievement_attach_report(TodoAPI2.Models.eva_evaluation_achievement_attachReportRequestModel)">
|
||||
<summary>
|
||||
Download Report
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.Insert(TodoAPI2.Models.eva_evaluation_achievement_attachInputModel)">
|
||||
<summary>
|
||||
Create new item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.Update(System.Int32,TodoAPI2.Models.eva_evaluation_achievement_attachInputModel)">
|
||||
<summary>
|
||||
Update item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.Delete(System.Int32)">
|
||||
<summary>
|
||||
Delete item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_evaluation_achievement_attachInputModel})">
|
||||
<summary>
|
||||
Update multiple item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachController.RefreshAutoField">
|
||||
<summary>
|
||||
Refresh AutoField of all items
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_process2Controller.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_evaluation_achievement_process2Controller},TodoAPI2.Models.Ieva_evaluation_achievement_process2Service,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
@@ -5048,6 +5166,14 @@
|
||||
<param name="logger"></param>
|
||||
<param name="inemp"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_attachViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_evaluation_achievement_attachController},TodoAPI2.Models.Ieva_evaluation_achievement_attachService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievement_processViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_evaluation_achievement_processController},TodoAPI2.Models.Iexternal_employeeService,TodoAPI2.Models.Ieva_evaluation_achievement_processService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
@@ -22,7 +22,7 @@ function eva_evaluation_achievement_FeedDataToForm(data) {
|
||||
$("#eva_evaluation_achievement_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
|
||||
$("#eva_evaluation_achievement_achievement").val(data.achievement);
|
||||
$("#eva_evaluation_achievement_weight").val(data.weight);
|
||||
feedFileToControl(data.thefile, data.thefileDisplay, "eva_evaluation_achievement_thefile", "file");
|
||||
//feedFileToControl(data.thefile, data.thefileDisplay, "eva_evaluation_achievement_thefile", "file");
|
||||
$("#eva_evaluation_achievement_target_score1").val(data.target_score1);
|
||||
$("#eva_evaluation_achievement_target_score2").val(data.target_score2);
|
||||
$("#eva_evaluation_achievement_target_score3").val(data.target_score3);
|
||||
@@ -36,11 +36,11 @@ function eva_evaluation_achievement_GetFromForm() {
|
||||
eva_evaluation_achievementObject.create_evaluation_detail_id = getUrlParameter("id"); //$("#eva_evaluation_achievement_create_evaluation_detail_id").val();
|
||||
eva_evaluation_achievementObject.achievement = $("#eva_evaluation_achievement_achievement").val();
|
||||
eva_evaluation_achievementObject.weight = $("#eva_evaluation_achievement_weight").val();
|
||||
if ($("#eva_evaluation_achievement_thefile_hidURL").val() !== null) {
|
||||
eva_evaluation_achievementObject.thefile = $("#eva_evaluation_achievement_thefile_hidURL").val();
|
||||
} else {
|
||||
eva_evaluation_achievementObject.thefile = "";
|
||||
}
|
||||
//if ($("#eva_evaluation_achievement_thefile_hidURL").val() !== null) {
|
||||
// eva_evaluation_achievementObject.thefile = $("#eva_evaluation_achievement_thefile_hidURL").val();
|
||||
//} else {
|
||||
// eva_evaluation_achievementObject.thefile = "";
|
||||
//}
|
||||
eva_evaluation_achievementObject.target_score1 = $("#eva_evaluation_achievement_target_score1").val();
|
||||
eva_evaluation_achievementObject.target_score2 = $("#eva_evaluation_achievement_target_score2").val();
|
||||
eva_evaluation_achievementObject.target_score3 = $("#eva_evaluation_achievement_target_score3").val();
|
||||
@@ -208,6 +208,13 @@ var eva_evaluation_achievement_setupTable = function (result) {
|
||||
}, {
|
||||
targets: [3, 4, 5, 6, 7],
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
"targets": -1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:open_manage_file_id(" + tmp + row.id + tmp + ")'><i class='fa fa-pencil'></i></button>";
|
||||
}
|
||||
}],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
var eva_evaluation_achievement_attach_editMode = "CREATE";
|
||||
var eva_evaluation_achievement_attach_API = "/api/eva_evaluation_achievement_attach/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_evaluation_achievement_attach_GetSearchParameter() {
|
||||
var eva_evaluation_achievement_attachSearchObject = new Object();
|
||||
eva_evaluation_achievement_attachSearchObject.achievement_id = getUrlParameter("id");
|
||||
|
||||
return eva_evaluation_achievement_attachSearchObject;
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_evaluation_achievement_attach_achievement_id").val(data.achievement_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_evaluation_achievement_attach_FeedDataToForm(data) {
|
||||
$("#eva_evaluation_achievement_attach_id").val(data.id);
|
||||
$("#eva_evaluation_achievement_attach_achievement_id").val(data.achievement_id);
|
||||
feedFileToControl(data.the_file, data.the_fileDisplay, "eva_evaluation_achievement_attach_the_file", "file");
|
||||
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_GetFromForm() {
|
||||
var eva_evaluation_achievement_attachObject = new Object();
|
||||
eva_evaluation_achievement_attachObject.id = $("#eva_evaluation_achievement_attach_id").val();
|
||||
eva_evaluation_achievement_attachObject.achievement_id = getUrlParameter("id");
|
||||
if ($("#eva_evaluation_achievement_attach_the_file_hidURL").val() !== null) {
|
||||
eva_evaluation_achievement_attachObject.the_file = $("#eva_evaluation_achievement_attach_the_file_hidURL").val();
|
||||
} else {
|
||||
eva_evaluation_achievement_attachObject.the_file = "";
|
||||
}
|
||||
|
||||
|
||||
return eva_evaluation_achievement_attachObject;
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_evaluation_achievement_attach_FeedDataToForm(result);
|
||||
eva_evaluation_achievement_attach_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_evaluation_achievement_attachModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_evaluation_achievement_attach_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_evaluation_achievement_attach_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_evaluation_achievement_attach_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_evaluation_achievement_attachView/eva_evaluation_achievement_attach_d");
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_GoEdit(a) {
|
||||
// Incase model popup
|
||||
eva_evaluation_achievement_attach_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_evaluation_achievement_attachView/eva_evaluation_achievement_attach_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_evaluation_achievement_attach_editMode = "UPDATE";
|
||||
eva_evaluation_achievement_attach_FeedDataToForm(result);
|
||||
$("#eva_evaluation_achievement_attachModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_evaluation_achievement_attach_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_SetCreateForm(s) {
|
||||
eva_evaluation_achievement_attach_editMode = "CREATE";
|
||||
eva_evaluation_achievement_attach_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_evaluation_achievement_attach_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_evaluation_achievement_attach_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_evaluation_achievement_attach_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_evaluation_achievement_attach_PutUpdate() {
|
||||
if (!ValidateForm('eva_evaluation_achievement_attach', eva_evaluation_achievement_attach_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_evaluation_achievement_attach_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_evaluation_achievement_attach_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_evaluation_achievement_attachModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_evaluation_achievement_attach_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_evaluation_achievement_attach_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_evaluation_achievement_attachModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_evaluation_achievement_attach_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_evaluation_achievement_attach_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_evaluation_achievement_attachModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_evaluation_achievement_attach_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_evaluation_achievement_attach_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_evaluation_achievement_attachTableV;
|
||||
|
||||
var eva_evaluation_achievement_attach_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_evaluation_achievement_attachTableV = $('#eva_evaluation_achievement_attachTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
//{ "data": "id" },
|
||||
//{ "data": "achievement_id_eva_evaluation_achievement_create_evaluation_detail_id" },
|
||||
{ "data": "txt_the_file" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_evaluation_achievement_attach_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_evaluation_achievement_attach_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_evaluation_achievement_attach_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_evaluation_achievement_attach_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_attach/GetListBySearch?" + p, eva_evaluation_achievement_attach_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_DoSearch() {
|
||||
var p = $.param(eva_evaluation_achievement_attach_GetSearchParameter());
|
||||
var eva_evaluation_achievement_attach_reload = function (result) {
|
||||
eva_evaluation_achievement_attachTableV.destroy();
|
||||
eva_evaluation_achievement_attach_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_attach/GetListBySearch?" + p, eva_evaluation_achievement_attach_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_evaluation_achievement_attach_GetSelect(f) {
|
||||
var eva_evaluation_achievement_attach_selectitem = [];
|
||||
$.each(eva_evaluation_achievement_attachTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_evaluation_achievement_attach_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_evaluation_achievement_attach_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
$('#eva_evaluation_achievement_attach_the_file_file').change(function () {
|
||||
UploadImage($('#eva_evaluation_achievement_attach_the_file_file'), 'eva_evaluation_achievement_attach_the_file');
|
||||
});
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user