From ad14f4f66423ce77408bcc0eaabf016d888cc345 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Tue, 2 Mar 2021 17:14:35 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B8=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=A7?= =?UTF-8?q?=E0=B8=87=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eva_limit_frame_employeeControllers.cs | 403 ++++++++ .../eva_limit_frame_groupControllers.cs | 403 ++++++++ .../eva_limit_frame_planControllers.cs | 403 ++++++++ EF/DataContext.cs | 3 + EXCEL/eva_limit_frame_employee.xlsx | Bin 10468 -> 10731 bytes EXCEL/eva_limit_frame_group.xlsx | Bin 10308 -> 10318 bytes EXCEL/eva_limit_frame_plan.xlsx | Bin 10628 -> 10862 bytes .../25640301044832_AddLimitFrame.Designer.cs | 905 +++++++++++++++++ Migrations/25640301044832_AddLimitFrame.cs | 132 +++ ...35125_AddLimitFrameGroupColumn.Designer.cs | 913 ++++++++++++++++++ ...25640302035125_AddLimitFrameGroupColumn.cs | 44 + ...00_RemoveLimitFrameGroupColumn.Designer.cs | 905 +++++++++++++++++ ...40302040600_RemoveLimitFrameGroupColumn.cs | 44 + ...5640302050315_FixMissingColumn.Designer.cs | 907 +++++++++++++++++ Migrations/25640302050315_FixMissingColumn.cs | 23 + Migrations/DataContextModelSnapshot.cs | 130 +++ .../Ieva_limit_frame_employeeService.cs | 32 + .../eva_limit_frame_employeeEntity.cs | 49 + .../eva_limit_frame_employeeInputModel.cs | 38 + ..._limit_frame_employeeReportRequestModel.cs | 21 + .../eva_limit_frame_employeeSearchModel.cs | 25 + .../eva_limit_frame_employeeService.cs | 338 +++++++ .../eva_limit_frame_employeeViewModel.cs | 40 + ...it_frame_employeeWithSelectionViewModel.cs | 16 + .../Ieva_limit_frame_groupService.cs | 32 + .../eva_limit_frame_groupEntity.cs | 47 + .../eva_limit_frame_groupInputModel.cs | 34 + ...eva_limit_frame_groupReportRequestModel.cs | 21 + .../eva_limit_frame_groupSearchModel.cs | 25 + .../eva_limit_frame_groupService.cs | 301 ++++++ .../eva_limit_frame_groupViewModel.cs | 33 + ...limit_frame_groupWithSelectionViewModel.cs | 13 + .../Ieva_limit_frame_planService.cs | 32 + .../eva_limit_frame_planEntity.cs | 57 ++ .../eva_limit_frame_planInputModel.cs | 42 + .../eva_limit_frame_planReportRequestModel.cs | 21 + .../eva_limit_frame_planSearchModel.cs | 23 + .../eva_limit_frame_planService.cs | 320 ++++++ .../eva_limit_frame_planViewModel.cs | 47 + ..._limit_frame_planWithSelectionViewModel.cs | 14 + Startup.cs | 21 + ...eva_limit_frame_employeeViewControllers.cs | 66 ++ .../eva_limit_frame_groupViewControllers.cs | 66 ++ .../eva_limit_frame_planViewControllers.cs | 66 ++ .../eva_limit_frame_employee.cshtml | 146 +++ .../eva_limit_frame_employee_d.cshtml | 108 +++ .../eva_limit_frame_employee_inline.cshtml | 68 ++ .../eva_limit_frame_employee_report.cshtml | 55 ++ ...eva_limit_frame_employee_wizardform.cshtml | 71 ++ .../eva_limit_frame_group.cshtml | 133 +++ .../eva_limit_frame_group_d.cshtml | 286 ++++++ .../eva_limit_frame_group_inline.cshtml | 66 ++ .../eva_limit_frame_group_report.cshtml | 60 ++ .../eva_limit_frame_group_wizardform.cshtml | 52 + .../eva_limit_frame_plan.cshtml | 145 +++ .../eva_limit_frame_plan_d.cshtml | 221 +++++ .../eva_limit_frame_plan_inline.cshtml | 67 ++ .../eva_limit_frame_plan_report.cshtml | 55 ++ .../eva_limit_frame_plan_wizardform.cshtml | 64 ++ Views/home/index2.cshtml | 3 + appsettings.Development.json | 8 +- tb320eva.csproj | 27 + tb320eva.xml | 378 ++++++++ .../eva_limit_frame_employee.js | 240 +++++ .../eva_limit_frame_employee_d.js | 112 +++ .../eva_limit_frame_employee_inline.js | 165 ++++ .../eva_limit_frame_employee_report.js | 60 ++ .../eva_limit_frame_group.js | 234 +++++ .../eva_limit_frame_group_d.js | 108 +++ .../eva_limit_frame_group_inline.js | 152 +++ .../eva_limit_frame_group_report.js | 60 ++ .../eva_limit_frame_plan.js | 243 +++++ .../eva_limit_frame_plan_d.js | 116 +++ .../eva_limit_frame_plan_inline.js | 168 ++++ .../eva_limit_frame_plan_report.js | 58 ++ wwwroot/json/notifications.json | 1 + wwwroot/json/notifications_blank.json | 1 + 77 files changed, 10782 insertions(+), 4 deletions(-) create mode 100644 ApiControllers/eva_limit_frame_employeeControllers.cs create mode 100644 ApiControllers/eva_limit_frame_groupControllers.cs create mode 100644 ApiControllers/eva_limit_frame_planControllers.cs create mode 100644 Migrations/25640301044832_AddLimitFrame.Designer.cs create mode 100644 Migrations/25640301044832_AddLimitFrame.cs create mode 100644 Migrations/25640302035125_AddLimitFrameGroupColumn.Designer.cs create mode 100644 Migrations/25640302035125_AddLimitFrameGroupColumn.cs create mode 100644 Migrations/25640302040600_RemoveLimitFrameGroupColumn.Designer.cs create mode 100644 Migrations/25640302040600_RemoveLimitFrameGroupColumn.cs create mode 100644 Migrations/25640302050315_FixMissingColumn.Designer.cs create mode 100644 Migrations/25640302050315_FixMissingColumn.cs create mode 100644 Models/eva_limit_frame_employee/Ieva_limit_frame_employeeService.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeEntity.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeInputModel.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeReportRequestModel.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeSearchModel.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeViewModel.cs create mode 100644 Models/eva_limit_frame_employee/eva_limit_frame_employeeWithSelectionViewModel.cs create mode 100644 Models/eva_limit_frame_group/Ieva_limit_frame_groupService.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupEntity.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupInputModel.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupReportRequestModel.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupSearchModel.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupService.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs create mode 100644 Models/eva_limit_frame_group/eva_limit_frame_groupWithSelectionViewModel.cs create mode 100644 Models/eva_limit_frame_plan/Ieva_limit_frame_planService.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planInputModel.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planReportRequestModel.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planSearchModel.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planService.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planViewModel.cs create mode 100644 Models/eva_limit_frame_plan/eva_limit_frame_planWithSelectionViewModel.cs create mode 100644 ViewControllers/eva_limit_frame_employeeViewControllers.cs create mode 100644 ViewControllers/eva_limit_frame_groupViewControllers.cs create mode 100644 ViewControllers/eva_limit_frame_planViewControllers.cs create mode 100644 Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml create mode 100644 Views/eva_limit_frame_employeeView/eva_limit_frame_employee_d.cshtml create mode 100644 Views/eva_limit_frame_employeeView/eva_limit_frame_employee_inline.cshtml create mode 100644 Views/eva_limit_frame_employeeView/eva_limit_frame_employee_report.cshtml create mode 100644 Views/eva_limit_frame_employeeView/eva_limit_frame_employee_wizardform.cshtml create mode 100644 Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml create mode 100644 Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml create mode 100644 Views/eva_limit_frame_groupView/eva_limit_frame_group_inline.cshtml create mode 100644 Views/eva_limit_frame_groupView/eva_limit_frame_group_report.cshtml create mode 100644 Views/eva_limit_frame_groupView/eva_limit_frame_group_wizardform.cshtml create mode 100644 Views/eva_limit_frame_planView/eva_limit_frame_plan.cshtml create mode 100644 Views/eva_limit_frame_planView/eva_limit_frame_plan_d.cshtml create mode 100644 Views/eva_limit_frame_planView/eva_limit_frame_plan_inline.cshtml create mode 100644 Views/eva_limit_frame_planView/eva_limit_frame_plan_report.cshtml create mode 100644 Views/eva_limit_frame_planView/eva_limit_frame_plan_wizardform.cshtml create mode 100644 wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js create mode 100644 wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_d.js create mode 100644 wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_inline.js create mode 100644 wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_report.js create mode 100644 wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js create mode 100644 wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js create mode 100644 wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_inline.js create mode 100644 wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_report.js create mode 100644 wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan.js create mode 100644 wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_d.js create mode 100644 wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_inline.js create mode 100644 wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_report.js create mode 100644 wwwroot/json/notifications.json create mode 100644 wwwroot/json/notifications_blank.json diff --git a/ApiControllers/eva_limit_frame_employeeControllers.cs b/ApiControllers/eva_limit_frame_employeeControllers.cs new file mode 100644 index 0000000..931a550 --- /dev/null +++ b/ApiControllers/eva_limit_frame_employeeControllers.cs @@ -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_limit_frame_employee")] + public class eva_limit_frame_employeeController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_limit_frame_employeeService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_employeeController(ILogger logger, Ieva_limit_frame_employeeService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [HttpGet("{id}")] + [ProducesResponseType(typeof(eva_limit_frame_employeeWithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Get(Guid 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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(eva_limit_frame_employeeWithSelectionViewModel), 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}"); + } + } + + /// + /// Get list items by employee_id + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetList(int? employee_id) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListByemployee_id(employee_id)); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetList.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetListBySearch(eva_limit_frame_employeeSearchModel 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}"); + } + } + + /// + /// Download Report + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("eva_limit_frame_employee_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult eva_limit_frame_employee_report(eva_limit_frame_employeeReportRequestModel 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}"); + } + } + + /// + /// Create new item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPost("")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Insert([FromBody] eva_limit_frame_employeeInputModel 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); + } + + /// + /// Update item + /// + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Update(Guid id, [FromBody] eva_limit_frame_employeeInputModel 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); + } + + /// + /// Delete item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpDelete("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Delete(Guid 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); + } + + /// + /// Update multiple item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("UpdateMultiple")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult UpdateMultiple([FromBody] List 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); + } + + /// + /// Refresh AutoField of all items + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + + + } +} diff --git a/ApiControllers/eva_limit_frame_groupControllers.cs b/ApiControllers/eva_limit_frame_groupControllers.cs new file mode 100644 index 0000000..1b8c60b --- /dev/null +++ b/ApiControllers/eva_limit_frame_groupControllers.cs @@ -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_limit_frame_group")] + public class eva_limit_frame_groupController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_limit_frame_groupService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_groupController(ILogger logger, Ieva_limit_frame_groupService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [HttpGet("{id}")] + [ProducesResponseType(typeof(eva_limit_frame_groupWithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Get(Guid 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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(eva_limit_frame_groupWithSelectionViewModel), 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}"); + } + } + + /// + /// Get list items by group_guid + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetList(Guid? group_guid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListBygroup_guid(group_guid)); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetList.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetListBySearch(eva_limit_frame_groupSearchModel 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}"); + } + } + + /// + /// Download Report + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("eva_limit_frame_group_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult eva_limit_frame_group_report(eva_limit_frame_groupReportRequestModel 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}"); + } + } + + /// + /// Create new item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPost("")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Insert([FromBody] eva_limit_frame_groupInputModel 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); + } + + /// + /// Update item + /// + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Update(Guid id, [FromBody] eva_limit_frame_groupInputModel 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); + } + + /// + /// Delete item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpDelete("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Delete(Guid 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); + } + + /// + /// Update multiple item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("UpdateMultiple")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult UpdateMultiple([FromBody] List 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); + } + + /// + /// Refresh AutoField of all items + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + + + } +} diff --git a/ApiControllers/eva_limit_frame_planControllers.cs b/ApiControllers/eva_limit_frame_planControllers.cs new file mode 100644 index 0000000..d7f4689 --- /dev/null +++ b/ApiControllers/eva_limit_frame_planControllers.cs @@ -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_limit_frame_plan")] + public class eva_limit_frame_planController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_planController(ILogger logger, Ieva_limit_frame_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [HttpGet("{id}")] + [ProducesResponseType(typeof(eva_limit_frame_planWithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Get(Guid 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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(eva_limit_frame_planWithSelectionViewModel), 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}"); + } + } + + /// + /// Get list items by executed_date + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetList(DateTime? executed_date) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListByexecuted_date(executed_date)); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetList.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetListBySearch(eva_limit_frame_planSearchModel 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}"); + } + } + + /// + /// Download Report + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("eva_limit_frame_plan_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult eva_limit_frame_plan_report(eva_limit_frame_planReportRequestModel 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}"); + } + } + + /// + /// Create new item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPost("")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Insert([FromBody] eva_limit_frame_planInputModel 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); + } + + /// + /// Update item + /// + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Update(Guid id, [FromBody] eva_limit_frame_planInputModel 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); + } + + /// + /// Delete item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpDelete("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Delete(Guid 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); + } + + /// + /// Update multiple item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("UpdateMultiple")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult UpdateMultiple([FromBody] List 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); + } + + /// + /// Refresh AutoField of all items + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + + + } +} diff --git a/EF/DataContext.cs b/EF/DataContext.cs index e72701c..231ef81 100644 --- a/EF/DataContext.cs +++ b/EF/DataContext.cs @@ -38,6 +38,9 @@ namespace TTSW.EF { //public DbSet eva_adjust_postponement_detail_normal { get; set; } public DbSet eva_evaluation_operating_agreement { get; set; } + public DbSet eva_limit_frame_employee { get; set; } + public DbSet eva_limit_frame_group { get; set; } + public DbSet eva_limit_frame_plan { get; set; } public DbSet eva_idp_plan { get; set; } protected override void OnModelCreating (ModelBuilder modelBuilder) { diff --git a/EXCEL/eva_limit_frame_employee.xlsx b/EXCEL/eva_limit_frame_employee.xlsx index cfecd0a82c664382521d5ff1ae68e3dc9fd6a78a..04fd045e7595f99797c0661e47b286d95a6ff624 100644 GIT binary patch delta 3571 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 A+5i9m delta 2081 zcmV++2;TS3P{dHM#0v>_JI; zT<^zODruIgY*(U=MGt^Mp>R|a@`QzUKo)^T#G<=ne;;ndi4PU7PakE#r)uV-_gY%|7;eUg?$fda zzDI!tY~C?Wqdyt_&FG&-e>M8MS)LhvY4j`m*1z!K>xU*rji^WBgg>NG`D{2QIinR- z`B8(_^O_Of#X%lxiJfvjZA4plH9z#hwPZf+7>*O_jBGmExz+b|ODOPcSWr(1e??d> z3B!|Gb>(ME06blCi#>e0F{CF}8xJ7k<4&Y|myHy0JQjdpP`?_BofKU#7G?BZfA zk>G!1_7{_(0~E6;4nqtMpARXpCIkQgfDQlv7yy$@CmKDJS6h>+I1ql{s{IcX??(jG zQA<5_9LFP$yS25mm*c0Z+5ZjsXKzc1zIx)c)pe64`J=-o}422C%>#HI~*k>*X#6^gOEpnhF>dYYP6uD zY$uOX+v|6Fec$yU{qU4Y9)JI<h`=O|2y4mF>x{ae1soJ+u$BS)cV+re7{Xe{>)vGun>tSv*22(t z?=l<}hOm|qd!3eMIC={5Sy~WDW)s0L7VLBwhb$%Pz2S~s=&hO@ZvX=tDu3-arOrVh z&OmyebtldlCNV4!^E$#c5s!6*XCfALgl{6A>WH3+Sk@7J6Y;%{7?_Av9r0iyf;wVo zBGz@p$V5ChR16h$(*U_u)q&Ps`v)zn_OI-l5>IW|ao4`Nh{{|;;P(bWeR(V)>Mf$i zVbNfNJB4kQ4K}EE-?7cA!G8wzD)^k?y7Z#P77gWdi*D1bGs>=B)0J&gmc3eV4^?w+ zC{aF7Myt@oELAkvmep3F60X`J2W`r=pKohiA1y@`HW+Kv1m4q4H39K;!aOuBb3=)8 zSX7lR+RaafCE7nr!xHV#m0^iW9kgY;?&YOIMS0dzl>A0ZZ*4M41%Dr=rc#0URw~rt zxuHbWSQ<)9xT^F~se-nc>wY8QM(IXNKOhXB)F#3pz7qEFY*dvVCTu7%VZ$w|W6&0J zt-gHc8Or2YOL2#_^aH|h6lfw0;#-H&D{XElF=0cA30IXq$}?z-xqfIQtfhGOYv~7s z)%~R5jR@i!Vf+a)lz*78p~Qr%N+0DJw8dNx8woc`;U1u-0Tb3Ia(#+Q$$|bx#DOK5 z712FVg@d1M34H|5|4W|cQrKu)F5!4xJ{{o_M&YXp$7tKyb1usV_}nVLFI1jVDkiMf6Gq8Fc3xeNc=o`A#;`7g#5>Dp8iCC<4Va7iwLi*Lo4(pvZZu zIBm3o679jEd3AYFFhiKO@NBgK>jk(dkd!0LlxX9Le`(j) zQ1(gJfb%rH!V)~?)KlC6V>1xZ5y{zrG+W#B0M0NpAVGPDvn0bmUJq8fKO1^w3svU*O+TM_~2Q4?y5i2ty9hPs-cm;jvzzDo^t?PO~_@uCt6x zW@L8#(M>+<@4_7l@;Lv0V!-8bKCRPRl1<4h9}!Q0s?UA?A*ycxlc56?vrZw?1POLK z&WDkf6_6O(=>PyrQ_&n7?tu#*rcARC_#DX=C4004jv000;O0000000000 z00000R+CF7D;uZ^dWlT|003PA000pH000000000000000vXhY~J^?n9&?i&@NRuTf LBL)a100000BqG|T diff --git a/EXCEL/eva_limit_frame_plan.xlsx b/EXCEL/eva_limit_frame_plan.xlsx index bd10941158842e63f7493509811554709e89e380..ecde55de5feb5382a7511d2be7d151e48168edc7 100644 GIT binary patch delta 3633 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 delta 3412 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 diff --git a/Migrations/25640301044832_AddLimitFrame.Designer.cs b/Migrations/25640301044832_AddLimitFrame.Designer.cs new file mode 100644 index 0000000..f648dff --- /dev/null +++ b/Migrations/25640301044832_AddLimitFrame.Designer.cs @@ -0,0 +1,905 @@ +// +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("25640301044832_AddLimitFrame")] + partial class AddLimitFrame + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("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("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("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("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_id"); + + b.Property("monthly_remuneration"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_id"); + + b.Property("salary"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("plan_guid"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("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_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_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 + } + } +} diff --git a/Migrations/25640301044832_AddLimitFrame.cs b/Migrations/25640301044832_AddLimitFrame.cs new file mode 100644 index 0000000..c7779c9 --- /dev/null +++ b/Migrations/25640301044832_AddLimitFrame.cs @@ -0,0 +1,132 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddLimitFrame : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "eva_limit_frame_plan", + columns: table => new + { + id = table.Column(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + plan_guid = table.Column(nullable: true), + executed_date = table.Column(nullable: true), + limit_frame_005 = table.Column(nullable: true), + status_self = table.Column(maxLength: 1, nullable: true), + status_chief = table.Column(maxLength: 1, nullable: true), + supervisor1 = table.Column(nullable: true), + supervisor1_result = table.Column(maxLength: 1, nullable: true), + supervisor1_remark = table.Column(maxLength: 1000, nullable: true), + supervisor1_date = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_eva_limit_frame_plan", x => x.id); + table.ForeignKey( + name: "FK_eva_limit_frame_plan_eva_performance_plan_plan_guid", + column: x => x.plan_guid, + principalTable: "eva_performance_plan", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "eva_limit_frame_group", + columns: table => new + { + id = table.Column(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + frame_plan_guid = table.Column(nullable: true), + group_guid = table.Column(nullable: true), + limit_frame_295 = table.Column(nullable: true), + total_salary = table.Column(nullable: true), + total_salary_limit = table.Column(nullable: true), + total_salary_limit_rounded = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_eva_limit_frame_group", x => x.id); + table.ForeignKey( + name: "FK_eva_limit_frame_group_eva_limit_frame_plan_frame_plan_guid", + column: x => x.frame_plan_guid, + principalTable: "eva_limit_frame_plan", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_eva_limit_frame_group_eva_evaluation_group_group_guid", + column: x => x.group_guid, + principalTable: "eva_evaluation_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "eva_limit_frame_employee", + columns: table => new + { + id = table.Column(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + frame_group_guid = table.Column(nullable: true), + employee_id = table.Column(nullable: true), + org_id = table.Column(nullable: true), + position_id = table.Column(nullable: true), + level_id = table.Column(nullable: true), + salary = table.Column(nullable: true), + position_allowance = table.Column(nullable: true), + monthly_remuneration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_eva_limit_frame_employee", x => x.id); + table.ForeignKey( + name: "FK_eva_limit_frame_employee_eva_limit_frame_group_frame_group_~", + column: x => x.frame_group_guid, + principalTable: "eva_limit_frame_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_employee_frame_group_guid", + table: "eva_limit_frame_employee", + column: "frame_group_guid"); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_group_frame_plan_guid", + table: "eva_limit_frame_group", + column: "frame_plan_guid"); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_group_group_guid", + table: "eva_limit_frame_group", + column: "group_guid"); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_plan_plan_guid", + table: "eva_limit_frame_plan", + column: "plan_guid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "eva_limit_frame_employee"); + + migrationBuilder.DropTable( + name: "eva_limit_frame_group"); + + migrationBuilder.DropTable( + name: "eva_limit_frame_plan"); + } + } +} diff --git a/Migrations/25640302035125_AddLimitFrameGroupColumn.Designer.cs b/Migrations/25640302035125_AddLimitFrameGroupColumn.Designer.cs new file mode 100644 index 0000000..24078ff --- /dev/null +++ b/Migrations/25640302035125_AddLimitFrameGroupColumn.Designer.cs @@ -0,0 +1,913 @@ +// +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("25640302035125_AddLimitFrameGroupColumn")] + partial class AddLimitFrameGroupColumn + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("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("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("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("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_id"); + + b.Property("limit_frame_group_id"); + + b.Property("monthly_remuneration"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_id"); + + b.Property("salary"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("frame_group_guid"); + + b.HasIndex("limit_frame_group_id"); + + b.ToTable("eva_limit_frame_employee"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("plan_guid"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("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_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_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"); + + b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_limit_frame_group_id") + .WithMany() + .HasForeignKey("limit_frame_group_id"); + }); + + 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 + } + } +} diff --git a/Migrations/25640302035125_AddLimitFrameGroupColumn.cs b/Migrations/25640302035125_AddLimitFrameGroupColumn.cs new file mode 100644 index 0000000..93977c9 --- /dev/null +++ b/Migrations/25640302035125_AddLimitFrameGroupColumn.cs @@ -0,0 +1,44 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddLimitFrameGroupColumn : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "limit_frame_group_id", + table: "eva_limit_frame_employee", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_employee_limit_frame_group_id", + table: "eva_limit_frame_employee", + column: "limit_frame_group_id"); + + migrationBuilder.AddForeignKey( + name: "FK_eva_limit_frame_employee_eva_limit_frame_group_limit_frame_~", + table: "eva_limit_frame_employee", + column: "limit_frame_group_id", + principalTable: "eva_limit_frame_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_eva_limit_frame_employee_eva_limit_frame_group_limit_frame_~", + table: "eva_limit_frame_employee"); + + migrationBuilder.DropIndex( + name: "IX_eva_limit_frame_employee_limit_frame_group_id", + table: "eva_limit_frame_employee"); + + migrationBuilder.DropColumn( + name: "limit_frame_group_id", + table: "eva_limit_frame_employee"); + } + } +} diff --git a/Migrations/25640302040600_RemoveLimitFrameGroupColumn.Designer.cs b/Migrations/25640302040600_RemoveLimitFrameGroupColumn.Designer.cs new file mode 100644 index 0000000..762899c --- /dev/null +++ b/Migrations/25640302040600_RemoveLimitFrameGroupColumn.Designer.cs @@ -0,0 +1,905 @@ +// +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("25640302040600_RemoveLimitFrameGroupColumn")] + partial class RemoveLimitFrameGroupColumn + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("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("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("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("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_id"); + + b.Property("monthly_remuneration"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_id"); + + b.Property("salary"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("plan_guid"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("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_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_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 + } + } +} diff --git a/Migrations/25640302040600_RemoveLimitFrameGroupColumn.cs b/Migrations/25640302040600_RemoveLimitFrameGroupColumn.cs new file mode 100644 index 0000000..a48c59f --- /dev/null +++ b/Migrations/25640302040600_RemoveLimitFrameGroupColumn.cs @@ -0,0 +1,44 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class RemoveLimitFrameGroupColumn : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_eva_limit_frame_employee_eva_limit_frame_group_limit_frame_~", + table: "eva_limit_frame_employee"); + + migrationBuilder.DropIndex( + name: "IX_eva_limit_frame_employee_limit_frame_group_id", + table: "eva_limit_frame_employee"); + + migrationBuilder.DropColumn( + name: "limit_frame_group_id", + table: "eva_limit_frame_employee"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "limit_frame_group_id", + table: "eva_limit_frame_employee", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_eva_limit_frame_employee_limit_frame_group_id", + table: "eva_limit_frame_employee", + column: "limit_frame_group_id"); + + migrationBuilder.AddForeignKey( + name: "FK_eva_limit_frame_employee_eva_limit_frame_group_limit_frame_~", + table: "eva_limit_frame_employee", + column: "limit_frame_group_id", + principalTable: "eva_limit_frame_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Migrations/25640302050315_FixMissingColumn.Designer.cs b/Migrations/25640302050315_FixMissingColumn.Designer.cs new file mode 100644 index 0000000..4f1ee70 --- /dev/null +++ b/Migrations/25640302050315_FixMissingColumn.Designer.cs @@ -0,0 +1,907 @@ +// +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("25640302050315_FixMissingColumn")] + partial class FixMissingColumn + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("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("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("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("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_id"); + + b.Property("monthly_remuneration"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_id"); + + b.Property("salary"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("plan_guid"); + + b.Property("salary_adjustment_date"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("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_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_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 + } + } +} diff --git a/Migrations/25640302050315_FixMissingColumn.cs b/Migrations/25640302050315_FixMissingColumn.cs new file mode 100644 index 0000000..0a5beaf --- /dev/null +++ b/Migrations/25640302050315_FixMissingColumn.cs @@ -0,0 +1,23 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class FixMissingColumn : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "salary_adjustment_date", + table: "eva_limit_frame_plan", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "salary_adjustment_date", + table: "eva_limit_frame_plan"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index df8faaa..708c72e 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -585,6 +585,111 @@ namespace tb320eva.Migrations b.ToTable("eva_level_score"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_id"); + + b.Property("monthly_remuneration"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_id"); + + b.Property("salary"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("plan_guid"); + + b.Property("salary_adjustment_date"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => { b.Property("id") @@ -756,6 +861,31 @@ namespace tb320eva.Migrations .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") diff --git a/Models/eva_limit_frame_employee/Ieva_limit_frame_employeeService.cs b/Models/eva_limit_frame_employee/Ieva_limit_frame_employeeService.cs new file mode 100644 index 0000000..2f90f1f --- /dev/null +++ b/Models/eva_limit_frame_employee/Ieva_limit_frame_employeeService.cs @@ -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_limit_frame_employeeService : IBaseService2 + { + new eva_limit_frame_employeeViewModel Insert(eva_limit_frame_employeeInputModel model, bool is_force_save); + new eva_limit_frame_employeeViewModel Update(Guid id, eva_limit_frame_employeeInputModel model, bool is_force_save); + List GetListByemployee_id(int? employee_id); + List GetListBySearch(eva_limit_frame_employeeSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + eva_limit_frame_employeeWithSelectionViewModel GetWithSelection(Guid id); + eva_limit_frame_employeeWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_limit_frame_employeeEntity GetEntity(Guid id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeEntity.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeEntity.cs new file mode 100644 index 0000000..cc8fead --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeEntity.cs @@ -0,0 +1,49 @@ +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_limit_frame_employeeEntity : BaseEntity2 + { + + + [ForeignKey("frame_group_guid")] + public eva_limit_frame_groupEntity eva_limit_frame_group_frame_group_guid { get; set; } + public Guid? frame_group_guid { get; set; } + + public int? employee_id { get; set; } + + public int? org_id { get; set; } + + public int? position_id { get; set; } + + public int? level_id { get; set; } + + public decimal? salary { get; set; } + + public decimal? position_allowance { get; set; } + + public decimal? monthly_remuneration { get; set; } + + + public void SetAutoField(DataContext context) + { + + } + + public void DoAfterInsertUpdate(DataContext context) + { + + } + + } +} diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeInputModel.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeInputModel.cs new file mode 100644 index 0000000..2186d94 --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeInputModel.cs @@ -0,0 +1,38 @@ +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_limit_frame_employeeInputModel + { + + public Guid? id { get; set; } + + public Guid? frame_group_guid { get; set; } + + public int? employee_id { get; set; } + + public int? org_id { get; set; } + + public int? position_id { get; set; } + + public int? level_id { get; set; } + + public decimal? salary { get; set; } + + public decimal? position_allowance { get; set; } + + public decimal? monthly_remuneration { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeReportRequestModel.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeReportRequestModel.cs new file mode 100644 index 0000000..1c65280 --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeReportRequestModel.cs @@ -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_limit_frame_employeeReportRequestModel : eva_limit_frame_employeeSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeSearchModel.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeSearchModel.cs new file mode 100644 index 0000000..5f5f7bb --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeSearchModel.cs @@ -0,0 +1,25 @@ +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_limit_frame_employeeSearchModel + { + + public Guid id { get; set; } + + public Guid? frame_group_guid { get; set; } + + public int? employee_id { get; set; } + + } +} + diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs new file mode 100644 index 0000000..cfbc4ef --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs @@ -0,0 +1,338 @@ +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_limit_frame_employeeService : Ieva_limit_frame_employeeService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + private Iexternal_employeeService emp; + + public eva_limit_frame_employeeService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext, + Iexternal_employeeService inemp) + { + _repository = repository; + db = mydb; + ext = inext; + emp = inemp; + } + + #region Private Functions + private eva_limit_frame_employeeEntity GetEntity(eva_limit_frame_employeeInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_limit_frame_employeeViewModel GetDto(eva_limit_frame_employeeEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_limit_frame_employeeViewModel Get(Guid id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_limit_frame_employeeEntity GetEntity(Guid id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_limit_frame_employeeWithSelectionViewModel GetWithSelection(Guid id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + i.item_employee_id = (from x in emp.GetAllEmployee() select x).ToList(); + i.item_org_id = (from x in ext.GetSortingDep() select x).ToList(); + i.item_position_id = (from x in ext.GetPositionForReport() select x).ToList(); + i.item_level_id = (from x in ext.Gethrm_position_levels() select x).ToList(); + + + return i; + } + public eva_limit_frame_employeeWithSelectionViewModel GetBlankItem() + { + var i = new eva_limit_frame_employeeWithSelectionViewModel(); + i.item_employee_id = (from x in emp.GetAllEmployee() select x).ToList(); + i.item_org_id = (from x in ext.GetSortingDep() select x).ToList(); + i.item_position_id = (from x in ext.GetPositionForReport() select x).ToList(); + i.item_level_id = (from x in ext.Gethrm_position_levels() select x).ToList(); + + + return i; + } + + public List GetListByemployee_id(int? employee_id) + { + var model = new eva_limit_frame_employeeSearchModel(); + model.employee_id = employee_id; + return GetListBySearch(model); + } + + public List GetListBySearch(eva_limit_frame_employeeSearchModel model) + { + var data = ( + from m_eva_limit_frame_employee in _repository.Context.eva_limit_frame_employee + + join fk_eva_limit_frame_group1 in _repository.Context.eva_limit_frame_group on m_eva_limit_frame_employee.frame_group_guid equals fk_eva_limit_frame_group1.id + into eva_limit_frame_groupResult1 + from fk_eva_limit_frame_groupResult1 in eva_limit_frame_groupResult1.DefaultIfEmpty() + + join fk_external_linkage2 in emp.GetAllEmployee() on m_eva_limit_frame_employee.employee_id equals fk_external_linkage2.id + into external_linkageResult2 + from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty() + + join fk_external_linkage3 in ext.GetSortingDep() on m_eva_limit_frame_employee.org_id equals fk_external_linkage3.id + into external_linkageResult3 + from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty() + + join fk_external_linkage4 in ext.GetPositionForReport() on m_eva_limit_frame_employee.position_id equals fk_external_linkage4.id + into external_linkageResult4 + from fk_external_linkageResult4 in external_linkageResult4.DefaultIfEmpty() + + join fk_external_linkage5 in ext.Gethrm_position_levels() on m_eva_limit_frame_employee.level_id equals fk_external_linkage5.id + into external_linkageResult5 + from fk_external_linkageResult5 in external_linkageResult5.DefaultIfEmpty() + + + where + 1 == 1 + && (!model.frame_group_guid.HasValue || m_eva_limit_frame_employee.frame_group_guid == model.frame_group_guid) + && (!model.employee_id.HasValue || m_eva_limit_frame_employee.employee_id == model.employee_id) + + + orderby m_eva_limit_frame_employee.created descending + select new eva_limit_frame_employeeViewModel() + { + id = m_eva_limit_frame_employee.id, + frame_group_guid = m_eva_limit_frame_employee.frame_group_guid, + employee_id = m_eva_limit_frame_employee.employee_id, + org_id = m_eva_limit_frame_employee.org_id, + position_id = m_eva_limit_frame_employee.position_id, + level_id = m_eva_limit_frame_employee.level_id, + salary = m_eva_limit_frame_employee.salary, + position_allowance = m_eva_limit_frame_employee.position_allowance, + monthly_remuneration = m_eva_limit_frame_employee.monthly_remuneration, + + frame_group_guid_eva_limit_frame_group_group_guid = fk_eva_limit_frame_groupResult1.group_guid, + employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname, + org_id_external_linkage_external_name = fk_external_linkageResult3.external_name, + position_id_external_linkage_external_name = fk_external_linkageResult4.external_name, + level_id_external_linkage_external_name = fk_external_linkageResult5.external_name, + + isActive = m_eva_limit_frame_employee.isActive, + Created = m_eva_limit_frame_employee.created, + Updated = m_eva_limit_frame_employee.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + + + public eva_limit_frame_employeeViewModel Insert(eva_limit_frame_employeeInputModel model, bool is_force_save) + { + var entity = GetEntity(model); + entity.id = Guid.NewGuid(); + + + 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(entity); + } + } + + public eva_limit_frame_employeeViewModel Update(Guid id, eva_limit_frame_employeeInputModel model, bool is_force_save) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.frame_group_guid = model.frame_group_guid; + existingEntity.employee_id = model.employee_id; + existingEntity.org_id = model.org_id; + existingEntity.position_id = model.position_id; + existingEntity.level_id = model.level_id; + existingEntity.salary = model.salary; + existingEntity.position_allowance = model.position_allowance; + existingEntity.monthly_remuneration = model.monthly_remuneration; + + 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(existingEntity); + } + } + else + throw new NotificationException("No data to update"); + } + + public string UpdateMultiple(List 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.frame_group_guid = i.frame_group_guid; + existingEntity.employee_id = i.employee_id; + existingEntity.org_id = i.org_id; + existingEntity.position_id = i.position_id; + existingEntity.level_id = i.level_id; + existingEntity.salary = i.salary; + existingEntity.position_allowance = i.position_allowance; + existingEntity.monthly_remuneration = i.monthly_remuneration; + + 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 = Guid.NewGuid(); + 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_limit_frame_employeeViewModel SetAsActive(Guid id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_limit_frame_employeeViewModel SetAsInactive(Guid id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(Guid id) + { + _repository.Delete(id); + + return; + } + + public void RefreshAutoFieldOfAllData() + { + var all_items = from i in _repository.Context.eva_limit_frame_employee + select i; + foreach (var item in all_items) + { + item.SetAutoField(_repository.Context); + } + _repository.Context.SaveChanges(); + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("frame_group_guid", "frame_plan_guid"); + i.Add("frame_group_guid_eva_limit_frame_group_group_guid", "frame_plan_guid"); + i.Add("employee_id", "พนักงาน"); + i.Add("employee_id_external_linkage_external_name", "พนักงาน"); + i.Add("org_id", "หน่วยงาน"); + i.Add("org_id_external_linkage_external_name", "หน่วยงาน"); + i.Add("position_id", "ตำแหน่ง"); + i.Add("position_id_external_linkage_external_name", "ตำแหน่ง"); + i.Add("level_id", "ระดับ"); + i.Add("level_id_external_linkage_external_name", "ระดับ"); + i.Add("salary", "เงินเดือน"); + i.Add("position_allowance", "เงินประจำตำแหน่ง"); + i.Add("monthly_remuneration", "ค่าตอบแทนรายเดือน"); + i.Add("limit_frame_group_id", "limit_frame_group_id"); + i.Add("limit_frame_group_id_eva_limit_frame_group_group_guid", "limit_frame_group_id"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeViewModel.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeViewModel.cs new file mode 100644 index 0000000..3e0c3c4 --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeViewModel.cs @@ -0,0 +1,40 @@ +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_limit_frame_employeeViewModel : BaseViewModel2 + { + + public Guid? frame_group_guid { get; set; } + + public int? employee_id { get; set; } + + public int? org_id { get; set; } + + public int? position_id { get; set; } + + public int? level_id { get; set; } + + public decimal? salary { get; set; } + + public decimal? position_allowance { get; set; } + + public decimal? monthly_remuneration { get; set; } + + public Guid? frame_group_guid_eva_limit_frame_group_group_guid { get; set; } + public string employee_id_external_linkage_external_name { get; set; } + public string org_id_external_linkage_external_name { get; set; } + public string position_id_external_linkage_external_name { get; set; } + public string level_id_external_linkage_external_name { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeWithSelectionViewModel.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeWithSelectionViewModel.cs new file mode 100644 index 0000000..d647d6a --- /dev/null +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeWithSelectionViewModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_limit_frame_employeeWithSelectionViewModel: eva_limit_frame_employeeViewModel + { + public List item_employee_id { get; set; } + public List item_org_id { get; set; } + public List item_position_id { get; set; } + public List item_level_id { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_group/Ieva_limit_frame_groupService.cs b/Models/eva_limit_frame_group/Ieva_limit_frame_groupService.cs new file mode 100644 index 0000000..b794866 --- /dev/null +++ b/Models/eva_limit_frame_group/Ieva_limit_frame_groupService.cs @@ -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_limit_frame_groupService : IBaseService2 + { + new eva_limit_frame_groupViewModel Insert(eva_limit_frame_groupInputModel model, bool is_force_save); + new eva_limit_frame_groupViewModel Update(Guid id, eva_limit_frame_groupInputModel model, bool is_force_save); + List GetListBygroup_guid(Guid? group_guid); + List GetListBySearch(eva_limit_frame_groupSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + eva_limit_frame_groupWithSelectionViewModel GetWithSelection(Guid id); + eva_limit_frame_groupWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_limit_frame_groupEntity GetEntity(Guid id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupEntity.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupEntity.cs new file mode 100644 index 0000000..cd5ace4 --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupEntity.cs @@ -0,0 +1,47 @@ +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_limit_frame_groupEntity : BaseEntity2 + { + + + [ForeignKey("frame_plan_guid")] + public eva_limit_frame_planEntity eva_limit_frame_plan_frame_plan_guid { get; set; } + public Guid? frame_plan_guid { get; set; } + + [ForeignKey("group_guid")] + public eva_evaluation_groupEntity eva_evaluation_group_group_guid { get; set; } + public Guid? group_guid { get; set; } + + public decimal? limit_frame_295 { get; set; } + + public decimal? total_salary { get; set; } + + public decimal? total_salary_limit { get; set; } + + public decimal? total_salary_limit_rounded { get; set; } + + + public void SetAutoField(DataContext context) + { + + } + + public void DoAfterInsertUpdate(DataContext context) + { + + } + + } +} diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupInputModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupInputModel.cs new file mode 100644 index 0000000..4d5994f --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupInputModel.cs @@ -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_limit_frame_groupInputModel + { + + public Guid? id { get; set; } + + public Guid? frame_plan_guid { get; set; } + + public Guid? group_guid { get; set; } + + public decimal? limit_frame_295 { get; set; } + + public decimal? total_salary { get; set; } + + public decimal? total_salary_limit { get; set; } + + public decimal? total_salary_limit_rounded { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupReportRequestModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupReportRequestModel.cs new file mode 100644 index 0000000..8fc080c --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupReportRequestModel.cs @@ -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_limit_frame_groupReportRequestModel : eva_limit_frame_groupSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupSearchModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupSearchModel.cs new file mode 100644 index 0000000..7f6bbd9 --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupSearchModel.cs @@ -0,0 +1,25 @@ +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_limit_frame_groupSearchModel + { + + public Guid id { get; set; } + + public Guid? frame_plan_guid { get; set; } + + public Guid? group_guid { get; set; } + + } +} + diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs new file mode 100644 index 0000000..b859240 --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs @@ -0,0 +1,301 @@ +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_limit_frame_groupService : Ieva_limit_frame_groupService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public eva_limit_frame_groupService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + #region Private Functions + private eva_limit_frame_groupEntity GetEntity(eva_limit_frame_groupInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_limit_frame_groupViewModel GetDto(eva_limit_frame_groupEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_limit_frame_groupViewModel Get(Guid id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_limit_frame_groupEntity GetEntity(Guid id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_limit_frame_groupWithSelectionViewModel GetWithSelection(Guid id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + i.item_group_guid = (from x in _repository.Context.eva_evaluation_group select x).ToList(); + + + return i; + } + public eva_limit_frame_groupWithSelectionViewModel GetBlankItem() + { + var i = new eva_limit_frame_groupWithSelectionViewModel(); + i.item_group_guid = (from x in _repository.Context.eva_evaluation_group select x).ToList(); + + + return i; + } + + public List GetListBygroup_guid(Guid? group_guid) + { + var model = new eva_limit_frame_groupSearchModel(); + model.group_guid = group_guid; + return GetListBySearch(model); + } + + public List GetListBySearch(eva_limit_frame_groupSearchModel model) + { + var data = ( + from m_eva_limit_frame_group in _repository.Context.eva_limit_frame_group + + join fk_eva_limit_frame_plan1 in _repository.Context.eva_limit_frame_plan on m_eva_limit_frame_group.frame_plan_guid equals fk_eva_limit_frame_plan1.id + into eva_limit_frame_planResult1 + from fk_eva_limit_frame_planResult1 in eva_limit_frame_planResult1.DefaultIfEmpty() + + join fk_eva_evaluation_group2 in _repository.Context.eva_evaluation_group on m_eva_limit_frame_group.group_guid equals fk_eva_evaluation_group2.id + into eva_evaluation_groupResult2 + from fk_eva_evaluation_groupResult2 in eva_evaluation_groupResult2.DefaultIfEmpty() + + + where + 1 == 1 + && (!model.frame_plan_guid.HasValue || m_eva_limit_frame_group.frame_plan_guid == model.frame_plan_guid) + && (!model.group_guid.HasValue || m_eva_limit_frame_group.group_guid == model.group_guid) + + + orderby m_eva_limit_frame_group.created descending + select new eva_limit_frame_groupViewModel() + { + id = m_eva_limit_frame_group.id, + frame_plan_guid = m_eva_limit_frame_group.frame_plan_guid, + group_guid = m_eva_limit_frame_group.group_guid, + limit_frame_295 = m_eva_limit_frame_group.limit_frame_295, + total_salary = m_eva_limit_frame_group.total_salary, + total_salary_limit = m_eva_limit_frame_group.total_salary_limit, + total_salary_limit_rounded = m_eva_limit_frame_group.total_salary_limit_rounded, + + frame_plan_guid_eva_limit_frame_plan_executed_date = fk_eva_limit_frame_planResult1.executed_date, + group_guid_eva_evaluation_group_code = fk_eva_evaluation_groupResult2.code, + + isActive = m_eva_limit_frame_group.isActive, + Created = m_eva_limit_frame_group.created, + Updated = m_eva_limit_frame_group.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + + + public eva_limit_frame_groupViewModel Insert(eva_limit_frame_groupInputModel model, bool is_force_save) + { + var entity = GetEntity(model); + entity.id = Guid.NewGuid(); + + + 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(entity); + } + } + + public eva_limit_frame_groupViewModel Update(Guid id, eva_limit_frame_groupInputModel model, bool is_force_save) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.frame_plan_guid = model.frame_plan_guid; + existingEntity.group_guid = model.group_guid; + existingEntity.limit_frame_295 = model.limit_frame_295; + existingEntity.total_salary = model.total_salary; + existingEntity.total_salary_limit = model.total_salary_limit; + existingEntity.total_salary_limit_rounded = model.total_salary_limit_rounded; + + 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(existingEntity); + } + } + else + throw new NotificationException("No data to update"); + } + + public string UpdateMultiple(List 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.frame_plan_guid = i.frame_plan_guid; + existingEntity.group_guid = i.group_guid; + existingEntity.limit_frame_295 = i.limit_frame_295; + existingEntity.total_salary = i.total_salary; + existingEntity.total_salary_limit = i.total_salary_limit; + existingEntity.total_salary_limit_rounded = i.total_salary_limit_rounded; + + 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 = Guid.NewGuid(); + 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_limit_frame_groupViewModel SetAsActive(Guid id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_limit_frame_groupViewModel SetAsInactive(Guid id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(Guid id) + { + _repository.Delete(id); + + return; + } + + public void RefreshAutoFieldOfAllData() + { + var all_items = from i in _repository.Context.eva_limit_frame_group + select i; + foreach (var item in all_items) + { + item.SetAutoField(_repository.Context); + } + _repository.Context.SaveChanges(); + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("frame_plan_guid", "frame_plan_guid"); + i.Add("frame_plan_guid_eva_limit_frame_plan_executed_date", "frame_plan_guid"); + i.Add("group_guid", "กลุ่มการประเมิน"); + i.Add("group_guid_eva_evaluation_group_code", "กลุ่มการประเมิน"); + i.Add("limit_frame_295", "กรอบวงเงินที่กันไว้"); + i.Add("total_salary", "อัตราเงินเดือนรวม"); + i.Add("total_salary_limit", "วงเงินในการเลื่อนเงินเดือน"); + i.Add("total_salary_limit_rounded", "วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs new file mode 100644 index 0000000..afd304c --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs @@ -0,0 +1,33 @@ +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_limit_frame_groupViewModel : BaseViewModel2 + { + + public Guid? frame_plan_guid { get; set; } + + public Guid? group_guid { get; set; } + + public decimal? limit_frame_295 { get; set; } + + public decimal? total_salary { get; set; } + + public decimal? total_salary_limit { get; set; } + + public decimal? total_salary_limit_rounded { get; set; } + + public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; } + public string group_guid_eva_evaluation_group_code { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupWithSelectionViewModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupWithSelectionViewModel.cs new file mode 100644 index 0000000..86aa5f9 --- /dev/null +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupWithSelectionViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_limit_frame_groupWithSelectionViewModel: eva_limit_frame_groupViewModel + { + public List item_group_guid { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_plan/Ieva_limit_frame_planService.cs b/Models/eva_limit_frame_plan/Ieva_limit_frame_planService.cs new file mode 100644 index 0000000..03d3399 --- /dev/null +++ b/Models/eva_limit_frame_plan/Ieva_limit_frame_planService.cs @@ -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_limit_frame_planService : IBaseService2 + { + new eva_limit_frame_planViewModel Insert(eva_limit_frame_planInputModel model, bool is_force_save); + new eva_limit_frame_planViewModel Update(Guid id, eva_limit_frame_planInputModel model, bool is_force_save); + List GetListByexecuted_date(DateTime? executed_date); + List GetListBySearch(eva_limit_frame_planSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + eva_limit_frame_planWithSelectionViewModel GetWithSelection(Guid id); + eva_limit_frame_planWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_limit_frame_planEntity GetEntity(Guid id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs new file mode 100644 index 0000000..7b35303 --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs @@ -0,0 +1,57 @@ +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_limit_frame_planEntity : BaseEntity2 + { + + + [ForeignKey("plan_guid")] + public eva_performance_planEntity eva_performance_plan_plan_guid { get; set; } + public Guid? plan_guid { get; set; } + + public DateTime? executed_date { get; set; } + + public decimal? limit_frame_005 { get; set; } + + [MaxLength(1)] + public string status_self { get; set; } + + [MaxLength(1)] + public string status_chief { get; set; } + + public int? supervisor1 { get; set; } + + [MaxLength(1)] + public string supervisor1_result { get; set; } + + [MaxLength(1000)] + public string supervisor1_remark { get; set; } + + public DateTime? supervisor1_date { get; set; } + + public DateTime? salary_adjustment_date { get; set; } + + + public void SetAutoField(DataContext context) + { + + } + + public void DoAfterInsertUpdate(DataContext context) + { + + } + + } +} diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planInputModel.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planInputModel.cs new file mode 100644 index 0000000..72a1a66 --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planInputModel.cs @@ -0,0 +1,42 @@ +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_limit_frame_planInputModel + { + + public Guid? id { get; set; } + + public Guid? plan_guid { get; set; } + + public DateTime? executed_date { get; set; } + + public decimal? limit_frame_005 { get; set; } + + public string status_self { get; set; } + + public string status_chief { get; set; } + + public int? supervisor1 { get; set; } + + public string supervisor1_result { get; set; } + + public string supervisor1_remark { get; set; } + + public DateTime? supervisor1_date { get; set; } + + public DateTime? salary_adjustment_date { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planReportRequestModel.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planReportRequestModel.cs new file mode 100644 index 0000000..a3760e4 --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planReportRequestModel.cs @@ -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_limit_frame_planReportRequestModel : eva_limit_frame_planSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planSearchModel.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planSearchModel.cs new file mode 100644 index 0000000..58c7b5e --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planSearchModel.cs @@ -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_limit_frame_planSearchModel + { + + public Guid id { get; set; } + + public DateTime? executed_date { get; set; } + + } +} + diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs new file mode 100644 index 0000000..7e60ce9 --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs @@ -0,0 +1,320 @@ +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_limit_frame_planService : Ieva_limit_frame_planService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public eva_limit_frame_planService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + #region Private Functions + private eva_limit_frame_planEntity GetEntity(eva_limit_frame_planInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_limit_frame_planViewModel GetDto(eva_limit_frame_planEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_limit_frame_planViewModel Get(Guid id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_limit_frame_planEntity GetEntity(Guid id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_limit_frame_planWithSelectionViewModel GetWithSelection(Guid id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + i.item_plan_guid = (from x in _repository.Context.eva_performance_plan select x).ToList(); + //i.item_supervisor1_result = (from x in ext.GetDemoItem() select x).ToList(); + + + return i; + } + public eva_limit_frame_planWithSelectionViewModel GetBlankItem() + { + var i = new eva_limit_frame_planWithSelectionViewModel(); + i.item_plan_guid = (from x in _repository.Context.eva_performance_plan select x).ToList(); + //i.item_supervisor1_result = (from x in ext.GetDemoItem() select x).ToList(); + + + return i; + } + + public List GetListByexecuted_date(DateTime? executed_date) + { + var model = new eva_limit_frame_planSearchModel(); + model.executed_date = executed_date; + return GetListBySearch(model); + } + + public List GetListBySearch(eva_limit_frame_planSearchModel model) + { + var data = ( + from m_eva_limit_frame_plan in _repository.Context.eva_limit_frame_plan + + join fk_eva_performance_plan1 in _repository.Context.eva_performance_plan on m_eva_limit_frame_plan.plan_guid equals fk_eva_performance_plan1.id + into eva_performance_planResult1 + from fk_eva_performance_planResult1 in eva_performance_planResult1.DefaultIfEmpty() + + //join fk_external_linkage7 in ext.GetDemoItem() on m_eva_limit_frame_plan.supervisor1_result equals fk_external_linkage7.external_code + //into external_linkageResult7 + //from fk_external_linkageResult7 in external_linkageResult7.DefaultIfEmpty() + + + where + 1 == 1 + && (!model.executed_date.HasValue || m_eva_limit_frame_plan.executed_date == model.executed_date) + + + orderby m_eva_limit_frame_plan.created descending + select new eva_limit_frame_planViewModel() + { + id = m_eva_limit_frame_plan.id, + plan_guid = m_eva_limit_frame_plan.plan_guid, + executed_date = m_eva_limit_frame_plan.executed_date, + limit_frame_005 = m_eva_limit_frame_plan.limit_frame_005, + status_self = m_eva_limit_frame_plan.status_self, + status_chief = m_eva_limit_frame_plan.status_chief, + supervisor1 = m_eva_limit_frame_plan.supervisor1, + supervisor1_result = m_eva_limit_frame_plan.supervisor1_result, + supervisor1_remark = m_eva_limit_frame_plan.supervisor1_remark, + supervisor1_date = m_eva_limit_frame_plan.supervisor1_date, + salary_adjustment_date = m_eva_limit_frame_plan.salary_adjustment_date, + + plan_guid_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.fiscal_year, + //supervisor1_result_external_linkage_external_name = fk_external_linkageResult7.external_name, + + isActive = m_eva_limit_frame_plan.isActive, + Created = m_eva_limit_frame_plan.created, + Updated = m_eva_limit_frame_plan.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + + + public eva_limit_frame_planViewModel Insert(eva_limit_frame_planInputModel model, bool is_force_save) + { + var entity = GetEntity(model); + entity.id = Guid.NewGuid(); + + + 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(entity); + } + } + + public eva_limit_frame_planViewModel Update(Guid id, eva_limit_frame_planInputModel model, bool is_force_save) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.plan_guid = model.plan_guid; + existingEntity.executed_date = model.executed_date; + existingEntity.limit_frame_005 = model.limit_frame_005; + existingEntity.status_self = model.status_self; + existingEntity.status_chief = model.status_chief; + existingEntity.supervisor1 = model.supervisor1; + existingEntity.supervisor1_result = model.supervisor1_result; + existingEntity.supervisor1_remark = model.supervisor1_remark; + existingEntity.supervisor1_date = model.supervisor1_date; + existingEntity.salary_adjustment_date = model.salary_adjustment_date; + + 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(existingEntity); + } + } + else + throw new NotificationException("No data to update"); + } + + public string UpdateMultiple(List 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.plan_guid = i.plan_guid; + existingEntity.executed_date = i.executed_date; + existingEntity.limit_frame_005 = i.limit_frame_005; + existingEntity.status_self = i.status_self; + existingEntity.status_chief = i.status_chief; + existingEntity.supervisor1 = i.supervisor1; + existingEntity.supervisor1_result = i.supervisor1_result; + existingEntity.supervisor1_remark = i.supervisor1_remark; + existingEntity.supervisor1_date = i.supervisor1_date; + existingEntity.salary_adjustment_date = i.salary_adjustment_date; + + 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 = Guid.NewGuid(); + 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_limit_frame_planViewModel SetAsActive(Guid id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_limit_frame_planViewModel SetAsInactive(Guid id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(Guid id) + { + _repository.Delete(id); + + return; + } + + public void RefreshAutoFieldOfAllData() + { + var all_items = from i in _repository.Context.eva_limit_frame_plan + select i; + foreach (var item in all_items) + { + item.SetAutoField(_repository.Context); + } + _repository.Context.SaveChanges(); + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("plan_guid", "แผนการประเมิน"); + i.Add("plan_guid_eva_performance_plan_fiscal_year", "แผนการประเมิน"); + i.Add("executed_date", "วันที่ตั้งกรอบวงเงิน"); + i.Add("txt_executed_date", "วันที่ตั้งกรอบวงเงิน"); + i.Add("limit_frame_005", "กรอบวงเงินที่กันไว้"); + i.Add("status_self", "สถานะการส่ง กรอบวงเงิน"); + i.Add("status_chief", "สถานะการตรวจ กรอบวงเงิน"); + i.Add("supervisor1", "ผู้ตรวจกรอบวงเงิน"); + i.Add("supervisor1_result", "ผลการตรวจ"); + i.Add("supervisor1_result_external_linkage_external_name", "ผลการตรวจ"); + i.Add("supervisor1_remark", "ความเห็นผู้ประเมิน"); + i.Add("supervisor1_date", "วันที่ประเมิน"); + i.Add("txt_supervisor1_date", "วันที่ประเมิน"); + i.Add("txt_salary_adjustment_date", "เลื่อนเงินเดือนวันที่"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planViewModel.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planViewModel.cs new file mode 100644 index 0000000..991fac2 --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planViewModel.cs @@ -0,0 +1,47 @@ +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_limit_frame_planViewModel : BaseViewModel2 + { + + public Guid? plan_guid { get; set; } + + public DateTime? executed_date { get; set; } + + public string txt_executed_date { get { return MyHelper.GetDateStringForReport(this.executed_date); } } + + public decimal? limit_frame_005 { get; set; } + + public string status_self { get; set; } + + public string status_chief { get; set; } + + public int? supervisor1 { get; set; } + + public string supervisor1_result { get; set; } + + public string supervisor1_remark { get; set; } + + public DateTime? supervisor1_date { get; set; } + + public string txt_supervisor1_date { get { return MyHelper.GetDateStringForReport(this.supervisor1_date); } } + + public DateTime? salary_adjustment_date { get; set; } + + public string txt_salary_adjustment_date { get { return MyHelper.GetDateStringForReport(this.salary_adjustment_date); } } + + public int? plan_guid_eva_performance_plan_fiscal_year { get; set; } + public string supervisor1_result_external_linkage_external_name { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planWithSelectionViewModel.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planWithSelectionViewModel.cs new file mode 100644 index 0000000..29d0bcb --- /dev/null +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planWithSelectionViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_limit_frame_planWithSelectionViewModel: eva_limit_frame_planViewModel + { + public List item_plan_guid { get; set; } + public List item_supervisor1_result { get; set; } + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 9ad9143..b82ca5a 100644 --- a/Startup.cs +++ b/Startup.cs @@ -312,6 +312,15 @@ namespace Test01 services.AddScoped(); + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -571,6 +580,18 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/eva_limit_frame_employeeViewControllers.cs b/ViewControllers/eva_limit_frame_employeeViewControllers.cs new file mode 100644 index 0000000..f0d4548 --- /dev/null +++ b/ViewControllers/eva_limit_frame_employeeViewControllers.cs @@ -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_limit_frame_employeeViewController : Controller + { + private ILogger _logger; + private Ieva_limit_frame_employeeService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_employeeViewController(ILogger logger, Ieva_limit_frame_employeeService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult eva_limit_frame_employee() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult eva_limit_frame_employee_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult eva_limit_frame_employee_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult eva_limit_frame_employee_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 }); + } + } +} + + diff --git a/ViewControllers/eva_limit_frame_groupViewControllers.cs b/ViewControllers/eva_limit_frame_groupViewControllers.cs new file mode 100644 index 0000000..4fa9bb6 --- /dev/null +++ b/ViewControllers/eva_limit_frame_groupViewControllers.cs @@ -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_limit_frame_groupViewController : Controller + { + private ILogger _logger; + private Ieva_limit_frame_groupService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_groupViewController(ILogger logger, Ieva_limit_frame_groupService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult eva_limit_frame_group() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult eva_limit_frame_group_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult eva_limit_frame_group_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult eva_limit_frame_group_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 }); + } + } +} + + diff --git a/ViewControllers/eva_limit_frame_planViewControllers.cs b/ViewControllers/eva_limit_frame_planViewControllers.cs new file mode 100644 index 0000000..cb49d25 --- /dev/null +++ b/ViewControllers/eva_limit_frame_planViewControllers.cs @@ -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_limit_frame_planViewController : Controller + { + private ILogger _logger; + private Ieva_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_limit_frame_planViewController(ILogger logger, Ieva_limit_frame_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult eva_limit_frame_plan() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult eva_limit_frame_plan_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult eva_limit_frame_plan_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult eva_limit_frame_plan_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 }); + } + } +} + + diff --git a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml new file mode 100644 index 0000000..03b1364 --- /dev/null +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml @@ -0,0 +1,146 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_employee"; +} + + + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
ค้นหา eva_limit_frame_employee
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
เครื่องมือ
+
+ +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_d.cshtml b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_d.cshtml new file mode 100644 index 0000000..733dc63 --- /dev/null +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_d.cshtml @@ -0,0 +1,108 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_employee"; + Layout = "_LayoutDirect"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
บันทึกข้อมูล eva_limit_frame_employee
+ +
+
+ กรุณากรอกข้อมูลลงในแบบฟอร์ม +
+
+ +
+
+ + + + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+
+
+ +
+
+ + +
+
+ +
+ +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_inline.cshtml b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_inline.cshtml new file mode 100644 index 0000000..6e6596d --- /dev/null +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_inline.cshtml @@ -0,0 +1,68 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; + ViewData["Title"] = "eva_limit_frame_employee"; +} + +
+ +
จัดการ eva_limit_frame_employee
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + +
ลำดับกิจกรรม
+ +
+
+ +
+ + +
+ +
+
+ +
+ +@section FooterPlaceHolder{ + + +} diff --git a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_report.cshtml b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_report.cshtml new file mode 100644 index 0000000..a3b1219 --- /dev/null +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_report.cshtml @@ -0,0 +1,55 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_employee"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+
+ +
+
+ +
+
รายงาน eva_limit_frame_employee
+
+
+
+
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_wizardform.cshtml b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_wizardform.cshtml new file mode 100644 index 0000000..f2d6cae --- /dev/null +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee_wizardform.cshtml @@ -0,0 +1,71 @@ + + + +
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml new file mode 100644 index 0000000..9661908 --- /dev/null +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml @@ -0,0 +1,133 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_group"; +} + + + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
ค้นหา eva_limit_frame_group
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + +
เครื่องมือ
+
+ +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml new file mode 100644 index 0000000..bb629b5 --- /dev/null +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml @@ -0,0 +1,286 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_group"; + Layout = "_LayoutDirect"; +} + + + + + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
บันทึกข้อมูล eva_limit_frame_group
+ +
+
+ กรุณากรอกข้อมูลลงในแบบฟอร์ม +
+
+ +
+
+ + + + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+
+
+ +
+
+ + +
+
+ +
+ +
+ + +
+
ค้นหา eva_limit_frame_employee
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
เครื่องมือ
+
+ + +@section FooterPlaceHolder{ + + + +} + diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group_inline.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group_inline.cshtml new file mode 100644 index 0000000..b54b4d7 --- /dev/null +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_inline.cshtml @@ -0,0 +1,66 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; + ViewData["Title"] = "eva_limit_frame_group"; +} + +
+ +
จัดการ eva_limit_frame_group
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + +
ลำดับกิจกรรม
+ +
+
+ +
+ + +
+ +
+
+ +
+ +@section FooterPlaceHolder{ + + +} diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group_report.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group_report.cshtml new file mode 100644 index 0000000..88889d5 --- /dev/null +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_report.cshtml @@ -0,0 +1,60 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_group"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+
+ +
+
+ +
+
รายงาน eva_limit_frame_group
+
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group_wizardform.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group_wizardform.cshtml new file mode 100644 index 0000000..6165717 --- /dev/null +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_wizardform.cshtml @@ -0,0 +1,52 @@ + + + +
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
diff --git a/Views/eva_limit_frame_planView/eva_limit_frame_plan.cshtml b/Views/eva_limit_frame_planView/eva_limit_frame_plan.cshtml new file mode 100644 index 0000000..9b5f38f --- /dev/null +++ b/Views/eva_limit_frame_planView/eva_limit_frame_plan.cshtml @@ -0,0 +1,145 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_plan"; +} + + + + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
ค้นหา eva_limit_frame_plan
+
+
+ +
+ + +
+ +
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
เครื่องมือ
+
+ +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_planView/eva_limit_frame_plan_d.cshtml b/Views/eva_limit_frame_planView/eva_limit_frame_plan_d.cshtml new file mode 100644 index 0000000..8589890 --- /dev/null +++ b/Views/eva_limit_frame_planView/eva_limit_frame_plan_d.cshtml @@ -0,0 +1,221 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_plan"; + Layout = "_LayoutDirect"; +} + + + + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+ +
+ +
+
บันทึกข้อมูล eva_limit_frame_plan
+ +
+
+ กรุณากรอกข้อมูลลงในแบบฟอร์ม +
+
+ +
+
+ + + + + + +
+
+
+ + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+
+
+ +
+
+ + +
+
+ +
+ +
+ + +
+
ค้นหา eva_limit_frame_group
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+
+ + + + + + + + + + + + + + + + + +
เครื่องมือ
+
+ +
+ +@section FooterPlaceHolder{ + + + +} + diff --git a/Views/eva_limit_frame_planView/eva_limit_frame_plan_inline.cshtml b/Views/eva_limit_frame_planView/eva_limit_frame_plan_inline.cshtml new file mode 100644 index 0000000..60c3421 --- /dev/null +++ b/Views/eva_limit_frame_planView/eva_limit_frame_plan_inline.cshtml @@ -0,0 +1,67 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; + ViewData["Title"] = "eva_limit_frame_plan"; +} + +
+ +
จัดการ eva_limit_frame_plan
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + +
ลำดับกิจกรรม
+ +
+
+ +
+ + +
+ +
+
+ +
+ +@section FooterPlaceHolder{ + + +} diff --git a/Views/eva_limit_frame_planView/eva_limit_frame_plan_report.cshtml b/Views/eva_limit_frame_planView/eva_limit_frame_plan_report.cshtml new file mode 100644 index 0000000..f637979 --- /dev/null +++ b/Views/eva_limit_frame_planView/eva_limit_frame_plan_report.cshtml @@ -0,0 +1,55 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "eva_limit_frame_plan"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+
+ +
+
+ +
+
รายงาน eva_limit_frame_plan
+
+
+
+
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/Views/eva_limit_frame_planView/eva_limit_frame_plan_wizardform.cshtml b/Views/eva_limit_frame_planView/eva_limit_frame_plan_wizardform.cshtml new file mode 100644 index 0000000..bda2938 --- /dev/null +++ b/Views/eva_limit_frame_planView/eva_limit_frame_plan_wizardform.cshtml @@ -0,0 +1,64 @@ + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
diff --git a/Views/home/index2.cshtml b/Views/home/index2.cshtml index 131786e..936629a 100644 --- a/Views/home/index2.cshtml +++ b/Views/home/index2.cshtml @@ -30,6 +30,9 @@ + diff --git a/appsettings.Development.json b/appsettings.Development.json index 2b7e1ee..a58db54 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -1,9 +1,9 @@ { "connectionStrings": { - "mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", - "externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" - //"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", - //"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" + //"mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", + //"externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" + "mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", + "externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" }, "IdentityServer": { "url": "", diff --git a/tb320eva.csproj b/tb320eva.csproj index 6caacfb..77a331d 100644 --- a/tb320eva.csproj +++ b/tb320eva.csproj @@ -70,6 +70,21 @@ + + + + + + + + + + + + + + + @@ -77,6 +92,18 @@ + + + + + + + + + + + + diff --git a/tb320eva.xml b/tb320eva.xml index 61a279f..b9e68df 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -3343,6 +3343,360 @@ If the model is invalid Error Occurred + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by employee_id + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Refresh AutoField of all items + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by group_guid + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Refresh AutoField of all items + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by executed_date + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Refresh AutoField of all items + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + Default constructure for dependency injection @@ -4542,6 +4896,30 @@ + + + Default constructure for dependency injection + + + + + + + + Default constructure for dependency injection + + + + + + + + Default constructure for dependency injection + + + + + Default constructure for dependency injection diff --git a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js new file mode 100644 index 0000000..ea29037 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js @@ -0,0 +1,240 @@ +var eva_limit_frame_employee_editMode = "CREATE"; +var eva_limit_frame_employee_API = "/api/eva_limit_frame_employee/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_employee_GetSearchParameter() { + var eva_limit_frame_employeeSearchObject = new Object(); + eva_limit_frame_employeeSearchObject.frame_group_guid = getUrlParameter("id"); + eva_limit_frame_employeeSearchObject.employee_id = $("#s_eva_limit_frame_employee_employee_id").val(); + + return eva_limit_frame_employeeSearchObject; +} + +function eva_limit_frame_employee_FeedDataToSearchForm(data) { + $("#s_eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid); + DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_employee_FeedDataToForm(data) { + $("#eva_limit_frame_employee_id").val(data.id); + $("#eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id"), data, "id", "external_name", "item_org_id", data.org_id); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_position_id"), data, "id", "external_name", "item_position_id", data.position_id); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_level_id"), data, "id", "external_name", "item_level_id", data.level_id); + $("#eva_limit_frame_employee_salary").val(data.salary); + $("#eva_limit_frame_employee_position_allowance").val(data.position_allowance); + $("#eva_limit_frame_employee_monthly_remuneration").val(data.monthly_remuneration); + +} + +function eva_limit_frame_employee_GetFromForm() { + var eva_limit_frame_employeeObject = new Object(); + eva_limit_frame_employeeObject.id = $("#eva_limit_frame_employee_id").val(); + eva_limit_frame_employeeObject.frame_group_guid = getUrlParameter("id"); + eva_limit_frame_employeeObject.employee_id = $("#eva_limit_frame_employee_employee_id").val(); + eva_limit_frame_employeeObject.org_id = $("#eva_limit_frame_employee_org_id").val(); + eva_limit_frame_employeeObject.position_id = $("#eva_limit_frame_employee_position_id").val(); + eva_limit_frame_employeeObject.level_id = $("#eva_limit_frame_employee_level_id").val(); + eva_limit_frame_employeeObject.salary = $("#eva_limit_frame_employee_salary").val(); + eva_limit_frame_employeeObject.position_allowance = $("#eva_limit_frame_employee_position_allowance").val(); + eva_limit_frame_employeeObject.monthly_remuneration = $("#eva_limit_frame_employee_monthly_remuneration").val(); + + + return eva_limit_frame_employeeObject; +} + +function eva_limit_frame_employee_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_employee_FeedDataToForm(result); + eva_limit_frame_employee_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#eva_limit_frame_employeeModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_employee_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_employee_GoCreate() { + // Incase model popup + eva_limit_frame_employee_SetCreateForm(true); + + // Incase open new page + //window_open(appsite + "/eva_limit_frame_employeeView/eva_limit_frame_employee_d"); +} + +function eva_limit_frame_employee_GoEdit(a) { + // Incase model popup + eva_limit_frame_employee_SetEditForm(a); + + // Incase open new page + //window_open(appsite + "/eva_limit_frame_employeeView/eva_limit_frame_employee_d?id=" + a); +} + +function eva_limit_frame_employee_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_employee_editMode = "UPDATE"; + eva_limit_frame_employee_FeedDataToForm(result); + $("#eva_limit_frame_employeeModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_employee_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_employee_SetCreateForm(s) { + eva_limit_frame_employee_editMode = "CREATE"; + eva_limit_frame_employee_InitialForm(s); +} + +function eva_limit_frame_employee_RefreshTable() { + // Incase model popup + eva_limit_frame_employee_DoSearch(); + + // Incase open new page + //window.parent.eva_limit_frame_employee_DoSearch(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_employee_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_employee_PutUpdate() { + if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation)) { + return; + } + + var data = eva_limit_frame_employee_GetFromForm(); + + //Update Mode + if (eva_limit_frame_employee_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#eva_limit_frame_employeeModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_employee_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_employee_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#eva_limit_frame_employeeModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_employee_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_employee_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_employee_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#eva_limit_frame_employeeModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_employee_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_employee_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var eva_limit_frame_employeeTableV; + +var eva_limit_frame_employee_setupTable = function (result) { + tmp = '"'; + eva_limit_frame_employeeTableV = $('#eva_limit_frame_employeeTable').DataTable({ + "processing": true, + "serverSide": false, + "data": result, + //"select": { + // "style": 'multi' + //}, + "columns": [ + //{ "data": "" }, + { "data": "id" }, + { "data": "id" }, + { "data": "frame_group_guid_eva_limit_frame_group_group_guid" }, + { "data": "employee_id_external_linkage_external_name" }, + { "data": "org_id_external_linkage_external_name" }, + { "data": "position_id_external_linkage_external_name" }, + { "data": "level_id_external_linkage_external_name" }, + { "data": "salary" }, + { "data": "position_allowance" }, + { "data": "monthly_remuneration" }, + ], + "columnDefs": [ + { + "targets": 0, //1, + "data": "id", + "render": function (data, type, row, meta) { + return " "; + } + }, + //{ + // 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_limit_frame_employee_InitiateDataTable() { + startLoad(); + var p = $.param(eva_limit_frame_employee_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?" + p, eva_limit_frame_employee_setupTable, AlertDanger); +} + +function eva_limit_frame_employee_DoSearch() { + var p = $.param(eva_limit_frame_employee_GetSearchParameter()); + var eva_limit_frame_employee_reload = function (result) { + eva_limit_frame_employeeTableV.destroy(); + eva_limit_frame_employee_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?" + p, eva_limit_frame_employee_reload, AlertDanger); +} + +function eva_limit_frame_employee_GetSelect(f) { + var eva_limit_frame_employee_selectitem = []; + $.each(eva_limit_frame_employeeTableV.rows('.selected').data(), function (key, value) { + eva_limit_frame_employee_selectitem.push(value[f]); + }); + alert(eva_limit_frame_employee_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + + diff --git a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_d.js b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_d.js new file mode 100644 index 0000000..b797907 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_d.js @@ -0,0 +1,112 @@ +var eva_limit_frame_employee_editMode = "CREATE"; +var eva_limit_frame_employee_API = "/api/eva_limit_frame_employee/"; + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_employee_FeedDataToForm(data) { +$("#eva_limit_frame_employee_id").val(data.id); +$("#eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id"), data, "id", "external_name", "item_org_id", data.org_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_position_id"), data, "id", "external_name", "item_position_id", data.position_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_level_id"), data, "id", "external_name", "item_level_id", data.level_id); +$("#eva_limit_frame_employee_salary").val(data.salary); +$("#eva_limit_frame_employee_position_allowance").val(data.position_allowance); +$("#eva_limit_frame_employee_monthly_remuneration").val(data.monthly_remuneration); + +} + +function eva_limit_frame_employee_GetFromForm() { + var eva_limit_frame_employeeObject = new Object(); +eva_limit_frame_employeeObject.id = $("#eva_limit_frame_employee_id").val(); +eva_limit_frame_employeeObject.frame_group_guid = $("#eva_limit_frame_employee_frame_group_guid").val(); +eva_limit_frame_employeeObject.employee_id = $("#eva_limit_frame_employee_employee_id").val(); +eva_limit_frame_employeeObject.org_id = $("#eva_limit_frame_employee_org_id").val(); +eva_limit_frame_employeeObject.position_id = $("#eva_limit_frame_employee_position_id").val(); +eva_limit_frame_employeeObject.level_id = $("#eva_limit_frame_employee_level_id").val(); +eva_limit_frame_employeeObject.salary = $("#eva_limit_frame_employee_salary").val(); +eva_limit_frame_employeeObject.position_allowance = $("#eva_limit_frame_employee_position_allowance").val(); +eva_limit_frame_employeeObject.monthly_remuneration = $("#eva_limit_frame_employee_monthly_remuneration").val(); + + + return eva_limit_frame_employeeObject; +} + +function eva_limit_frame_employee_InitialForm() { + var successFunc = function (result) { + eva_limit_frame_employee_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_employee_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_employee_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_employee_editMode = "UPDATE"; + eva_limit_frame_employee_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_employee_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_employee_SetCreateForm() { + eva_limit_frame_employee_editMode = "CREATE"; + eva_limit_frame_employee_InitialForm(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_employee_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_employee_PutUpdate() { + if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation)) + { + return; + } + var data = eva_limit_frame_employee_GetFromForm(); + + //Update Mode + if (eva_limit_frame_employee_editMode === "UPDATE") { + var successFunc1 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_employee_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_employee_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_employee_GoDelete(a) { + if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) { + var successFunc = function (result) { + AlertSuccess(result.code+" "+result.message); + eva_limit_frame_employee_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_employee_API + a, null, successFunc, AlertDanger); + } +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + diff --git a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_inline.js b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_inline.js new file mode 100644 index 0000000..46fd6fe --- /dev/null +++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_inline.js @@ -0,0 +1,165 @@ +function eva_limit_frame_employee_ClearForm(i, blankItem) { + var data = blankItem; +$("#eva_limit_frame_employee_id_" + i).val(""); +$("#eva_limit_frame_employee_frame_group_guid_" + i).val(""); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id_" + i), blankItem, "id", "external_name", "item_employee_id", data.employee_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_position_id_" + i), blankItem, "id", "external_name", "item_position_id", data.position_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_level_id_" + i), blankItem, "id", "external_name", "item_level_id", data.level_id); +$("#eva_limit_frame_employee_salary_" + i).val(""); +$("#eva_limit_frame_employee_position_allowance_" + i).val(""); +$("#eva_limit_frame_employee_monthly_remuneration_" + i).val(""); + +} + +function eva_limit_frame_employee_FeedDataToForm(data, i, blankItem) { +$("#eva_limit_frame_employee_id_" + i).val(data.id); +$("#eva_limit_frame_employee_frame_group_guid_" + i).val(data.frame_group_guid); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_employee_id_" + i), blankItem, "id", "external_name", "item_employee_id", data.employee_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_position_id_" + i), blankItem, "id", "external_name", "item_position_id", data.position_id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_level_id_" + i), blankItem, "id", "external_name", "item_level_id", data.level_id); +$("#eva_limit_frame_employee_salary_" + i).val(data.salary); +$("#eva_limit_frame_employee_position_allowance_" + i).val(data.position_allowance); +$("#eva_limit_frame_employee_monthly_remuneration_" + i).val(data.monthly_remuneration); + +} + +function eva_limit_frame_employee_GetFromForm(obj, i) { + var eva_limit_frame_employeeObject = new Object(); +eva_limit_frame_employeeObject.id = obj.find("#eva_limit_frame_employee_id_" + i).val(); +eva_limit_frame_employeeObject.frame_group_guid = obj.find("#eva_limit_frame_employee_frame_group_guid_" + i).val(); +eva_limit_frame_employeeObject.employee_id = obj.find("#eva_limit_frame_employee_employee_id_" + i).val(); +eva_limit_frame_employeeObject.org_id = obj.find("#eva_limit_frame_employee_org_id_" + i).val(); +eva_limit_frame_employeeObject.position_id = obj.find("#eva_limit_frame_employee_position_id_" + i).val(); +eva_limit_frame_employeeObject.level_id = obj.find("#eva_limit_frame_employee_level_id_" + i).val(); +eva_limit_frame_employeeObject.salary = obj.find("#eva_limit_frame_employee_salary_" + i).val(); +eva_limit_frame_employeeObject.position_allowance = obj.find("#eva_limit_frame_employee_position_allowance_" + i).val(); +eva_limit_frame_employeeObject.monthly_remuneration = obj.find("#eva_limit_frame_employee_monthly_remuneration_" + i).val(); + + eva_limit_frame_employeeObject.active_mode = obj.find("#isActive_" + i + "_eva_limit_frame_employee").val(); + return eva_limit_frame_employeeObject; +} + +function eva_limit_frame_employee_GetAllData() { + //Insert eva_limit_frame_employee List + var eva_limit_frame_employee = []; + $('#eva_limit_frame_employeeBody tr').each(function () { + var i = $(this).find("#rowCount").text(); + var eacheva_limit_frame_employee = eva_limit_frame_employee_GetFromForm($(this), i); + eva_limit_frame_employee.push(eacheva_limit_frame_employee); + }); + return eva_limit_frame_employee; +} + +function eva_limit_frame_employee_Save(id) { + //Insert eva_limit_frame_employee List + var eva_limit_frame_employee = eva_limit_frame_employee_GetAllData(); + + var successFunc = function (result) { + AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว"); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + '/api/eva_limit_frame_employee/UpdateMultiple', eva_limit_frame_employee, successFunc, AlertDanger); +} + +function eva_limit_frame_employee_Get(id, blankItem) { + + $('#eva_limit_frame_employeeBody').empty(); + + var successFunc = function (response) { + //console.log(response); + $.each(response, function (i, data) { + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + $('#eva_limit_frame_employeeBody').append($(tag)); + eva_limit_frame_employee_FeedDataToForm(data, (i + 1), blankItem); + }); + eva_limit_frame_employee_Summary(); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee", successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_employee/GetListByframe_group_guid/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_employee/GetListByemployee_id/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_employee/GetListByorg_id/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_employee/GetListByposition_id/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_employee/GetListBylevel_id/' + a, successFunc, AlertDanger); + +} + +function eva_limit_frame_employee_Add() { + var successFunc = function (result) { + var i = $("#eva_limit_frame_employeeBody tr").length; + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + + $('#eva_limit_frame_employeeBody').append($(tag)); + eva_limit_frame_employee_ClearForm(i + 1, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/" + "GetBlankItem", successFunc, AlertDanger); +} + +function eva_limit_frame_employee_Removeeva_limit_frame_employee(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', true); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' }); + $(e).hide(); + $(e).closest('tr').find("#restoreBtn").show(); + $(e).closest('tr').find("input").first().val("0"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_employee_Summary(); + } +} + +function eva_limit_frame_employee_Restoreeva_limit_frame_employee(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', false); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '1' }); + $(e).hide(); + $(e).closest('tr').find("#removeBtn").show(); + $(e).closest('tr').find("input").first().val("1"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_employee_Summary(); + } +} + +function eva_limit_frame_employee_Summary() { + var sum = 0; + $(".input_score").each(function () { + sum += +$(this).val(); + }); + $("#score_label").text("ผลรวม: " + sum); +} + +function eva_limit_frame_employee_InitialForm(id) { + var successFunc = function (result) { + eva_limit_frame_employee_Get(id, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/" + "GetBlankItem", successFunc, AlertDanger); +} diff --git a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_report.js b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_report.js new file mode 100644 index 0000000..369692b --- /dev/null +++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee_report.js @@ -0,0 +1,60 @@ +var eva_limit_frame_employee_API = "/api/eva_limit_frame_employee/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_employee_GetSearchParameter(fileType) { + var eva_limit_frame_employeeSearchObject = new Object(); +eva_limit_frame_employeeSearchObject.frame_group_guid = $("#s_eva_limit_frame_employee_frame_group_guid").val(); +eva_limit_frame_employeeSearchObject.employee_id = $("#s_eva_limit_frame_employee_employee_id").val(); + + + eva_limit_frame_employeeSearchObject.fileType = fileType; + + console.log(eva_limit_frame_employeeSearchObject); + + return eva_limit_frame_employeeSearchObject; +} + +function eva_limit_frame_employee_FeedDataToSearchForm(data) { +$("#s_eva_limit_frame_employee_frame_group_guid").val(data.frame_group_guid); +DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_employee_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_employee_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_employee_FeedDataToSearchForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_employee_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Data Table ========================================= + +var s_eva_limit_frame_employee_customValidation = function (group) { + return ""; +}; + + +function eva_limit_frame_employee_DoSearch(fileType) { + if (!ValidateForm('s_eva_limit_frame_employee', s_eva_limit_frame_employee_customValidation)) { + return; + } + + var p = $.param(eva_limit_frame_employee_GetSearchParameter(fileType)); + + var report_url = apisite + "/api/eva_limit_frame_employee/eva_limit_frame_employee_report?" + p; + + if (fileType === "pdf") { + $("#report_result").attr("src", report_url); + $("#report_result").show(); + //window.open(report_url); + } else { + $("#report_result").hide(); + window.open(report_url); + } +} + diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js new file mode 100644 index 0000000..4ae9b19 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js @@ -0,0 +1,234 @@ +var eva_limit_frame_group_editMode = "CREATE"; +var eva_limit_frame_group_API = "/api/eva_limit_frame_group/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_group_GetSearchParameter() { + var eva_limit_frame_groupSearchObject = new Object(); + eva_limit_frame_groupSearchObject.frame_plan_guid = getUrlParameter("id"); + eva_limit_frame_groupSearchObject.group_guid = $("#s_eva_limit_frame_group_group_guid").val(); + + return eva_limit_frame_groupSearchObject; +} + +function eva_limit_frame_group_FeedDataToSearchForm(data) { + $("#s_eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid); + DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_group_FeedDataToForm(data) { + $("#eva_limit_frame_group_id").val(data.id); + $("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid); + $("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295); + $("#eva_limit_frame_group_total_salary").val(data.total_salary); + $("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit); + $("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded); + +} + +function eva_limit_frame_group_GetFromForm() { + var eva_limit_frame_groupObject = new Object(); + eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val(); + eva_limit_frame_groupObject.frame_plan_guid = getUrlParameter("id"); + eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val(); + eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val(); + eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val(); + eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val(); + eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val(); + + + return eva_limit_frame_groupObject; +} + +function eva_limit_frame_group_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_group_FeedDataToForm(result); + eva_limit_frame_group_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#eva_limit_frame_groupModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_group_GoCreate() { + // Incase model popup + eva_limit_frame_group_SetCreateForm(true); + + // Incase open new page + //window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d"); +} + +function eva_limit_frame_group_GoEdit(a) { + // Incase model popup + //eva_limit_frame_group_SetEditForm(a); + + // Incase open new page + window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d?id=" + a); +} + +function eva_limit_frame_group_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_group_editMode = "UPDATE"; + eva_limit_frame_group_FeedDataToForm(result); + $("#eva_limit_frame_groupModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_group_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_group_SetCreateForm(s) { + eva_limit_frame_group_editMode = "CREATE"; + eva_limit_frame_group_InitialForm(s); +} + +function eva_limit_frame_group_RefreshTable() { + // Incase model popup + eva_limit_frame_group_DoSearch(); + + // Incase open new page + //window.parent.eva_limit_frame_group_DoSearch(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_group_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_group_PutUpdate() { + if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) { + return; + } + + var data = eva_limit_frame_group_GetFromForm(); + + //Update Mode + if (eva_limit_frame_group_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#eva_limit_frame_groupModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_group_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_group_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#eva_limit_frame_groupModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_group_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_group_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#eva_limit_frame_groupModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_group_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var eva_limit_frame_groupTableV; + +var eva_limit_frame_group_setupTable = function (result) { + tmp = '"'; + eva_limit_frame_groupTableV = $('#eva_limit_frame_groupTable').DataTable({ + "processing": true, + "serverSide": false, + "data": result, + //"select": { + // "style": 'multi' + //}, + "columns": [ + //{ "data": "" }, + { "data": "id" }, + { "data": "id" }, + { "data": "frame_plan_guid_eva_limit_frame_plan_executed_date" }, + { "data": "group_guid_eva_evaluation_group_code" }, + { "data": "limit_frame_295" }, + { "data": "total_salary" }, + { "data": "total_salary_limit" }, + { "data": "total_salary_limit_rounded" }, + ], + "columnDefs": [ + { + "targets": 0, //1, + "data": "id", + "render": function (data, type, row, meta) { + return " "; + } + }, + //{ + // 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_limit_frame_group_InitiateDataTable() { + startLoad(); + var p = $.param(eva_limit_frame_group_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?" + p, eva_limit_frame_group_setupTable, AlertDanger); +} + +function eva_limit_frame_group_DoSearch() { + var p = $.param(eva_limit_frame_group_GetSearchParameter()); + var eva_limit_frame_group_reload = function (result) { + eva_limit_frame_groupTableV.destroy(); + eva_limit_frame_group_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?" + p, eva_limit_frame_group_reload, AlertDanger); +} + +function eva_limit_frame_group_GetSelect(f) { + var eva_limit_frame_group_selectitem = []; + $.each(eva_limit_frame_groupTableV.rows('.selected').data(), function (key, value) { + eva_limit_frame_group_selectitem.push(value[f]); + }); + alert(eva_limit_frame_group_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + + diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js new file mode 100644 index 0000000..01f1392 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_d.js @@ -0,0 +1,108 @@ +var eva_limit_frame_group_editMode = "CREATE"; +var eva_limit_frame_group_API = "/api/eva_limit_frame_group/"; + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_group_FeedDataToForm(data) { +$("#eva_limit_frame_group_id").val(data.id); +$("#eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid); +$("#eva_limit_frame_group_limit_frame_295").val(data.limit_frame_295); +$("#eva_limit_frame_group_total_salary").val(data.total_salary); +$("#eva_limit_frame_group_total_salary_limit").val(data.total_salary_limit); +$("#eva_limit_frame_group_total_salary_limit_rounded").val(data.total_salary_limit_rounded); + +} + +function eva_limit_frame_group_GetFromForm() { + var eva_limit_frame_groupObject = new Object(); +eva_limit_frame_groupObject.id = $("#eva_limit_frame_group_id").val(); +eva_limit_frame_groupObject.frame_plan_guid = $("#eva_limit_frame_group_frame_plan_guid").val(); +eva_limit_frame_groupObject.group_guid = $("#eva_limit_frame_group_group_guid").val(); +eva_limit_frame_groupObject.limit_frame_295 = $("#eva_limit_frame_group_limit_frame_295").val(); +eva_limit_frame_groupObject.total_salary = $("#eva_limit_frame_group_total_salary").val(); +eva_limit_frame_groupObject.total_salary_limit = $("#eva_limit_frame_group_total_salary_limit").val(); +eva_limit_frame_groupObject.total_salary_limit_rounded = $("#eva_limit_frame_group_total_salary_limit_rounded").val(); + + + return eva_limit_frame_groupObject; +} + +function eva_limit_frame_group_InitialForm() { + var successFunc = function (result) { + eva_limit_frame_group_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_group_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_group_editMode = "UPDATE"; + eva_limit_frame_group_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_group_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_group_SetCreateForm() { + eva_limit_frame_group_editMode = "CREATE"; + eva_limit_frame_group_InitialForm(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_group_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_group_PutUpdate() { + if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) + { + return; + } + var data = eva_limit_frame_group_GetFromForm(); + + //Update Mode + if (eva_limit_frame_group_editMode === "UPDATE") { + var successFunc1 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_group_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_group_GoDelete(a) { + if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) { + var successFunc = function (result) { + AlertSuccess(result.code+" "+result.message); + eva_limit_frame_group_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger); + } +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_inline.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_inline.js new file mode 100644 index 0000000..634638e --- /dev/null +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_inline.js @@ -0,0 +1,152 @@ +function eva_limit_frame_group_ClearForm(i, blankItem) { + var data = blankItem; +$("#eva_limit_frame_group_id_" + i).val(""); +$("#eva_limit_frame_group_frame_plan_guid_" + i).val(""); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid_" + i), blankItem, "id", "code", "item_group_guid", data.group_guid); +$("#eva_limit_frame_group_limit_frame_295_" + i).val(""); +$("#eva_limit_frame_group_total_salary_" + i).val(""); +$("#eva_limit_frame_group_total_salary_limit_" + i).val(""); +$("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val(""); + +} + +function eva_limit_frame_group_FeedDataToForm(data, i, blankItem) { +$("#eva_limit_frame_group_id_" + i).val(data.id); +$("#eva_limit_frame_group_frame_plan_guid_" + i).val(data.frame_plan_guid); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid_" + i), blankItem, "id", "code", "item_group_guid", data.group_guid); +$("#eva_limit_frame_group_limit_frame_295_" + i).val(data.limit_frame_295); +$("#eva_limit_frame_group_total_salary_" + i).val(data.total_salary); +$("#eva_limit_frame_group_total_salary_limit_" + i).val(data.total_salary_limit); +$("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val(data.total_salary_limit_rounded); + +} + +function eva_limit_frame_group_GetFromForm(obj, i) { + var eva_limit_frame_groupObject = new Object(); +eva_limit_frame_groupObject.id = obj.find("#eva_limit_frame_group_id_" + i).val(); +eva_limit_frame_groupObject.frame_plan_guid = obj.find("#eva_limit_frame_group_frame_plan_guid_" + i).val(); +eva_limit_frame_groupObject.group_guid = obj.find("#eva_limit_frame_group_group_guid_" + i).val(); +eva_limit_frame_groupObject.limit_frame_295 = obj.find("#eva_limit_frame_group_limit_frame_295_" + i).val(); +eva_limit_frame_groupObject.total_salary = obj.find("#eva_limit_frame_group_total_salary_" + i).val(); +eva_limit_frame_groupObject.total_salary_limit = obj.find("#eva_limit_frame_group_total_salary_limit_" + i).val(); +eva_limit_frame_groupObject.total_salary_limit_rounded = obj.find("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val(); + + eva_limit_frame_groupObject.active_mode = obj.find("#isActive_" + i + "_eva_limit_frame_group").val(); + return eva_limit_frame_groupObject; +} + +function eva_limit_frame_group_GetAllData() { + //Insert eva_limit_frame_group List + var eva_limit_frame_group = []; + $('#eva_limit_frame_groupBody tr').each(function () { + var i = $(this).find("#rowCount").text(); + var eacheva_limit_frame_group = eva_limit_frame_group_GetFromForm($(this), i); + eva_limit_frame_group.push(eacheva_limit_frame_group); + }); + return eva_limit_frame_group; +} + +function eva_limit_frame_group_Save(id) { + //Insert eva_limit_frame_group List + var eva_limit_frame_group = eva_limit_frame_group_GetAllData(); + + var successFunc = function (result) { + AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว"); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + '/api/eva_limit_frame_group/UpdateMultiple', eva_limit_frame_group, successFunc, AlertDanger); +} + +function eva_limit_frame_group_Get(id, blankItem) { + + $('#eva_limit_frame_groupBody').empty(); + + var successFunc = function (response) { + //console.log(response); + $.each(response, function (i, data) { + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + $('#eva_limit_frame_groupBody').append($(tag)); + eva_limit_frame_group_FeedDataToForm(data, (i + 1), blankItem); + }); + eva_limit_frame_group_Summary(); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group", successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_group/GetListByframe_plan_guid/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_group/GetListBygroup_guid/' + a, successFunc, AlertDanger); + +} + +function eva_limit_frame_group_Add() { + var successFunc = function (result) { + var i = $("#eva_limit_frame_groupBody tr").length; + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + + $('#eva_limit_frame_groupBody').append($(tag)); + eva_limit_frame_group_ClearForm(i + 1, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group/" + "GetBlankItem", successFunc, AlertDanger); +} + +function eva_limit_frame_group_Removeeva_limit_frame_group(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', true); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' }); + $(e).hide(); + $(e).closest('tr').find("#restoreBtn").show(); + $(e).closest('tr').find("input").first().val("0"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_group_Summary(); + } +} + +function eva_limit_frame_group_Restoreeva_limit_frame_group(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', false); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '1' }); + $(e).hide(); + $(e).closest('tr').find("#removeBtn").show(); + $(e).closest('tr').find("input").first().val("1"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_group_Summary(); + } +} + +function eva_limit_frame_group_Summary() { + var sum = 0; + $(".input_score").each(function () { + sum += +$(this).val(); + }); + $("#score_label").text("ผลรวม: " + sum); +} + +function eva_limit_frame_group_InitialForm(id) { + var successFunc = function (result) { + eva_limit_frame_group_Get(id, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group/" + "GetBlankItem", successFunc, AlertDanger); +} diff --git a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_report.js b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_report.js new file mode 100644 index 0000000..cc17500 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group_report.js @@ -0,0 +1,60 @@ +var eva_limit_frame_group_API = "/api/eva_limit_frame_group/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_group_GetSearchParameter(fileType) { + var eva_limit_frame_groupSearchObject = new Object(); +eva_limit_frame_groupSearchObject.frame_plan_guid = $("#s_eva_limit_frame_group_frame_plan_guid").val(); +eva_limit_frame_groupSearchObject.group_guid = $("#s_eva_limit_frame_group_group_guid").val(); + + + eva_limit_frame_groupSearchObject.fileType = fileType; + + console.log(eva_limit_frame_groupSearchObject); + + return eva_limit_frame_groupSearchObject; +} + +function eva_limit_frame_group_FeedDataToSearchForm(data) { +$("#s_eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid); +DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_group_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_group_FeedDataToSearchForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Data Table ========================================= + +var s_eva_limit_frame_group_customValidation = function (group) { + return ""; +}; + + +function eva_limit_frame_group_DoSearch(fileType) { + if (!ValidateForm('s_eva_limit_frame_group', s_eva_limit_frame_group_customValidation)) { + return; + } + + var p = $.param(eva_limit_frame_group_GetSearchParameter(fileType)); + + var report_url = apisite + "/api/eva_limit_frame_group/eva_limit_frame_group_report?" + p; + + if (fileType === "pdf") { + $("#report_result").attr("src", report_url); + $("#report_result").show(); + //window.open(report_url); + } else { + $("#report_result").hide(); + window.open(report_url); + } +} + diff --git a/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan.js b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan.js new file mode 100644 index 0000000..e9d1824 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan.js @@ -0,0 +1,243 @@ +var eva_limit_frame_plan_editMode = "CREATE"; +var eva_limit_frame_plan_API = "/api/eva_limit_frame_plan/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_plan_GetSearchParameter() { + var eva_limit_frame_planSearchObject = new Object(); + eva_limit_frame_planSearchObject.executed_date = formatDateForGetParameter(getDate($("#s_eva_limit_frame_plan_executed_date").val())); + + return eva_limit_frame_planSearchObject; +} + +function eva_limit_frame_plan_FeedDataToSearchForm(data) { + $("#s_eva_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_plan_FeedDataToForm(data) { + $("#eva_limit_frame_plan_id").val(data.id); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_plan_guid"), data, "id", "fiscal_year", "item_plan_guid", data.plan_guid); + $("#eva_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + $("#eva_limit_frame_plan_limit_frame_005").val(data.limit_frame_005); + $("#eva_limit_frame_plan_status_self").val(data.status_self); + $("#eva_limit_frame_plan_status_chief").val(data.status_chief); + $("#eva_limit_frame_plan_supervisor1").val(data.supervisor1); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_supervisor1_result"), data, "id", "external_name", "item_supervisor1_result", data.supervisor1_result); + $("#eva_limit_frame_plan_supervisor1_remark").val(data.supervisor1_remark); + $("#eva_limit_frame_plan_supervisor1_date").val(formatDate(data.supervisor1_date)); + $("#eva_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date)); + +} + +function eva_limit_frame_plan_GetFromForm() { + var eva_limit_frame_planObject = new Object(); + eva_limit_frame_planObject.id = $("#eva_limit_frame_plan_id").val(); + eva_limit_frame_planObject.plan_guid = $("#eva_limit_frame_plan_plan_guid").val(); + eva_limit_frame_planObject.executed_date = getDate($("#eva_limit_frame_plan_executed_date").val()); + eva_limit_frame_planObject.limit_frame_005 = $("#eva_limit_frame_plan_limit_frame_005").val(); + eva_limit_frame_planObject.status_self = $("#eva_limit_frame_plan_status_self").val(); + eva_limit_frame_planObject.status_chief = $("#eva_limit_frame_plan_status_chief").val(); + eva_limit_frame_planObject.supervisor1 = $("#eva_limit_frame_plan_supervisor1").val(); + eva_limit_frame_planObject.supervisor1_result = $("#eva_limit_frame_plan_supervisor1_result").val(); + eva_limit_frame_planObject.supervisor1_remark = $("#eva_limit_frame_plan_supervisor1_remark").val(); + eva_limit_frame_planObject.supervisor1_date = getDate($("#eva_limit_frame_plan_supervisor1_date").val()); + eva_limit_frame_planObject.salary_adjustment_date = getDate($("#eva_limit_frame_plan_salary_adjustment_date").val()); + + + return eva_limit_frame_planObject; +} + +function eva_limit_frame_plan_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_plan_FeedDataToForm(result); + eva_limit_frame_plan_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#eva_limit_frame_planModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_plan_GoCreate() { + // Incase model popup + eva_limit_frame_plan_SetCreateForm(true); + + // Incase open new page + //window_open(appsite + "/eva_limit_frame_planView/eva_limit_frame_plan_d"); +} + +function eva_limit_frame_plan_GoEdit(a) { + // Incase model popup + //eva_limit_frame_plan_SetEditForm(a); + + // Incase open new page + window_open(appsite + "/eva_limit_frame_planView/eva_limit_frame_plan_d?id=" + a); +} + +function eva_limit_frame_plan_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_plan_editMode = "UPDATE"; + eva_limit_frame_plan_FeedDataToForm(result); + $("#eva_limit_frame_planModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_plan_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_plan_SetCreateForm(s) { + eva_limit_frame_plan_editMode = "CREATE"; + eva_limit_frame_plan_InitialForm(s); +} + +function eva_limit_frame_plan_RefreshTable() { + // Incase model popup + eva_limit_frame_plan_DoSearch(); + + // Incase open new page + //window.parent.eva_limit_frame_plan_DoSearch(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_plan_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_plan_PutUpdate() { + if (!ValidateForm('eva_limit_frame_plan', eva_limit_frame_plan_customValidation)) { + return; + } + + var data = eva_limit_frame_plan_GetFromForm(); + + //Update Mode + if (eva_limit_frame_plan_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#eva_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_plan_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#eva_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_plan_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_plan_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#eva_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_plan_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var eva_limit_frame_planTableV; + +var eva_limit_frame_plan_setupTable = function (result) { + tmp = '"'; + eva_limit_frame_planTableV = $('#eva_limit_frame_planTable').DataTable({ + "processing": true, + "serverSide": false, + "data": result, + //"select": { + // "style": 'multi' + //}, + "columns": [ + //{ "data": "" }, + { "data": "id" }, + { "data": "plan_guid_eva_performance_plan_fiscal_year" }, + { "data": "txt_executed_date" }, + { "data": "limit_frame_005" }, + { "data": "status_self" }, + { "data": "status_chief" }, + { "data": "supervisor1" }, + { "data": "supervisor1_result_external_linkage_external_name" }, + { "data": "supervisor1_remark" }, + { "data": "txt_supervisor1_date" }, + { "data": "txt_salary_adjustment_date" }, + ], + "columnDefs": [ + { + "targets": 0, //1, + "data": "id", + "render": function (data, type, row, meta) { + return " "; + } + }, + //{ + // 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_limit_frame_plan_InitiateDataTable() { + startLoad(); + var p = $.param(eva_limit_frame_plan_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/eva_limit_frame_plan/GetListBySearch?" + p, eva_limit_frame_plan_setupTable, AlertDanger); +} + +function eva_limit_frame_plan_DoSearch() { + var p = $.param(eva_limit_frame_plan_GetSearchParameter()); + var eva_limit_frame_plan_reload = function (result) { + eva_limit_frame_planTableV.destroy(); + eva_limit_frame_plan_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_plan/GetListBySearch?" + p, eva_limit_frame_plan_reload, AlertDanger); +} + +function eva_limit_frame_plan_GetSelect(f) { + var eva_limit_frame_plan_selectitem = []; + $.each(eva_limit_frame_planTableV.rows('.selected').data(), function (key, value) { + eva_limit_frame_plan_selectitem.push(value[f]); + }); + alert(eva_limit_frame_plan_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + + diff --git a/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_d.js b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_d.js new file mode 100644 index 0000000..9a6043d --- /dev/null +++ b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_d.js @@ -0,0 +1,116 @@ +var eva_limit_frame_plan_editMode = "CREATE"; +var eva_limit_frame_plan_API = "/api/eva_limit_frame_plan/"; + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_plan_FeedDataToForm(data) { +$("#eva_limit_frame_plan_id").val(data.id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_plan_guid"), data, "id", "fiscal_year", "item_plan_guid", data.plan_guid); +$("#eva_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); +$("#eva_limit_frame_plan_limit_frame_005").val(data.limit_frame_005); +$("#eva_limit_frame_plan_status_self").val(data.status_self); +$("#eva_limit_frame_plan_status_chief").val(data.status_chief); +$("#eva_limit_frame_plan_supervisor1").val(data.supervisor1); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_supervisor1_result"), data, "id", "external_name", "item_supervisor1_result", data.supervisor1_result); +$("#eva_limit_frame_plan_supervisor1_remark").val(data.supervisor1_remark); +$("#eva_limit_frame_plan_supervisor1_date").val(formatDate(data.supervisor1_date)); +$("#eva_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date)); + +} + +function eva_limit_frame_plan_GetFromForm() { + var eva_limit_frame_planObject = new Object(); +eva_limit_frame_planObject.id = $("#eva_limit_frame_plan_id").val(); +eva_limit_frame_planObject.plan_guid = $("#eva_limit_frame_plan_plan_guid").val(); +eva_limit_frame_planObject.executed_date = getDate($("#eva_limit_frame_plan_executed_date").val()); +eva_limit_frame_planObject.limit_frame_005 = $("#eva_limit_frame_plan_limit_frame_005").val(); +eva_limit_frame_planObject.status_self = $("#eva_limit_frame_plan_status_self").val(); +eva_limit_frame_planObject.status_chief = $("#eva_limit_frame_plan_status_chief").val(); +eva_limit_frame_planObject.supervisor1 = $("#eva_limit_frame_plan_supervisor1").val(); +eva_limit_frame_planObject.supervisor1_result = $("#eva_limit_frame_plan_supervisor1_result").val(); +eva_limit_frame_planObject.supervisor1_remark = $("#eva_limit_frame_plan_supervisor1_remark").val(); +eva_limit_frame_planObject.supervisor1_date = getDate($("#eva_limit_frame_plan_supervisor1_date").val()); +eva_limit_frame_planObject.salary_adjustment_date = getDate($("#eva_limit_frame_plan_salary_adjustment_date").val()); + + + return eva_limit_frame_planObject; +} + +function eva_limit_frame_plan_InitialForm() { + var successFunc = function (result) { + eva_limit_frame_plan_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_limit_frame_plan_SetEditForm(a) { + var successFunc = function (result) { + eva_limit_frame_plan_editMode = "UPDATE"; + eva_limit_frame_plan_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_plan_API + a, successFunc, AlertDanger); +} + +function eva_limit_frame_plan_SetCreateForm() { + eva_limit_frame_plan_editMode = "CREATE"; + eva_limit_frame_plan_InitialForm(); +} + +//================= Update and Delete ========================================= + +var eva_limit_frame_plan_customValidation = function (group) { + return ""; +}; + +function eva_limit_frame_plan_PutUpdate() { + if (!ValidateForm('eva_limit_frame_plan', eva_limit_frame_plan_customValidation)) + { + return; + } + var data = eva_limit_frame_plan_GetFromForm(); + + //Update Mode + if (eva_limit_frame_plan_editMode === "UPDATE") { + var successFunc1 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_limit_frame_plan_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + AlertSuccess(result.code+" "+result.message); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_limit_frame_plan_API, data, successFunc2, AlertDanger); + } +} + +function eva_limit_frame_plan_GoDelete(a) { + if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) { + var successFunc = function (result) { + AlertSuccess(result.code+" "+result.message); + eva_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_limit_frame_plan_API + a, null, successFunc, AlertDanger); + } +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + diff --git a/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_inline.js b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_inline.js new file mode 100644 index 0000000..a22e5b0 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_inline.js @@ -0,0 +1,168 @@ +function eva_limit_frame_plan_ClearForm(i, blankItem) { + var data = blankItem; +$("#eva_limit_frame_plan_id_" + i).val(""); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_plan_guid_" + i), blankItem, "id", "fiscal_year", "item_plan_guid", data.plan_guid); +$("#eva_limit_frame_plan_executed_date_" + i).val(""); +$("#eva_limit_frame_plan_limit_frame_005_" + i).val(""); +$("#eva_limit_frame_plan_status_self_" + i).val(""); +$("#eva_limit_frame_plan_status_chief_" + i).val(""); +$("#eva_limit_frame_plan_supervisor1_" + i).val(""); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_supervisor1_result_" + i), blankItem, "id", "external_name", "item_supervisor1_result", data.supervisor1_result); +$("#eva_limit_frame_plan_supervisor1_remark_" + i).val(""); +$("#eva_limit_frame_plan_supervisor1_date_" + i).val(""); +$("#eva_limit_frame_plan_salary_adjustment_date_" + i).val(""); + +} + +function eva_limit_frame_plan_FeedDataToForm(data, i, blankItem) { +$("#eva_limit_frame_plan_id_" + i).val(data.id); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_plan_guid_" + i), blankItem, "id", "fiscal_year", "item_plan_guid", data.plan_guid); +$("#eva_limit_frame_plan_executed_date_" + i).val(formatDate(data.executed_date)); +$("#eva_limit_frame_plan_limit_frame_005_" + i).val(data.limit_frame_005); +$("#eva_limit_frame_plan_status_self_" + i).val(data.status_self); +$("#eva_limit_frame_plan_status_chief_" + i).val(data.status_chief); +$("#eva_limit_frame_plan_supervisor1_" + i).val(data.supervisor1); +DropDownClearFormAndFeedWithData($("#eva_limit_frame_plan_supervisor1_result_" + i), blankItem, "id", "external_name", "item_supervisor1_result", data.supervisor1_result); +$("#eva_limit_frame_plan_supervisor1_remark_" + i).val(data.supervisor1_remark); +$("#eva_limit_frame_plan_supervisor1_date_" + i).val(formatDate(data.supervisor1_date)); +$("#eva_limit_frame_plan_salary_adjustment_date_" + i).val(formatDate(data.salary_adjustment_date)); + +} + +function eva_limit_frame_plan_GetFromForm(obj, i) { + var eva_limit_frame_planObject = new Object(); +eva_limit_frame_planObject.id = obj.find("#eva_limit_frame_plan_id_" + i).val(); +eva_limit_frame_planObject.plan_guid = obj.find("#eva_limit_frame_plan_plan_guid_" + i).val(); +eva_limit_frame_planObject.executed_date = getDate(obj.find("#eva_limit_frame_plan_executed_date_" + i).val()); +eva_limit_frame_planObject.limit_frame_005 = obj.find("#eva_limit_frame_plan_limit_frame_005_" + i).val(); +eva_limit_frame_planObject.status_self = obj.find("#eva_limit_frame_plan_status_self_" + i).val(); +eva_limit_frame_planObject.status_chief = obj.find("#eva_limit_frame_plan_status_chief_" + i).val(); +eva_limit_frame_planObject.supervisor1 = obj.find("#eva_limit_frame_plan_supervisor1_" + i).val(); +eva_limit_frame_planObject.supervisor1_result = obj.find("#eva_limit_frame_plan_supervisor1_result_" + i).val(); +eva_limit_frame_planObject.supervisor1_remark = obj.find("#eva_limit_frame_plan_supervisor1_remark_" + i).val(); +eva_limit_frame_planObject.supervisor1_date = getDate(obj.find("#eva_limit_frame_plan_supervisor1_date_" + i).val()); +eva_limit_frame_planObject.salary_adjustment_date = getDate(obj.find("#eva_limit_frame_plan_salary_adjustment_date_" + i).val()); + + eva_limit_frame_planObject.active_mode = obj.find("#isActive_" + i + "_eva_limit_frame_plan").val(); + return eva_limit_frame_planObject; +} + +function eva_limit_frame_plan_GetAllData() { + //Insert eva_limit_frame_plan List + var eva_limit_frame_plan = []; + $('#eva_limit_frame_planBody tr').each(function () { + var i = $(this).find("#rowCount").text(); + var eacheva_limit_frame_plan = eva_limit_frame_plan_GetFromForm($(this), i); + eva_limit_frame_plan.push(eacheva_limit_frame_plan); + }); + return eva_limit_frame_plan; +} + +function eva_limit_frame_plan_Save(id) { + //Insert eva_limit_frame_plan List + var eva_limit_frame_plan = eva_limit_frame_plan_GetAllData(); + + var successFunc = function (result) { + AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว"); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + '/api/eva_limit_frame_plan/UpdateMultiple', eva_limit_frame_plan, successFunc, AlertDanger); +} + +function eva_limit_frame_plan_Get(id, blankItem) { + + $('#eva_limit_frame_planBody').empty(); + + var successFunc = function (response) { + //console.log(response); + $.each(response, function (i, data) { + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + $('#eva_limit_frame_planBody').append($(tag)); + eva_limit_frame_plan_FeedDataToForm(data, (i + 1), blankItem); + }); + eva_limit_frame_plan_Summary(); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_plan", successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_plan/GetListByplan_guid/' + a, successFunc, AlertDanger); + //AjaxGetRequest(apisite + '/api/eva_limit_frame_plan/GetListBysupervisor1_result/' + a, successFunc, AlertDanger); + +} + +function eva_limit_frame_plan_Add() { + var successFunc = function (result) { + var i = $("#eva_limit_frame_planBody tr").length; + var tag = ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + tag += ''; + + tag += ''; + tag += ''; + + $('#eva_limit_frame_planBody').append($(tag)); + eva_limit_frame_plan_ClearForm(i + 1, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_plan/" + "GetBlankItem", successFunc, AlertDanger); +} + +function eva_limit_frame_plan_Removeeva_limit_frame_plan(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', true); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' }); + $(e).hide(); + $(e).closest('tr').find("#restoreBtn").show(); + $(e).closest('tr').find("input").first().val("0"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_plan_Summary(); + } +} + +function eva_limit_frame_plan_Restoreeva_limit_frame_plan(e) { + if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) { + $(e).closest('tr').find("input,select,textarea").attr('disabled', false); + $(e).closest('tr').find("input,select,textarea").css({ opacity: '1' }); + $(e).hide(); + $(e).closest('tr').find("#removeBtn").show(); + $(e).closest('tr').find("input").first().val("1"); + console.log($(e).closest('tr').find("input").first().val()); + eva_limit_frame_plan_Summary(); + } +} + +function eva_limit_frame_plan_Summary() { + var sum = 0; + $(".input_score").each(function () { + sum += +$(this).val(); + }); + $("#score_label").text("ผลรวม: " + sum); +} + +function eva_limit_frame_plan_InitialForm(id) { + var successFunc = function (result) { + eva_limit_frame_plan_Get(id, result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_plan/" + "GetBlankItem", successFunc, AlertDanger); +} diff --git a/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_report.js b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_report.js new file mode 100644 index 0000000..5c57255 --- /dev/null +++ b/wwwroot/js/eva_limit_frame_plan/eva_limit_frame_plan_report.js @@ -0,0 +1,58 @@ +var eva_limit_frame_plan_API = "/api/eva_limit_frame_plan/"; + +//================= Search Customizaiton ========================================= + +function eva_limit_frame_plan_GetSearchParameter(fileType) { + var eva_limit_frame_planSearchObject = new Object(); +eva_limit_frame_planSearchObject.executed_date = formatDateForGetParameter(getDate($("#s_eva_limit_frame_plan_executed_date").val())); + + + eva_limit_frame_planSearchObject.fileType = fileType; + + console.log(eva_limit_frame_planSearchObject); + + return eva_limit_frame_planSearchObject; +} + +function eva_limit_frame_plan_FeedDataToSearchForm(data) { +$("#s_eva_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_limit_frame_plan_InitialForm(s) { + var successFunc = function (result) { + eva_limit_frame_plan_FeedDataToSearchForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Data Table ========================================= + +var s_eva_limit_frame_plan_customValidation = function (group) { + return ""; +}; + + +function eva_limit_frame_plan_DoSearch(fileType) { + if (!ValidateForm('s_eva_limit_frame_plan', s_eva_limit_frame_plan_customValidation)) { + return; + } + + var p = $.param(eva_limit_frame_plan_GetSearchParameter(fileType)); + + var report_url = apisite + "/api/eva_limit_frame_plan/eva_limit_frame_plan_report?" + p; + + if (fileType === "pdf") { + $("#report_result").attr("src", report_url); + $("#report_result").show(); + //window.open(report_url); + } else { + $("#report_result").hide(); + window.open(report_url); + } +} + diff --git a/wwwroot/json/notifications.json b/wwwroot/json/notifications.json new file mode 100644 index 0000000..38f38a3 --- /dev/null +++ b/wwwroot/json/notifications.json @@ -0,0 +1 @@ +{"total_unreded":1,"unread":[{"id":"0ed67800-b1e7-474b-b4f6-3dc4f46ffe86","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e43\u0e1a\u0e25\u0e32\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA66400039 \u0e19\u0e32\u0e22\u0e1e\u0e31\u0e12\u0e19\u0e4c\u0e18\u0e19\u0e31\u0e15\u0e20\u0e4c \u0e2a\u0e38\u0e19\u0e17\u0e23\u0e17\u0e34\u0e27\u0e32\u0e01\u0e23","body":"\u0e02\u0e2d\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e43\u0e1a\u0e25\u0e32\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA66400039 \u0e19\u0e32\u0e22\u0e1e\u0e31\u0e12\u0e19\u0e4c\u0e18\u0e19\u0e31\u0e15\u0e20\u0e4c \u0e2a\u0e38\u0e19\u0e17\u0e23\u0e17\u0e34\u0e27\u0e32\u0e01\u0e23","url":"https:\/\/hrm.thethaibar.or.th\/leave\/cancelLeaveEmpAssign"},"read_at":null,"created_at":"2021-01-04 16:11:44","updated_at":"2021-01-04 16:11:44"}],"readed":[{"id":"b59b5885-61c1-4ac9-a9dc-0f0fd53f526d","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e25\u0e32\u0e1e\u0e31\u0e01\u0e1c\u0e48\u0e2d\u0e19\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301959 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","body":"\u0e02\u0e2d\u0e25\u0e32\u0e1e\u0e31\u0e01\u0e1c\u0e48\u0e2d\u0e19\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301959 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","url":"https:\/\/hrm.thethaibar.or.th\/leave\/generalLeaveEmpAgent"},"read_at":"2020-12-25 13:48:12","created_at":"2020-12-25 08:35:44","updated_at":"2020-12-25 13:48:12"},{"id":"cf11b84c-70c0-4ae6-9dcd-d626c01b0537","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301936 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","body":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301936 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","url":"https:\/\/hrm.thethaibar.or.th\/leave\/generalLeaveEmpAgent"},"read_at":"2020-12-22 12:40:16","created_at":"2020-12-22 09:31:33","updated_at":"2020-12-22 12:40:16"},{"id":"7f6ce4b8-7634-416b-b530-45a9f938d017","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301915 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","body":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301915 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","url":"https:\/\/hrm.thethaibar.or.th\/leave\/generalLeaveEmpAgent"},"read_at":"2020-12-17 11:15:39","created_at":"2020-12-17 10:14:19","updated_at":"2020-12-17 11:15:39"},{"id":"33057649-9638-4dd2-bd23-a5a1692a03ac","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301891 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","body":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301891 \u0e19\u0e32\u0e22\u0e2a\u0e21\u0e01\u0e34\u0e08 \u0e15\u0e38\u0e49\u0e21\u0e09\u0e34\u0e21","url":"https:\/\/hrm.thethaibar.or.th\/leave\/generalLeaveEmpAgent"},"read_at":"2020-12-14 09:23:23","created_at":"2020-12-14 08:42:57","updated_at":"2020-12-14 09:23:23"},{"id":"7ac095fd-bcc0-4a0b-88fa-eabeaae44da5","type":"App\\Notifications\\WorkflowNotification","notifiable_type":"App\\Models\\User","notifiable_id":69,"data":{"title":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301880 \u0e27\u0e48\u0e32\u0e17\u0e35\u0e48\u0e23\u0e49\u0e2d\u0e22\u0e15\u0e23\u0e35\u0e2b\u0e0d\u0e34\u0e07\u0e08\u0e32\u0e23\u0e38\u0e27\u0e23\u0e23\u0e13 \u0e01\u0e49\u0e2d\u0e19\u0e04\u0e33","body":"\u0e02\u0e2d\u0e25\u0e32\u0e1b\u0e48\u0e27\u0e22\u0e41\u0e1c\u0e19\u0e01\u0e40\u0e17\u0e04\u0e42\u0e19\u0e42\u0e25\u0e22\u0e35\u0e2a\u0e32\u0e23\u0e2a\u0e19\u0e40\u0e17\u0e28 TA16301880 \u0e27\u0e48\u0e32\u0e17\u0e35\u0e48\u0e23\u0e49\u0e2d\u0e22\u0e15\u0e23\u0e35\u0e2b\u0e0d\u0e34\u0e07\u0e08\u0e32\u0e23\u0e38\u0e27\u0e23\u0e23\u0e13 \u0e01\u0e49\u0e2d\u0e19\u0e04\u0e33","url":"https:\/\/hrm.thethaibar.or.th\/leave\/generalLeaveEmpAgent"},"read_at":"2020-12-09 09:03:37","created_at":"2020-12-09 08:48:11","updated_at":"2020-12-09 09:03:37"}]} \ No newline at end of file diff --git a/wwwroot/json/notifications_blank.json b/wwwroot/json/notifications_blank.json new file mode 100644 index 0000000..b3ad9a5 --- /dev/null +++ b/wwwroot/json/notifications_blank.json @@ -0,0 +1 @@ +{"unread":[],"readed":[]} \ No newline at end of file