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 cfecd0a..04fd045 100644 Binary files a/EXCEL/eva_limit_frame_employee.xlsx and b/EXCEL/eva_limit_frame_employee.xlsx differ diff --git a/EXCEL/eva_limit_frame_group.xlsx b/EXCEL/eva_limit_frame_group.xlsx index 3108a94..bf915d5 100644 Binary files a/EXCEL/eva_limit_frame_group.xlsx and b/EXCEL/eva_limit_frame_group.xlsx differ diff --git a/EXCEL/eva_limit_frame_plan.xlsx b/EXCEL/eva_limit_frame_plan.xlsx index bd10941..ecde55d 100644 Binary files a/EXCEL/eva_limit_frame_plan.xlsx and b/EXCEL/eva_limit_frame_plan.xlsx differ 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