From 9530d1aa37597c4e607e8bc6dcd98de68a36be68 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Thu, 4 Mar 2021 22:25:37 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=A7=E0=B8=A1=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=88=E0=B8=AD=20=E0=B8=A7=E0=B8=87?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B9=83=E0=B8=8A=E0=B9=89=E0=B9=83=E0=B8=99=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vw_limit_frame_planControllers.cs | 403 ++++++++ EXCEL/eva_limit_frame_plan.xlsx | Bin 10862 -> 10942 bytes ..._limit_frame_plan@vw_limit_frame_plan.xlsx | Bin 0 -> 10448 bytes .../25640304122731_AddTotalSalary.Designer.cs | 922 ++++++++++++++++++ Migrations/25640304122731_AddTotalSalary.cs | 22 + Migrations/DataContextModelSnapshot.cs | 2 + .../eva_limit_frame_employeeService.cs | 2 +- .../eva_limit_frame_groupService.cs | 2 +- .../eva_limit_frame_planEntity.cs | 9 +- .../eva_limit_frame_planService.cs | 57 +- .../Ivw_limit_frame_planService.cs | 32 + .../vw_limit_frame_planInputModel.cs | 36 + .../vw_limit_frame_planReportRequestModel.cs | 21 + .../vw_limit_frame_planSearchModel.cs | 23 + .../vw_limit_frame_planService.cs | 363 +++++++ .../vw_limit_frame_planViewModel.cs | 38 + ..._limit_frame_planWithSelectionViewModel.cs | 13 + Startup.cs | 6 + Utils/MyHelper.cs | 5 + .../vw_limit_frame_planViewControllers.cs | 66 ++ .../eva_limit_frame_employee.cshtml | 182 ++-- .../eva_limit_frame_group.cshtml | 148 +-- .../eva_limit_frame_group_d.cshtml | 246 +++-- Views/home/index2.cshtml | 2 +- .../vw_limit_frame_plan.cshtml | 108 ++ .../vw_limit_frame_plan_d.cshtml | 155 +++ tb320eva.csproj | 4 + tb320eva.xml | 216 ++-- .../eva_limit_frame_employee.js | 153 +-- .../eva_limit_frame_group.js | 121 ++- .../eva_limit_frame_group_d.js | 63 +- .../rep_eva_limit_frame_plan_report.js | 7 +- .../vw_limit_frame_plan.js | 234 +++++ .../vw_limit_frame_plan_d.js | 109 +++ 34 files changed, 3220 insertions(+), 550 deletions(-) create mode 100644 ApiControllers/vw_limit_frame_planControllers.cs create mode 100644 EXCEL/eva_limit_frame_plan@vw_limit_frame_plan.xlsx create mode 100644 Migrations/25640304122731_AddTotalSalary.Designer.cs create mode 100644 Migrations/25640304122731_AddTotalSalary.cs create mode 100644 Models/vw_limit_frame_plan/Ivw_limit_frame_planService.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planInputModel.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planReportRequestModel.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planSearchModel.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planService.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planViewModel.cs create mode 100644 Models/vw_limit_frame_plan/vw_limit_frame_planWithSelectionViewModel.cs create mode 100644 ViewControllers/vw_limit_frame_planViewControllers.cs create mode 100644 Views/vw_limit_frame_planView/vw_limit_frame_plan.cshtml create mode 100644 Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml create mode 100644 wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan.js create mode 100644 wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js diff --git a/ApiControllers/vw_limit_frame_planControllers.cs b/ApiControllers/vw_limit_frame_planControllers.cs new file mode 100644 index 0000000..f140904 --- /dev/null +++ b/ApiControllers/vw_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/vw_limit_frame_plan")] + public class vw_limit_frame_planController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ivw_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public vw_limit_frame_planController(ILogger logger, Ivw_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(vw_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(vw_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(vw_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("vw_limit_frame_plan_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult vw_limit_frame_plan_report(vw_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] vw_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] vw_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/EXCEL/eva_limit_frame_plan.xlsx b/EXCEL/eva_limit_frame_plan.xlsx index ecde55de5feb5382a7511d2be7d151e48168edc7..4183ac28745d963fd2427233eb7a38c7c97976b3 100644 GIT binary patch delta 2719 zcmV;Q3Sjl_RK8WP#0v>Wj@Rh$0ssJSlg$epe^y;<)Ibz{7yJ()?>1YZrO56UZLLbR z2;Dx1F}b@tb~1@GlXll9MWL~aA`3N zN=~1YurdV}7Q${@(r#OIS8`TnJlG%^v?JARM>RY>S|y4Ey>a0kY|^J5_E6A_h;gtE zW0z-b-9@(UxyXZ(DY^*^5{0Gekw?sze*-e{BqA2v-f&@&@48T8^K?-Le4vIddZ(nR zi(zM6=q^oD;A<3^_cm`Rr_rB`{%Z7hqmPXKW~u|DPmJEHpY;!XaQUSY=o1(9r4@|u zc+jA^&STlV4jAm5DeSvw!t=57|nnHr@XWljRwkl;Te}VP= z?Ceo8q~M>G1&AFgb20Cw&y^o#_IfNpqLuul6$nmP%qZU`13zz(7pwU$zfYxiSDs-< zlW)81Js7E*ID#&2^h=|^*e)NM>RH|W3fny~`lHd6HNXe!ier0vXl*d@3Uw-eQ_t$? z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C-1 z12#&xQhFg^I4(^AgZLaUO5&W`sDXb6U#I%R^(V`2k%`N1IpuTTN zDN5WHW0gvPw!lOTh|k2J0-kf58^qKQ6ERYEm6-PMKC0~C+T6kiBQa8n=-*!Ibhln`aFMuoV-Zr8e7A1%h-RmB!}EZi2j zZnMzG=kpzy5HLm-%$m8U7Fh&-n z8251%8nYm8-{ieX9v#SUQE^C4rImk@JybK?_1IP+uiM0bMsp#BWj;P778<34?nYkbhE8 zq>DU(8ydK>wfSW+OW@+MB`U@V+%*=#PF&+T&DHSiCjbBd|NjF3P)h>@6abU00|*7t z+YPo$vp^vy0e?%wFcih#1;0bddz+-CPD0z^ANJ%xaH9AYlDnKl`x0~E8qBhv&4`t|BJ)&c+k5R;lHQvtq{?kG?J zz>_~IKml8mfGHpw0xL&IhXnutUlsrW7ytkO0000000000001GAyD2Li(c2BSO921? uT>=0A5dZ)H0000000000007<~lL9I|0br9rDpUb-la(qX1~MlA0001!#O9Cy diff --git a/EXCEL/eva_limit_frame_plan@vw_limit_frame_plan.xlsx b/EXCEL/eva_limit_frame_plan@vw_limit_frame_plan.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..a1395721d548088c3465ed4c98be31822373d8d8 GIT binary patch literal 10448 zcmeHtg;yNe_I2a#1PKt_-8HzoJ3$+l;1Jwh10hJT;O_43o}dj05(w@tzn+=*US^p2 zzJK7o>b0s?t*W!TZq?rBoO{kymV<)E2EYQ~0RR9gK!iJR(jEc;fQA78umJFodSVXt zEIU_$bb7Jd~p&*x7nG`KBckCTp@MGD;lIIz;yE?o-8|qNU+NVwCN4 zKT05P7WQ5b_vk>%(YoT9@OT8NGQN~u)oN=~VPn^%s7!Yz(qKxuilN1>R&K7lC6?J8 znZeFBsJ6uC6C)P3DuXDpVF-G3*1+{LU{DR1A1RLFyx)#22Add zWU|Jec(w<_JBOlMfdH#52N>ss&gGCh2q)*7+_=ZMcS)$Rb38n88B2f^cVpay3cd?u z=m6w>F(=D~%V@%z(q&Z8r(6-@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ft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using TTSW.EF; + +namespace tb320eva.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("25640304122731_AddTotalSalary")] + partial class AddTotalSalary + { + 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("cost_of_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("isActive"); + + b.Property("level_text") + .HasMaxLength(1000); + + b.Property("monthly_remuneration"); + + b.Property("order_of_data"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_text") + .HasMaxLength(1000); + + 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("remark") + .HasMaxLength(4000); + + 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("limit_frame_005_total"); + + b.Property("limit_frame_005_total_rounded"); + + 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("total_salary"); + + 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/25640304122731_AddTotalSalary.cs b/Migrations/25640304122731_AddTotalSalary.cs new file mode 100644 index 0000000..e03ab6b --- /dev/null +++ b/Migrations/25640304122731_AddTotalSalary.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddTotalSalary : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "total_salary", + table: "eva_limit_frame_plan", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "total_salary", + table: "eva_limit_frame_plan"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 9de865c..b4e6928 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -694,6 +694,8 @@ namespace tb320eva.Migrations b.Property("supervisor1_result") .HasMaxLength(1); + b.Property("total_salary"); + b.Property("updated"); b.HasKey("id"); diff --git a/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs b/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs index 7cbca11..699decb 100644 --- a/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs +++ b/Models/eva_limit_frame_employee/eva_limit_frame_employeeService.cs @@ -126,7 +126,7 @@ namespace TodoAPI2.Models && (!model.employee_id.HasValue || m_eva_limit_frame_employee.employee_id == model.employee_id) - orderby m_eva_limit_frame_employee.created descending + orderby m_eva_limit_frame_employee.order_of_data select new eva_limit_frame_employeeViewModel() { id = m_eva_limit_frame_employee.id, diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs index 257baa4..b9aa21e 100644 --- a/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs @@ -130,7 +130,7 @@ namespace TodoAPI2.Models remark = m_eva_limit_frame_group.remark, 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, + group_guid_eva_evaluation_group_code = fk_eva_evaluation_groupResult2.thegroup, isActive = m_eva_limit_frame_group.isActive, Created = m_eva_limit_frame_group.created, diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs index 4e5a0e8..aaec12d 100644 --- a/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planEntity.cs @@ -46,6 +46,8 @@ namespace TodoAPI2.Models public decimal? limit_frame_005_total_rounded { get; set; } + public decimal? total_salary { get; set; } + public void SetAutoField(DataContext context) { @@ -54,7 +56,12 @@ namespace TodoAPI2.Models public void DoAfterInsertUpdate(DataContext context) { - + total_salary = (from i in context.eva_limit_frame_employee + join j in context.eva_limit_frame_group + on i.frame_group_guid equals j.id + select i.salary).Sum(); + limit_frame_005_total = total_salary * limit_frame_005 / 100; + limit_frame_005_total_rounded = MyHelper.RoundOff(limit_frame_005_total.Value, 10); } } diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs index 6dd48f6..7cf4c07 100644 --- a/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs @@ -161,49 +161,7 @@ namespace TodoAPI2.Models var entity = GetEntity(model); entity.id = Guid.NewGuid(); - var all_group = (from i in _repository.Context.eva_evaluation_group - select i); - foreach(var x in all_group) - { - var all_emp = (from j in _repository.Context.eva_evaluation_group_detail - join k in emp.GetAllEmployee() on j.employee_id equals k.id - join m in ext.GetSortingDep() on k.department_id equals m.external_id - where j.evaluation_group_id == x.id - orderby m.external_code, - k.hpt_position_type_id, - k.hpl_position_level_id, - k.employee_no - select k); - - var new_frame_group = new eva_limit_frame_groupEntity(); - new_frame_group.id = Guid.NewGuid(); - new_frame_group.frame_plan_guid = entity.id; - new_frame_group.group_guid = x.id; - new_frame_group.limit_frame_295 = (decimal?)2.95; - new_frame_group.total_salary = all_emp.Sum(z => z.salary); - new_frame_group.total_salary_limit = (new_frame_group.total_salary * new_frame_group.limit_frame_295 / 100); - new_frame_group.total_salary_limit_rounded = new_frame_group.total_salary_limit; - _repository.Context.Add(new_frame_group); - - int i = 1; - foreach (var y in all_emp) - { - var new_emp = new eva_limit_frame_employeeEntity(); - new_emp.id = Guid.NewGuid(); - new_emp.frame_group_guid = new_frame_group.id; - new_emp.employee_id = y.id; - new_emp.org_id = y.department_id; - new_emp.position_text = y.position_name; - new_emp.level_text = y.position_level_text; - new_emp.salary = y.salary; - new_emp.position_allowance = y.position_allowance; - new_emp.monthly_remuneration = y.other_money; - new_emp.cost_of_living = y.cost_of_living; - new_emp.order_of_data = i; - i++; - _repository.Context.Add(new_emp); - } - } + entity.SetAutoField(_repository.Context); @@ -322,18 +280,7 @@ namespace TodoAPI2.Models } public void Delete(Guid id) { - var all_group = (from i in _repository.Context.eva_limit_frame_group - where i.frame_plan_guid == id - select i); - foreach (var x in all_group) - { - var all_emp = from i in _repository.Context.eva_limit_frame_employee - where i.frame_group_guid == x.id - select i; - _repository.Context.RemoveRange(all_emp); - } - - _repository.Context.RemoveRange(all_group); + _repository.Delete(id); diff --git a/Models/vw_limit_frame_plan/Ivw_limit_frame_planService.cs b/Models/vw_limit_frame_plan/Ivw_limit_frame_planService.cs new file mode 100644 index 0000000..500e130 --- /dev/null +++ b/Models/vw_limit_frame_plan/Ivw_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 Ivw_limit_frame_planService : IBaseService2 + { + new vw_limit_frame_planViewModel Insert(vw_limit_frame_planInputModel model, bool is_force_save); + new vw_limit_frame_planViewModel Update(Guid id, vw_limit_frame_planInputModel model, bool is_force_save); + List GetListByexecuted_date(DateTime? executed_date); + List GetListBySearch(vw_limit_frame_planSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + vw_limit_frame_planWithSelectionViewModel GetWithSelection(Guid id); + vw_limit_frame_planWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_limit_frame_planEntity GetEntity(Guid id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planInputModel.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planInputModel.cs new file mode 100644 index 0000000..86eca03 --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_limit_frame_planInputModel.cs @@ -0,0 +1,36 @@ +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 vw_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 DateTime? salary_adjustment_date { get; set; } + + public decimal? total_salary { get; set; } + + public decimal? limit_frame_005_total { get; set; } + + public decimal? limit_frame_005_total_rounded { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planReportRequestModel.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planReportRequestModel.cs new file mode 100644 index 0000000..75a80db --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_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 vw_limit_frame_planReportRequestModel : vw_limit_frame_planSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planSearchModel.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planSearchModel.cs new file mode 100644 index 0000000..0a07c29 --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_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 vw_limit_frame_planSearchModel + { + + public Guid id { get; set; } + + public DateTime? executed_date { get; set; } + + } +} + diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planService.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planService.cs new file mode 100644 index 0000000..7f9fb38 --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_limit_frame_planService.cs @@ -0,0 +1,363 @@ +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 vw_limit_frame_planService : Ivw_limit_frame_planService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + private Iexternal_employeeService emp; + + public vw_limit_frame_planService(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_planEntity GetEntity(vw_limit_frame_planInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private vw_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 vw_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 vw_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(); + + + return i; + } + public vw_limit_frame_planWithSelectionViewModel GetBlankItem() + { + var i = new vw_limit_frame_planWithSelectionViewModel(); + i.item_plan_guid = (from x in _repository.Context.eva_performance_plan select x).ToList(); + + + return i; + } + + public List GetListByexecuted_date(DateTime? executed_date) + { + var model = new vw_limit_frame_planSearchModel(); + model.executed_date = executed_date; + return GetListBySearch(model); + } + + public List GetListBySearch(vw_limit_frame_planSearchModel model) + { + var data = ( + from m_vw_limit_frame_plan in _repository.Context.eva_limit_frame_plan + + join fk_eva_performance_plan1 in _repository.Context.eva_performance_plan on m_vw_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() + + + where + 1 == 1 + && (!model.executed_date.HasValue || m_vw_limit_frame_plan.executed_date == model.executed_date) + + + orderby m_vw_limit_frame_plan.created descending + select new vw_limit_frame_planViewModel() + { + id = m_vw_limit_frame_plan.id, + plan_guid = m_vw_limit_frame_plan.plan_guid, + executed_date = m_vw_limit_frame_plan.executed_date, + limit_frame_005 = m_vw_limit_frame_plan.limit_frame_005, + salary_adjustment_date = m_vw_limit_frame_plan.salary_adjustment_date, + total_salary = m_vw_limit_frame_plan.total_salary, + limit_frame_005_total = m_vw_limit_frame_plan.limit_frame_005_total, + limit_frame_005_total_rounded = m_vw_limit_frame_plan.limit_frame_005_total_rounded, + + plan_guid_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.display_text, + + isActive = m_vw_limit_frame_plan.isActive, + Created = m_vw_limit_frame_plan.created, + Updated = m_vw_limit_frame_plan.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + + + public vw_limit_frame_planViewModel Insert(vw_limit_frame_planInputModel model, bool is_force_save) + { + var entity = GetEntity(model); + entity.id = Guid.NewGuid(); + entity.limit_frame_005 = (decimal?)0.05; + + var all_group = (from i in _repository.Context.eva_evaluation_group + select i); + foreach (var x in all_group) + { + var all_emp = (from j in _repository.Context.eva_evaluation_group_detail + join k in emp.GetAllEmployee() on j.employee_id equals k.id + join m in ext.GetSortingDep() on k.department_id equals m.external_id + where j.evaluation_group_id == x.id + orderby m.external_code, + k.hpt_position_type_id, + k.hpl_position_level_id, + k.employee_no + select k); + + var new_frame_group = new eva_limit_frame_groupEntity(); + new_frame_group.id = Guid.NewGuid(); + new_frame_group.frame_plan_guid = entity.id; + new_frame_group.group_guid = x.id; + new_frame_group.limit_frame_295 = (decimal?)2.95; + new_frame_group.total_salary = all_emp.Sum(z => z.salary); + new_frame_group.total_salary_limit = (new_frame_group.total_salary * new_frame_group.limit_frame_295 / 100); + new_frame_group.total_salary_limit_rounded = MyHelper.RoundOff(new_frame_group.total_salary_limit.Value, 10); + _repository.Context.Add(new_frame_group); + + int i = 1; + foreach (var y in all_emp) + { + var new_emp = new eva_limit_frame_employeeEntity(); + new_emp.id = Guid.NewGuid(); + new_emp.frame_group_guid = new_frame_group.id; + new_emp.employee_id = y.id; + new_emp.org_id = y.department_id; + new_emp.position_text = y.position_name; + new_emp.level_text = y.position_level_text; + new_emp.salary = y.salary; + new_emp.position_allowance = y.position_allowance; + new_emp.monthly_remuneration = y.other_money; + new_emp.cost_of_living = y.cost_of_living; + new_emp.order_of_data = i; + i++; + _repository.Context.Add(new_emp); + } + } + + entity.SetAutoField(_repository.Context); + + if (is_force_save) + { + var inserted = _repository.Insert(entity); + entity.DoAfterInsertUpdate(_repository.Context); + _repository.Context.SaveChanges(); + return Get(inserted.id); + } + else + { + _repository.InsertWithoutCommit(entity); + entity.DoAfterInsertUpdate(_repository.Context); + return Mapper.Map(entity); + } + } + + public vw_limit_frame_planViewModel Update(Guid id, vw_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.salary_adjustment_date = model.salary_adjustment_date; + existingEntity.total_salary = model.total_salary; + existingEntity.limit_frame_005_total = model.limit_frame_005_total; + existingEntity.limit_frame_005_total_rounded = model.limit_frame_005_total_rounded; + + existingEntity.SetAutoField(_repository.Context); + + if (is_force_save) + { + var updated = _repository.Update(id, existingEntity); + existingEntity.DoAfterInsertUpdate(_repository.Context); + _repository.Context.SaveChanges(); + 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.salary_adjustment_date = i.salary_adjustment_date; + existingEntity.total_salary = i.total_salary; + existingEntity.limit_frame_005_total = i.limit_frame_005_total; + existingEntity.limit_frame_005_total_rounded = i.limit_frame_005_total_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 vw_limit_frame_planViewModel SetAsActive(Guid id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public vw_limit_frame_planViewModel SetAsInactive(Guid id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(Guid id) + { + var all_group = (from i in _repository.Context.eva_limit_frame_group + where i.frame_plan_guid == id + select i); + foreach (var x in all_group) + { + var all_emp = from i in _repository.Context.eva_limit_frame_employee + where i.frame_group_guid == x.id + select i; + _repository.Context.RemoveRange(all_emp); + } + + _repository.Context.RemoveRange(all_group); + + _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("salary_adjustment_date", "เลื่อนเงินเดือนวันที่"); + i.Add("txt_salary_adjustment_date", "เลื่อนเงินเดือนวันที่"); + i.Add("total_salary", "รวมอัตราเงินเดือน"); + i.Add("limit_frame_005_total", "กันวงเงินไว้"); + i.Add("limit_frame_005_total_rounded", "กันวงเงินใช้จริง"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} + diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planViewModel.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planViewModel.cs new file mode 100644 index 0000000..2829182 --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_limit_frame_planViewModel.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 vw_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 DateTime? salary_adjustment_date { get; set; } + + public string txt_salary_adjustment_date { get { return MyHelper.GetDateStringForReport(this.salary_adjustment_date); } } + + public decimal? total_salary { get; set; } + + public decimal? limit_frame_005_total { get; set; } + + public decimal? limit_frame_005_total_rounded { get; set; } + + public string plan_guid_eva_performance_plan_fiscal_year { get; set; } + + } +} \ No newline at end of file diff --git a/Models/vw_limit_frame_plan/vw_limit_frame_planWithSelectionViewModel.cs b/Models/vw_limit_frame_plan/vw_limit_frame_planWithSelectionViewModel.cs new file mode 100644 index 0000000..7cd64ba --- /dev/null +++ b/Models/vw_limit_frame_plan/vw_limit_frame_planWithSelectionViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class vw_limit_frame_planWithSelectionViewModel: vw_limit_frame_planViewModel + { + public List item_plan_guid { get; set; } + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index dcc7159..07f8c78 100644 --- a/Startup.cs +++ b/Startup.cs @@ -323,6 +323,8 @@ namespace Test01 services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -598,6 +600,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/Utils/MyHelper.cs b/Utils/MyHelper.cs index 20481f3..19f3754 100644 --- a/Utils/MyHelper.cs +++ b/Utils/MyHelper.cs @@ -331,4 +331,9 @@ public class MyHelper string var = !string.IsNullOrEmpty(env_var) ? env_var : Configuration[variable]; return var; } + + public static decimal RoundOff(decimal i, decimal round_number) + { + return (Math.Round(i / round_number)) * round_number; + } } diff --git a/ViewControllers/vw_limit_frame_planViewControllers.cs b/ViewControllers/vw_limit_frame_planViewControllers.cs new file mode 100644 index 0000000..aee3aec --- /dev/null +++ b/ViewControllers/vw_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 vw_limit_frame_planViewController : Controller + { + private ILogger _logger; + private Ivw_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public vw_limit_frame_planViewController(ILogger logger, Ivw_limit_frame_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult vw_limit_frame_plan() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult vw_limit_frame_plan_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult vw_limit_frame_plan_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult vw_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 index 7214d56..5f06a29 100644 --- a/Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml +++ b/Views/eva_limit_frame_employeeView/eva_limit_frame_employee.cshtml @@ -17,60 +17,60 @@
- - + + -
-
-
-
- - -
+
+
+
+
+ + +
-
- - -
+
+ + +
-
- - -
-
-
-
- - -
+
+ + +
+
+
+
+ + +
-
- - -
-
-
-
- - -
+
+ + +
+
+
+
+ + +
-
- - -
+
+ + +
-
- - -
-
-
-
- - -
-
+
+ + +
+
+
+
+ + +
+
@@ -95,51 +95,51 @@ - +
-
ค้นหา eva_limit_frame_employee
-
-
- -
- - -
+
ค้นหา eva_limit_frame_employee
+
+
-
- - -
+
+ + +
-
- - - -
+
+ + +
-
-
+
+ + + +
- + + + +
- - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -147,13 +147,13 @@ @section FooterPlaceHolder{ - - + + } diff --git a/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml b/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml index b95a730..de37107 100644 --- a/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group.cshtml @@ -17,44 +17,44 @@
- - + + -
-
-
-
- - -
+
+
+
+
+ + +
-
- - -
-
-
-
- - -
+
+ + +
+
+
+
+ + +
-
- - -
+
+ + +
-
- - -
-
-
-
- - -
-
+
+ + +
+
+
+
+ + +
+
@@ -79,48 +79,48 @@ - +
-
ค้นหา eva_limit_frame_group
-
-
- -
- - -
+
ค้นหา eva_limit_frame_group
+
+
-
- - -
+
+ + +
-
- - - -
+
+ + +
-
-
+
+ + + +
-
เครื่องมือเครื่องมือ
+ + + +
- - - - - - - - - - - + + + + + + + + + + + @@ -128,13 +128,13 @@ @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 index c24f1b4..9b748d8 100644 --- a/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml +++ b/Views/eva_limit_frame_groupView/eva_limit_frame_group_d.cshtml @@ -2,9 +2,89 @@ @inject IConfiguration Configuration @{ ViewData["Title"] = "eva_limit_frame_group"; - Layout = "_LayoutDirect"; + Layout = "_LayoutDirect"; } + + +
@@ -15,89 +95,115 @@ + +
-
บันทึกข้อมูล eva_limit_frame_group
+
วงเงินที่ใช้ในการเลื่อนเงินเดือนของแต่ละกอง/ส่วนงาน
-
- กรุณากรอกข้อมูลลงในแบบฟอร์ม -
-
-
+
+
- - + + -
-
-
-
- - +
+
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+ +
+
+ + +
-
- - -
-
-
-
- - -
- -
- - -
- -
- - -
-
-
-
- - -
-
- - - - - - - -
-
- - -
-
- + + +
+ +
+
รายชื่อพนักงานและอัตราเงินเดือน ณ กำหนดกรอบวงเงิน
+
เครื่องมือเครื่องมือ
+ + + + + + + + + + + + + + + + + + +
เครื่องมือ
@section FooterPlaceHolder{ - - + + + } diff --git a/Views/home/index2.cshtml b/Views/home/index2.cshtml index 936629a..bcccc3b 100644 --- a/Views/home/index2.cshtml +++ b/Views/home/index2.cshtml @@ -31,7 +31,7 @@
  • ·กำหนดแผนการประเมินเพื่อปรับเลื่อนเงินเดือน
    • ·กำหนดระดับผลการประเมิน
      diff --git a/Views/vw_limit_frame_planView/vw_limit_frame_plan.cshtml b/Views/vw_limit_frame_planView/vw_limit_frame_plan.cshtml new file mode 100644 index 0000000..89d636d --- /dev/null +++ b/Views/vw_limit_frame_planView/vw_limit_frame_plan.cshtml @@ -0,0 +1,108 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "vw_limit_frame_plan"; +} + + + +
      +
      +
      + @Configuration["SiteInformation:modulename"] +
      +
      +
      + +
      +
      + +
      +
      วงเงินที่ใช้ในการเลื่อนเงินเดือน
      +
      +
      + +
      + + +
      + +
      +
      + + + + + + + + + + + + + + + + + +
      เครื่องมือ
      +
      + +@section FooterPlaceHolder{ + + +} + diff --git a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml new file mode 100644 index 0000000..9ac9dcc --- /dev/null +++ b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml @@ -0,0 +1,155 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "vw_limit_frame_plan"; + Layout = "_LayoutDirect"; +} + + + + +
      +
      +
      + @Configuration["SiteInformation:modulename"] +
      +
      +
      + +
      +
      + +
      +
      บันทึกข้อมูล วงเงินที่ใช้ในการเลื่อนเงินเดือน
      + +
      +
      + +
      +
      + + + + +
      +
      + + +
      + +
      + + +
      + +
      + + +
      +
      +
      +
      + + +
      + +
      + + +
      +
      +
      +
      + + +
      + +
      + + +
      +
      + + +
      +
      +
      +
      + +
      +
      + + + +
      +
      + +
      + +
      + +
      +
      วงเงินที่ใช้ในการเลื่อนเงินเดือนของแต่ละกอง/ส่วนงาน
      + + + + + + + + + + + + + + + +
      เครื่องมือ
      +
      + +@section FooterPlaceHolder{ + + + + +} + diff --git a/tb320eva.csproj b/tb320eva.csproj index c2eea93..3b3c6c0 100644 --- a/tb320eva.csproj +++ b/tb320eva.csproj @@ -86,6 +86,8 @@ + + @@ -109,6 +111,8 @@ + + Always diff --git a/tb320eva.xml b/tb320eva.xml index 9288550..1c68e5d 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -4329,16 +4329,6 @@ - - - Get specific item by id - - - - Return Get specific item by id - Returns the item - Error Occurred - Get Blank Item @@ -4349,26 +4339,6 @@ Returns the item Error Occurred - - - Get list items by frame_plan_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 @@ -4379,66 +4349,6 @@ 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 @@ -4872,6 +4782,124 @@ Returns the item 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 @@ -5252,6 +5280,14 @@ + + + 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 index c227b3a..de7c030 100644 --- a/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js +++ b/wwwroot/js/eva_limit_frame_employee/eva_limit_frame_employee.js @@ -5,48 +5,48 @@ var eva_limit_frame_employee_API = "/api/eva_limit_frame_employee/"; function eva_limit_frame_employee_GetSearchParameter() { 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.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); + $("#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); -$("#eva_limit_frame_employee_position_text").val(data.position_text); -$("#eva_limit_frame_employee_level_text").val(data.level_text); -$("#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); -$("#eva_limit_frame_employee_cost_of_living").val(data.cost_of_living); -$("#eva_limit_frame_employee_order_of_data").val(data.order_of_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", "fullname", "item_employee_id", data.employee_id); + DropDownClearFormAndFeedWithData($("#eva_limit_frame_employee_org_id"), data, "id", "external_name", "item_org_id", data.org_id); + $("#eva_limit_frame_employee_position_text").val(data.position_text); + $("#eva_limit_frame_employee_level_text").val(data.level_text); + $("#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); + $("#eva_limit_frame_employee_cost_of_living").val(data.cost_of_living); + $("#eva_limit_frame_employee_order_of_data").val(data.order_of_data); + console.log(data); } 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_text = $("#eva_limit_frame_employee_position_text").val(); -eva_limit_frame_employeeObject.level_text = $("#eva_limit_frame_employee_level_text").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(); -eva_limit_frame_employeeObject.cost_of_living = $("#eva_limit_frame_employee_cost_of_living").val(); -eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_order_of_data").val(); + 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_text = $("#eva_limit_frame_employee_position_text").val(); + eva_limit_frame_employeeObject.level_text = $("#eva_limit_frame_employee_level_text").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(); + eva_limit_frame_employeeObject.cost_of_living = $("#eva_limit_frame_employee_cost_of_living").val(); + eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_order_of_data").val(); return eva_limit_frame_employeeObject; @@ -55,14 +55,14 @@ eva_limit_frame_employeeObject.order_of_data = $("#eva_limit_frame_employee_orde function eva_limit_frame_employee_InitialForm(s) { var successFunc = function (result) { eva_limit_frame_employee_FeedDataToForm(result); - eva_limit_frame_employee_FeedDataToSearchForm(result); + eva_limit_frame_employee_FeedDataToSearchForm(result); if (s) { // Incase model popup $("#eva_limit_frame_employeeModel").modal("show"); } - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxGetRequest(apisite + eva_limit_frame_employee_API + "GetBlankItem", successFunc, AlertDanger); } @@ -89,15 +89,15 @@ function eva_limit_frame_employee_SetEditForm(a) { eva_limit_frame_employee_editMode = "UPDATE"; eva_limit_frame_employee_FeedDataToForm(result); $("#eva_limit_frame_employeeModel").modal("show"); - endLoad(); + endLoad(); }; - startLoad(); + 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); + eva_limit_frame_employee_InitialForm(s); } function eva_limit_frame_employee_RefreshTable() { @@ -115,8 +115,7 @@ var eva_limit_frame_employee_customValidation = function (group) { }; function eva_limit_frame_employee_PutUpdate() { - if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation)) - { + if (!ValidateForm('eva_limit_frame_employee', eva_limit_frame_employee_customValidation)) { return; } @@ -126,22 +125,22 @@ function eva_limit_frame_employee_PutUpdate() { if (eva_limit_frame_employee_editMode === "UPDATE") { var successFunc1 = function (result) { $("#eva_limit_frame_employeeModel").modal("hide"); - AlertSuccess(result.code+" "+result.message); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_employee_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + 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); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_employee_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxPostRequest(apisite + eva_limit_frame_employee_API, data, successFunc2, AlertDanger); } } @@ -150,11 +149,11 @@ function eva_limit_frame_employee_GoDelete(a) { if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { var successFunc = function (result) { $("#eva_limit_frame_employeeModel").modal("hide"); - AlertSuccess(result.code+" "+result.message); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_employee_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxDeleteRequest(apisite + eva_limit_frame_employee_API + a, null, successFunc, AlertDanger); } } @@ -164,37 +163,38 @@ function eva_limit_frame_employee_GoDelete(a) { var eva_limit_frame_employeeTableV; var eva_limit_frame_employee_setupTable = function (result) { - tmp = '"'; + tmp = '"'; + var groupColumn = 3; eva_limit_frame_employeeTableV = $('#eva_limit_frame_employeeTable').DataTable({ "processing": true, "serverSide": false, "data": result, - //"select": { + //"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_text" }, - { "data": "level_text" }, - { "data": "salary" }, - { "data": "position_allowance" }, - { "data": "monthly_remuneration" }, - { "data": "cost_of_living" }, - { "data": "order_of_data" }, + //{ "data": "" }, + { "data": "id" }, + { "data": "order_of_data" }, + { "data": "employee_id_external_linkage_external_name" }, + { "data": "org_id_external_linkage_external_name" }, + { "data": "position_text" }, + { "data": "level_text" }, + { "data": "salary" }, + { "data": "position_allowance" }, + { "data": "monthly_remuneration" }, + { "data": "cost_of_living" }, + ], "columnDefs": [ { "targets": 0, //1, "data": "id", "render": function (data, type, row, meta) { - return " "; + return " "; } }, + { "visible": false, "targets": groupColumn } //{ // targets: 0, // data: "", @@ -202,20 +202,35 @@ var eva_limit_frame_employee_setupTable = function (result) { // orderable: false, // className: 'select-checkbox' //} - ], + ], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, "paging": true, - "searching": false + "searching": false, + "drawCallback": function (settings) { + var api = this.api(); + var rows = api.rows({ page: 'current' }).nodes(); + var last = null; + + api.column(groupColumn, { page: 'current' }).data().each(function (group, i) { + if (last !== group) { + $(rows).eq(i).before( + '' + group + '' + ); + + last = group; + } + }); + } }); - endLoad(); + 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); + 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() { @@ -223,10 +238,10 @@ function eva_limit_frame_employee_DoSearch() { var eva_limit_frame_employee_reload = function (result) { eva_limit_frame_employeeTableV.destroy(); eva_limit_frame_employee_setupTable(result); - endLoad(); + endLoad(); }; - startLoad(); - AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?"+p, eva_limit_frame_employee_reload, AlertDanger); + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_employee/GetListBySearch?" + p, eva_limit_frame_employee_reload, AlertDanger); } function eva_limit_frame_employee_GetSelect(f) { 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 index f1795e0..ad02c34 100644 --- a/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js +++ b/wwwroot/js/eva_limit_frame_group/eva_limit_frame_group.js @@ -5,42 +5,42 @@ var eva_limit_frame_group_API = "/api/eva_limit_frame_group/"; function eva_limit_frame_group_GetSearchParameter() { 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.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); + $("#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); -$("#eva_limit_frame_group_remark").val(data.remark); + $("#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); + $("#eva_limit_frame_group_remark").val(data.remark); } 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(); -eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); + 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(); + eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); return eva_limit_frame_groupObject; @@ -49,14 +49,14 @@ eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); function eva_limit_frame_group_InitialForm(s) { var successFunc = function (result) { eva_limit_frame_group_FeedDataToForm(result); - eva_limit_frame_group_FeedDataToSearchForm(result); + eva_limit_frame_group_FeedDataToSearchForm(result); if (s) { // Incase model popup $("#eva_limit_frame_groupModel").modal("show"); } - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger); } @@ -72,10 +72,10 @@ function eva_limit_frame_group_GoCreate() { function eva_limit_frame_group_GoEdit(a) { // Incase model popup - eva_limit_frame_group_SetEditForm(a); + //eva_limit_frame_group_SetEditForm(a); // Incase open new page - //window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d?id=" + a); + window_open(appsite + "/eva_limit_frame_groupView/eva_limit_frame_group_d?id=" + a); } function eva_limit_frame_group_SetEditForm(a) { @@ -83,15 +83,15 @@ function eva_limit_frame_group_SetEditForm(a) { eva_limit_frame_group_editMode = "UPDATE"; eva_limit_frame_group_FeedDataToForm(result); $("#eva_limit_frame_groupModel").modal("show"); - endLoad(); + endLoad(); }; - startLoad(); + 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); + eva_limit_frame_group_InitialForm(s); } function eva_limit_frame_group_RefreshTable() { @@ -109,8 +109,7 @@ var eva_limit_frame_group_customValidation = function (group) { }; function eva_limit_frame_group_PutUpdate() { - if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) - { + if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) { return; } @@ -120,22 +119,22 @@ function eva_limit_frame_group_PutUpdate() { if (eva_limit_frame_group_editMode === "UPDATE") { var successFunc1 = function (result) { $("#eva_limit_frame_groupModel").modal("hide"); - AlertSuccess(result.code+" "+result.message); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_group_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + 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); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_group_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger); } } @@ -144,11 +143,11 @@ function eva_limit_frame_group_GoDelete(a) { if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { var successFunc = function (result) { $("#eva_limit_frame_groupModel").modal("hide"); - AlertSuccess(result.code+" "+result.message); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_group_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger); } } @@ -158,32 +157,30 @@ function eva_limit_frame_group_GoDelete(a) { var eva_limit_frame_groupTableV; var eva_limit_frame_group_setupTable = function (result) { - tmp = '"'; + tmp = '"'; eva_limit_frame_groupTableV = $('#eva_limit_frame_groupTable').DataTable({ "processing": true, "serverSide": false, "data": result, - //"select": { + //"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" }, - { "data": "remark" }, + //{ "data": "" }, + { "data": "id" }, + { "data": "group_guid_eva_evaluation_group_code" }, + { "data": "limit_frame_295" }, + { "data": "total_salary" }, + { "data": "total_salary_limit" }, + { "data": "total_salary_limit_rounded" }, + { "data": "remark" }, ], "columnDefs": [ { "targets": 0, //1, "data": "id", "render": function (data, type, row, meta) { - return " "; + return " "; } }, //{ @@ -193,20 +190,20 @@ var eva_limit_frame_group_setupTable = function (result) { // orderable: false, // className: 'select-checkbox' //} - ], + ], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, - "paging": true, - "searching": false + "paging": false, + "searching": false }); - endLoad(); + 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); + 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() { @@ -214,10 +211,10 @@ function eva_limit_frame_group_DoSearch() { var eva_limit_frame_group_reload = function (result) { eva_limit_frame_groupTableV.destroy(); eva_limit_frame_group_setupTable(result); - endLoad(); + endLoad(); }; - startLoad(); - AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?"+p, eva_limit_frame_group_reload, AlertDanger); + startLoad(); + AjaxGetRequest(apisite + "/api/eva_limit_frame_group/GetListBySearch?" + p, eva_limit_frame_group_reload, AlertDanger); } function eva_limit_frame_group_GetSelect(f) { 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 index c7a974f..bbb3884 100644 --- 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 @@ -4,27 +4,27 @@ 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); -$("#eva_limit_frame_group_remark").val(data.remark); + $("#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", "thegroup", "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); + $("#eva_limit_frame_group_remark").val(data.remark); } 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(); -eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); + 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(); + eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); return eva_limit_frame_groupObject; @@ -33,9 +33,9 @@ eva_limit_frame_groupObject.remark = $("#eva_limit_frame_group_remark").val(); function eva_limit_frame_group_InitialForm() { var successFunc = function (result) { eva_limit_frame_group_FeedDataToForm(result); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger); } @@ -45,15 +45,15 @@ function eva_limit_frame_group_SetEditForm(a) { var successFunc = function (result) { eva_limit_frame_group_editMode = "UPDATE"; eva_limit_frame_group_FeedDataToForm(result); - endLoad(); + endLoad(); }; - startLoad(); + 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(); + eva_limit_frame_group_InitialForm(); } //================= Update and Delete ========================================= @@ -63,8 +63,7 @@ var eva_limit_frame_group_customValidation = function (group) { }; function eva_limit_frame_group_PutUpdate() { - if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) - { + if (!ValidateForm('eva_limit_frame_group', eva_limit_frame_group_customValidation)) { return; } var data = eva_limit_frame_group_GetFromForm(); @@ -72,19 +71,19 @@ function eva_limit_frame_group_PutUpdate() { //Update Mode if (eva_limit_frame_group_editMode === "UPDATE") { var successFunc1 = function (result) { - AlertSuccess(result.code+" "+result.message); - endLoad(); + AlertSuccess(result.code + " " + result.message); + endLoad(); }; - startLoad(); + 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(); + AlertSuccess(result.code + " " + result.message); + endLoad(); }; - startLoad(); + startLoad(); AjaxPostRequest(apisite + eva_limit_frame_group_API, data, successFunc2, AlertDanger); } } @@ -92,11 +91,11 @@ function eva_limit_frame_group_PutUpdate() { function eva_limit_frame_group_GoDelete(a) { if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) { var successFunc = function (result) { - AlertSuccess(result.code+" "+result.message); + AlertSuccess(result.code + " " + result.message); eva_limit_frame_group_RefreshTable(); - endLoad(); + endLoad(); }; - startLoad(); + startLoad(); AjaxDeleteRequest(apisite + eva_limit_frame_group_API + a, null, successFunc, AlertDanger); } } diff --git a/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js b/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js index 6cbd74d..f724494 100644 --- a/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js +++ b/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js @@ -4,7 +4,7 @@ function rep_eva_limit_frame_plan_GetSearchParameter(fileType) { var rep_eva_limit_frame_planSearchObject = new Object(); -rep_eva_limit_frame_planSearchObject.frame_plan_guid = $("#s_rep_eva_limit_frame_plan_frame_plan_guid").val(); + rep_eva_limit_frame_planSearchObject.frame_plan_guid = getUrlParameter("id"); rep_eva_limit_frame_planSearchObject.fileType = fileType; @@ -15,7 +15,7 @@ rep_eva_limit_frame_planSearchObject.frame_plan_guid = $("#s_rep_eva_limit_frame } function rep_eva_limit_frame_plan_FeedDataToSearchForm(data) { -DropDownClearFormAndFeedWithData($("#s_rep_eva_limit_frame_plan_frame_plan_guid"), data, "id", "executed_date", "item_frame_plan_guid", data.frame_plan_guid); + DropDownClearFormAndFeedWithData($("#s_rep_eva_limit_frame_plan_frame_plan_guid"), data, "id", "executed_date", "item_frame_plan_guid", data.frame_plan_guid); } @@ -46,10 +46,11 @@ function rep_eva_limit_frame_plan_DoSearch(fileType) { var report_url = apisite + "/api/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report?" + p; - if (fileType === "pdf") { + if (fileType === "pdf") { $("#report_result").attr("src", report_url); $("#report_result").show(); //window.open(report_url); + $("#report_xModel").modal("show"); } else { $("#report_result").hide(); window.open(report_url); diff --git a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan.js b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan.js new file mode 100644 index 0000000..7bf9a1e --- /dev/null +++ b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan.js @@ -0,0 +1,234 @@ +var vw_limit_frame_plan_editMode = "CREATE"; +var vw_limit_frame_plan_API = "/api/vw_limit_frame_plan/"; + +//================= Search Customizaiton ========================================= + +function vw_limit_frame_plan_GetSearchParameter() { + var vw_limit_frame_planSearchObject = new Object(); + //vw_limit_frame_planSearchObject.executed_date = formatDateForGetParameter(getDate($("#s_vw_limit_frame_plan_executed_date").val())); + + return vw_limit_frame_planSearchObject; +} + +function vw_limit_frame_plan_FeedDataToSearchForm(data) { + $("#s_vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + +} + +//================= Form Data Customizaiton ========================================= + +function vw_limit_frame_plan_FeedDataToForm(data) { + $("#vw_limit_frame_plan_id").val(data.id); + DropDownClearFormAndFeedWithData($("#vw_limit_frame_plan_plan_guid"), data, "id", "display_text", "item_plan_guid", data.plan_guid); + $("#vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + $("#vw_limit_frame_plan_limit_frame_005").val(data.limit_frame_005); + $("#vw_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date)); + $("#vw_limit_frame_plan_total_salary").val(data.total_salary); + $("#vw_limit_frame_plan_limit_frame_005_total").val(data.limit_frame_005_total); + $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(data.limit_frame_005_total_rounded); + +} + +function vw_limit_frame_plan_GetFromForm() { + var vw_limit_frame_planObject = new Object(); + vw_limit_frame_planObject.id = $("#vw_limit_frame_plan_id").val(); + vw_limit_frame_planObject.plan_guid = $("#vw_limit_frame_plan_plan_guid").val(); + vw_limit_frame_planObject.executed_date = getDate($("#vw_limit_frame_plan_executed_date").val()); + vw_limit_frame_planObject.limit_frame_005 = $("#vw_limit_frame_plan_limit_frame_005").val(); + vw_limit_frame_planObject.salary_adjustment_date = getDate($("#vw_limit_frame_plan_salary_adjustment_date").val()); + vw_limit_frame_planObject.total_salary = $("#vw_limit_frame_plan_total_salary").val(); + vw_limit_frame_planObject.limit_frame_005_total = $("#vw_limit_frame_plan_limit_frame_005_total").val(); + vw_limit_frame_planObject.limit_frame_005_total_rounded = $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(); + + + return vw_limit_frame_planObject; +} + +function vw_limit_frame_plan_InitialForm(s) { + var successFunc = function (result) { + vw_limit_frame_plan_FeedDataToForm(result); + vw_limit_frame_plan_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#vw_limit_frame_planModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function vw_limit_frame_plan_GoCreate() { + // Incase model popup + vw_limit_frame_plan_SetCreateForm(true); + + // Incase open new page + //window_open(appsite + "/vw_limit_frame_planView/vw_limit_frame_plan_d"); +} + +function vw_limit_frame_plan_GoEdit(a) { + // Incase model popup + //vw_limit_frame_plan_SetEditForm(a); + + // Incase open new page + window_open(appsite + "/vw_limit_frame_planView/vw_limit_frame_plan_d?id=" + a); +} + +function vw_limit_frame_plan_SetEditForm(a) { + var successFunc = function (result) { + vw_limit_frame_plan_editMode = "UPDATE"; + vw_limit_frame_plan_FeedDataToForm(result); + $("#vw_limit_frame_planModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_limit_frame_plan_API + a, successFunc, AlertDanger); +} + +function vw_limit_frame_plan_SetCreateForm(s) { + vw_limit_frame_plan_editMode = "CREATE"; + vw_limit_frame_plan_InitialForm(s); +} + +function vw_limit_frame_plan_RefreshTable() { + // Incase model popup + vw_limit_frame_plan_DoSearch(); + + // Incase open new page + //window.parent.vw_limit_frame_plan_DoSearch(); +} + +//================= Update and Delete ========================================= + +var vw_limit_frame_plan_customValidation = function (group) { + return ""; +}; + +function vw_limit_frame_plan_PutUpdate() { + if (!ValidateForm('vw_limit_frame_plan', vw_limit_frame_plan_customValidation)) { + return; + } + + var data = vw_limit_frame_plan_GetFromForm(); + + //Update Mode + if (vw_limit_frame_plan_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#vw_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + vw_limit_frame_plan_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#vw_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + vw_limit_frame_plan_API, data, successFunc2, AlertDanger); + } +} + +function vw_limit_frame_plan_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#vw_limit_frame_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + vw_limit_frame_plan_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var vw_limit_frame_planTableV; + +var vw_limit_frame_plan_setupTable = function (result) { + tmp = '"'; + vw_limit_frame_planTableV = $('#vw_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": "txt_salary_adjustment_date" }, + { "data": "total_salary" }, + { "data": "limit_frame_005_total" }, + { "data": "limit_frame_005_total_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 vw_limit_frame_plan_InitiateDataTable() { + startLoad(); + var p = $.param(vw_limit_frame_plan_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/vw_limit_frame_plan/GetListBySearch?" + p, vw_limit_frame_plan_setupTable, AlertDanger); +} + +function vw_limit_frame_plan_DoSearch() { + var p = $.param(vw_limit_frame_plan_GetSearchParameter()); + var vw_limit_frame_plan_reload = function (result) { + vw_limit_frame_planTableV.destroy(); + vw_limit_frame_plan_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/vw_limit_frame_plan/GetListBySearch?" + p, vw_limit_frame_plan_reload, AlertDanger); +} + +function vw_limit_frame_plan_GetSelect(f) { + var vw_limit_frame_plan_selectitem = []; + $.each(vw_limit_frame_planTableV.rows('.selected').data(), function (key, value) { + vw_limit_frame_plan_selectitem.push(value[f]); + }); + alert(vw_limit_frame_plan_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + + diff --git a/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js new file mode 100644 index 0000000..24eec32 --- /dev/null +++ b/wwwroot/js/vw_limit_frame_plan/vw_limit_frame_plan_d.js @@ -0,0 +1,109 @@ +var vw_limit_frame_plan_editMode = "CREATE"; +var vw_limit_frame_plan_API = "/api/vw_limit_frame_plan/"; + +//================= Form Data Customizaiton ========================================= + +function vw_limit_frame_plan_FeedDataToForm(data) { + $("#vw_limit_frame_plan_id").val(data.id); + DropDownClearFormAndFeedWithData($("#vw_limit_frame_plan_plan_guid"), data, "id", "display_text", "item_plan_guid", data.plan_guid); + $("#vw_limit_frame_plan_executed_date").val(formatDate(data.executed_date)); + $("#vw_limit_frame_plan_limit_frame_005").val(data.limit_frame_005); + $("#vw_limit_frame_plan_salary_adjustment_date").val(formatDate(data.salary_adjustment_date)); + $("#vw_limit_frame_plan_total_salary").val(data.total_salary); + $("#vw_limit_frame_plan_limit_frame_005_total").val(data.limit_frame_005_total); + $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(data.limit_frame_005_total_rounded); + +} + +function vw_limit_frame_plan_GetFromForm() { + var vw_limit_frame_planObject = new Object(); + vw_limit_frame_planObject.id = $("#vw_limit_frame_plan_id").val(); + vw_limit_frame_planObject.plan_guid = $("#vw_limit_frame_plan_plan_guid").val(); + vw_limit_frame_planObject.executed_date = getDate($("#vw_limit_frame_plan_executed_date").val()); + vw_limit_frame_planObject.limit_frame_005 = $("#vw_limit_frame_plan_limit_frame_005").val(); + vw_limit_frame_planObject.salary_adjustment_date = getDate($("#vw_limit_frame_plan_salary_adjustment_date").val()); + vw_limit_frame_planObject.total_salary = $("#vw_limit_frame_plan_total_salary").val(); + vw_limit_frame_planObject.limit_frame_005_total = $("#vw_limit_frame_plan_limit_frame_005_total").val(); + vw_limit_frame_planObject.limit_frame_005_total_rounded = $("#vw_limit_frame_plan_limit_frame_005_total_rounded").val(); + + + return vw_limit_frame_planObject; +} + +function vw_limit_frame_plan_InitialForm() { + var successFunc = function (result) { + vw_limit_frame_plan_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function vw_limit_frame_plan_SetEditForm(a) { + var successFunc = function (result) { + vw_limit_frame_plan_editMode = "UPDATE"; + vw_limit_frame_plan_FeedDataToForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_limit_frame_plan_API + a, successFunc, AlertDanger); +} + +function vw_limit_frame_plan_SetCreateForm() { + vw_limit_frame_plan_editMode = "CREATE"; + vw_limit_frame_plan_InitialForm(); +} + +//================= Update and Delete ========================================= + +var vw_limit_frame_plan_customValidation = function (group) { + return ""; +}; + +function vw_limit_frame_plan_PutUpdate() { + if (!ValidateForm('vw_limit_frame_plan', vw_limit_frame_plan_customValidation)) { + return; + } + var data = vw_limit_frame_plan_GetFromForm(); + + //Update Mode + if (vw_limit_frame_plan_editMode === "UPDATE") { + var successFunc1 = function (result) { + AlertSuccess(result.code + " " + result.message); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + vw_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 + vw_limit_frame_plan_API, data, successFunc2, AlertDanger); + } +} + +function vw_limit_frame_plan_GoDelete(a) { + if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) { + var successFunc = function (result) { + AlertSuccess(result.code + " " + result.message); + vw_limit_frame_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + vw_limit_frame_plan_API + a, null, successFunc, AlertDanger); + } +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + +