From dce57d2ca148de3c75e25204eb188df6c63b3891 Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Mon, 19 Jul 2021 14:54:44 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B8=E0=B8=87=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=81?= =?UTF-8?q?=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=9C=E0=B8=A5=E0=B8=A3=E0=B8=A7?= =?UTF-8?q?=E0=B8=A1=20=E0=B8=82=E0=B8=AD=E0=B8=87=E0=B8=88=E0=B8=B3?= =?UTF-8?q?=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B8=9E=E0=B8=99=E0=B8=B1=E0=B8=81?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=20=E0=B9=81=E0=B8=A5=E0=B8=B0?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eva_limit_frame_groupService.cs | 14 +++++++++++--- .../eva_limit_frame_groupViewModel.cs | 2 ++ .../vw_limit_frame_plan_d.cshtml | 15 +++++---------- .../eva_limit_frame_group.js | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) 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 570baf6..2476528 100644 --- a/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupService.cs @@ -102,6 +102,12 @@ namespace TodoAPI2.Models public List GetListBySearch(eva_limit_frame_groupSearchModel model) { + var group_count = (from i in _repository.Context.eva_limit_frame_employee + join j in _repository.Context.eva_limit_frame_group on i.frame_group_guid equals j.id + where j.frame_plan_guid == model.frame_plan_guid + group i.id by j.id into g + select new { gid = g.Key, emp = g.Count() }).ToList(); + var data = ( from m_eva_limit_frame_group in _repository.Context.eva_limit_frame_group @@ -114,13 +120,13 @@ namespace TodoAPI2.Models from fk_eva_evaluation_groupResult2 in eva_evaluation_groupResult2.DefaultIfEmpty() - where - 1 == 1 + where + 1 == 1 && (!model.frame_plan_guid.HasValue || m_eva_limit_frame_group.frame_plan_guid == model.frame_plan_guid) && (!model.group_guid.HasValue || m_eva_limit_frame_group.group_guid == model.group_guid) - orderby fk_eva_evaluation_groupResult2.code + orderby fk_eva_evaluation_groupResult2.code select new eva_limit_frame_groupViewModel() { id = m_eva_limit_frame_group.id, @@ -135,6 +141,8 @@ namespace TodoAPI2.Models 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.thegroup, + emp_qty = (from x in group_count where x.gid == m_eva_limit_frame_group.id select x.emp).FirstOrDefault(), + isActive = m_eva_limit_frame_group.isActive, Created = m_eva_limit_frame_group.created, Updated = m_eva_limit_frame_group.updated diff --git a/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs b/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs index d2a548b..371172c 100644 --- a/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs +++ b/Models/eva_limit_frame_group/eva_limit_frame_groupViewModel.cs @@ -31,6 +31,8 @@ namespace TodoAPI2.Models public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; } public string group_guid_eva_evaluation_group_code { get; set; } + public int? emp_qty { get; set; } + public string remark_formatted { get { 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 index 0a4cf40..2a1ee1e 100644 --- a/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml +++ b/Views/vw_limit_frame_planView/vw_limit_frame_plan_d.cshtml @@ -44,12 +44,13 @@ +
+
-
บันทึกข้อมูล วงเงินที่ใช้ในการเลื่อนเงินเดือน
+
วงเงินที่ใช้ในการเลื่อนเงินเดือนของพนักงานเนติบัณฑิตยสภา ของแต่ละกอง/ส่วนงาน
-
@@ -57,7 +58,7 @@
- +
@@ -76,16 +77,10 @@
+
-
- -
- -
-
วงเงินที่ใช้ในการเลื่อนเงินเดือนของแต่ละกอง/ส่วนงาน
- 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 77c2c6f..b86be55 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 @@ -158,6 +158,7 @@ function eva_limit_frame_group_GoDelete(a) { var eva_limit_frame_groupTableV; var eva_limit_frame_group_setupTable = function (result) { + let num_row = 1; let sum_total_salary = 0; let sum_total_salary_limit = 0; @@ -179,7 +180,6 @@ var eva_limit_frame_group_setupTable = function (result) { obj_result.total_salary_limit = currency_total_salary_limit; obj_result.total_salary_limit_rounded = currency_total_salary_limit_rounded; obj_result.num_row = num_row; - obj_result.emp_qty = 0; sum_emp_qty += obj_result.emp_qty; num_row++;