From 646bf3e249c972c5001cf585326fb1016dd4a1b1 Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Mon, 13 Sep 2021 16:52:16 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=20=E0=B8=97=E0=B8=B1=E0=B9=89=E0=B8=87=E0=B8=AB?= =?UTF-8?q?=E0=B8=A1=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...reate_evaluation_detail_firstdocService.cs | 22 +++++++++-- ...create_evaluation_detail_processService.cs | 38 ++++++++++++++++--- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs index 50c10e8..a758824 100644 --- a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs @@ -229,6 +229,11 @@ namespace TodoAPI2.Models var alldep = (from x in emp.GetDeptMapping() where x.id == dep || x.id2 == dep select x.id); + var option_1 = new external_linkageViewModel(); + option_1.id_guid = Guid.Empty; + option_1.external_name = "ทั้งหมด"; + var option_all = new List(); + option_all.Add(option_1); var alleva = (from x in _repository.Context.eva_create_evaluation join y in _repository.Context.eva_create_evaluation_detail on x.id equals y.create_evaluation_id where x.employee_id == emp_id @@ -247,10 +252,10 @@ namespace TodoAPI2.Models orderby x.fullname select new external_linkageViewModel { external_id = x.id, external_name = x.fullname } ).ToList(); - i.item_evaluation_round_search = (from x in _repository.Context.eva_performance_plan + i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan orderby x.fiscal_year descending, x.theTime descending select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } - ).ToList(); + )).ToList(); return i; } @@ -264,6 +269,11 @@ namespace TodoAPI2.Models var alldep = (from x in emp.GetDeptMapping() where x.id == dep || x.id2 == dep select x.id); + var option_1 = new external_linkageViewModel(); + option_1.id_guid = Guid.Empty; + option_1.external_name = "ทั้งหมด"; + var option_all = new List(); + option_all.Add(option_1); var alleva = (from x in _repository.Context.eva_create_evaluation join y in _repository.Context.eva_create_evaluation_detail on x.id equals y.create_evaluation_id where x.employee_id == emp_id @@ -282,10 +292,10 @@ namespace TodoAPI2.Models orderby x.fullname select new external_linkageViewModel { external_id = x.id, external_name = x.fullname } ).ToList(); - i.item_evaluation_round_search = (from x in _repository.Context.eva_performance_plan + i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan orderby x.fiscal_year descending, x.theTime descending select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } - ).ToList(); + )).ToList(); return i; } @@ -321,6 +331,10 @@ namespace TodoAPI2.Models select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } ).FirstOrDefault().id_guid.ToString(); } + else if (Guid.Parse(model.evaluation_round_search) == Guid.Empty) + { + model.evaluation_round_search = null; + } var allemp = emp.GetListByemployee_type(null, null); var dept = ext.GetDepartmentData(); diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs index e6cd364..69b3b47 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs @@ -225,6 +225,11 @@ namespace TodoAPI2.Models var alldep = (from x in emp.GetDeptMapping() where x.id == dep || x.id2 == dep select x.id); + var option_1 = new external_linkageViewModel(); + option_1.id_guid = Guid.Empty; + option_1.external_name = "ทั้งหมด"; + var option_all = new List(); + option_all.Add(option_1); var alleva = (from x in _repository.Context.eva_create_evaluation join y in _repository.Context.eva_create_evaluation_detail on x.id equals y.create_evaluation_id where x.employee_id == emp_id @@ -245,10 +250,16 @@ namespace TodoAPI2.Models && alleva.Contains(x.id) orderby x.fullname select x).ToList(); - item.item_evaluation_round_search = (from x in _repository.Context.eva_performance_plan - orderby x.fiscal_year descending, x.theTime descending - select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } - ).ToList(); + + var allround = (from y in _repository.Context.eva_create_evaluation + select y.performance_plan_id).ToList(); + + item.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan + where allround.Contains(x.id) + orderby x.fiscal_year descending, x.theTime descending + select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } + )).ToList(); + return item; } @@ -261,6 +272,12 @@ namespace TodoAPI2.Models var alldep = (from x in emp.GetDeptMapping() where x.id == dep || x.id2 == dep select x.id); + var option_1 = new external_linkageViewModel(); + option_1.id_guid = Guid.Empty; + option_1.external_name = "ทั้งหมด"; + var option_all = new List(); + option_all.Add(option_1); + var alleva = (from x in _repository.Context.eva_create_evaluation join y in _repository.Context.eva_create_evaluation_detail on x.id equals y.create_evaluation_id where x.employee_id == emp_id @@ -278,10 +295,15 @@ namespace TodoAPI2.Models && alleva.Contains(x.id) orderby x.fullname select x).ToList(); - i.item_evaluation_round_search = (from x in _repository.Context.eva_performance_plan + + var allround = (from y in _repository.Context.eva_create_evaluation + select y.performance_plan_id).ToList(); + + i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan + where allround.Contains(x.id) orderby x.fiscal_year descending, x.theTime descending select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } - ).ToList(); + )).ToList(); return i; } @@ -328,6 +350,10 @@ namespace TodoAPI2.Models select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) } ).FirstOrDefault().id_guid.ToString(); } + else if(Guid.Parse(model.evaluation_round_search) == Guid.Empty) + { + model.evaluation_round_search = null; + } var allemp = emp.GetListByemployee_type(null, null); var all_org_id = from i in ext.GetAllChildInDep(model.org_id) select i.external_id;