diff --git a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx index 304c55f..a2869ed 100644 Binary files a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx and b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx differ diff --git a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_process.xlsx b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_process.xlsx index 4d36c65..f72c2c4 100644 Binary files a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_process.xlsx and b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_process.xlsx differ diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs index d511f95..cbc0a31 100644 --- a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs @@ -20,9 +20,9 @@ namespace TodoAPI2.Models public int? org_id { get; set; } - public string search_employee_code { get; set; } + public int? employee_id { get; set; } - public string search_employee_fullname { get; set; } + public string evaluation_round_search { get; set; } } } 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 214c03e..f1609ff 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 @@ -223,16 +223,30 @@ namespace TodoAPI2.Models var entity = Get(id, emp_id); var i = Mapper.Map(entity); i.item_org_id = ext.GetDepartmentData(); - - + i.item_employee_id = (from x in emp.GetAllEmployee() + where x.count_resigns == 0 && x.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา" + 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 + 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 i; } public eva_create_evaluation_detail_firstdocWithSelectionViewModel GetBlankItem() { var i = new eva_create_evaluation_detail_firstdocWithSelectionViewModel(); i.item_org_id = ext.GetDepartmentData(); - - + i.item_employee_id = (from x in emp.GetAllEmployee() + where x.count_resigns == 0 && x.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา" + 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 + 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 i; } @@ -245,6 +259,14 @@ namespace TodoAPI2.Models public List GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model, int? emp_id) { + if (string.IsNullOrEmpty(model.evaluation_round_search)) + { + model.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) } + ).FirstOrDefault().id_guid.ToString(); + } + var allemp = emp.GetListByemployee_type(null, null); var dept = ext.GetDepartmentData(); @@ -282,8 +304,8 @@ namespace TodoAPI2.Models where 1 == 1 && (m_eva_create_evaluation_detail_agreement.create_evaluation_id == model.create_evaluation_id || !model.create_evaluation_id.HasValue) && (fk_external_employee.department_id == model.org_id || !model.org_id.HasValue) - && (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code)) - && (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname)) + && (fk_external_employee.id == model.employee_id || !model.employee_id.HasValue) + && (string.IsNullOrEmpty(model.evaluation_round_search) || fk_planResult.id == Guid.Parse(model.evaluation_round_search)) && (m_eva_create_evaluation_detail_agreement.employee_id == emp_id || m_eva_create_evaluation_detail_agreement.chief == emp_id) orderby diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs index 23a1ef0..9460fd9 100644 --- a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs @@ -8,6 +8,8 @@ namespace TodoAPI2.Models public class eva_create_evaluation_detail_firstdocWithSelectionViewModel: eva_create_evaluation_detail_firstdocViewModel { public List item_org_id { get; set; } + public List item_employee_id { get; set; } + public List item_evaluation_round_search { get; set; } } } \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processSearchModel.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processSearchModel.cs index 780d1d1..d2ba40f 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processSearchModel.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processSearchModel.cs @@ -24,6 +24,8 @@ namespace TodoAPI2.Models public int? employee_id { get; set; } + public string evaluation_round_search { get; set; } + public string path { get; set; } } } 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 5712646..ae64442 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 @@ -222,7 +222,11 @@ namespace TodoAPI2.Models item.item_level_score = (from i in _repository.Context.eva_level_score orderby i.min_score select Mapper.Map(i)).ToList(); - item.item_employee_id = (from x in emp.GetAllEmployee() where x.count_resigns == 0 select x).ToList(); + item.item_employee_id = (from x in emp.GetAllEmployee() where x.count_resigns == 0 && x.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา" 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(); return item; } @@ -231,9 +235,10 @@ namespace TodoAPI2.Models var i = new eva_create_evaluation_detail_processWithSelectionViewModel(); i.item_org_id = ext.GetDepartmentData(); i.item_employee_id = (from x in emp.GetAllEmployee() where x.count_resigns == 0 && x.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา" select x).ToList(); - //i.item_level_score = (from j in _repository.Context.eva_level_score - // orderby j.min_score - // select Mapper.Map(i)).ToList(); + i.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(); return i; } @@ -260,6 +265,14 @@ namespace TodoAPI2.Models public List GetListBySearch(eva_create_evaluation_detail_processSearchModel model, int? emp_id, string path) { + if (string.IsNullOrEmpty(model.evaluation_round_search)) + { + model.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) } + ).FirstOrDefault().id_guid.ToString(); + } + var allemp = emp.GetListByemployee_type(null, null); var all_org_id = from i in ext.GetAllChildInDep(model.org_id) select i.external_id; @@ -295,6 +308,7 @@ namespace TodoAPI2.Models && (all_org_id.Contains(fk_external_employee.department_id) || !model.org_id.HasValue) && (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code)) && (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname)) + && (string.IsNullOrEmpty(model.evaluation_round_search) || fk_planResult.id == Guid.Parse(model.evaluation_round_search)) && emp_id.HasValue && ( (m_eva_create_evaluation_detail_process.chief.HasValue && emp_id == m_eva_create_evaluation_detail_process.chief) diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processWithSelectionViewModel.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processWithSelectionViewModel.cs index 6eab281..d270a2f 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processWithSelectionViewModel.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processWithSelectionViewModel.cs @@ -13,6 +13,8 @@ namespace TodoAPI2.Models public List item_employee_id { get; set; } + public List item_evaluation_round_search { get; set; } + public decimal? create_evaluation_score1 { get; set; } public decimal? create_evaluation_score2 { get; set; } diff --git a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml index 79a6996..c05b1fb 100644 --- a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml +++ b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml @@ -29,20 +29,19 @@
+
+ + +
+ +
+ + +
- -
- -
- - -
- -
- - +
@@ -81,6 +80,10 @@ eva_create_evaluation_detail_firstdoc_InitiateDataTable(); eva_create_evaluation_detail_firstdoc_InitialForm(); SetupValidationRemark("eva_create_evaluation_detail_firstdoc"); + + $("#s_eva_create_evaluation_detail_firstdoc_org_id").select2(); + $("#s_eva_create_evaluation_detail_firstdoc_employee_id").select2(); + $("#s_eva_create_evaluation_detail_firstdoc_evaluation_round_search").select2(); }); } diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process.cshtml index 091106b..b6f88fb 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process.cshtml @@ -26,16 +26,30 @@
-
+
+ + +
+ +
+ + +
+ +
-
- - +
+
+
+ + + + -
-
- -
-
@@ -86,6 +95,7 @@ SetupValidationRemark("eva_create_evaluation_detail_process"); $("#s_eva_create_evaluation_detail_process_org_id").select2(); $("#s_eva_create_evaluation_detail_process_employee_id").select2(); + $("#s_eva_create_evaluation_detail_process_evaluation_round_search").select2(); }); } 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 9e55a6b..73b2448 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 @@ -169,7 +169,7 @@
- +
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 2a1ee1e..2ef7524 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 @@ -75,12 +75,20 @@
+
+
+ +
+
+
+ + @@ -135,7 +143,7 @@
- +
diff --git a/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js b/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js index b010ca8..d92e46e 100644 --- a/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js +++ b/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js @@ -7,8 +7,8 @@ function eva_create_evaluation_detail_firstdoc_GetSearchParameter() { var eva_create_evaluation_detail_firstdocSearchObject = new Object(); eva_create_evaluation_detail_firstdocSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(); eva_create_evaluation_detail_firstdocSearchObject.org_id = $("#s_eva_create_evaluation_detail_firstdoc_org_id").val(); - eva_create_evaluation_detail_firstdocSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val(); - eva_create_evaluation_detail_firstdocSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(); + eva_create_evaluation_detail_firstdocSearchObject.employee_id = $("#s_eva_create_evaluation_detail_firstdoc_employee_id").val(); + eva_create_evaluation_detail_firstdocSearchObject.evaluation_round_search = $("#s_eva_create_evaluation_detail_firstdoc_evaluation_round_search").val(); return eva_create_evaluation_detail_firstdocSearchObject; } @@ -16,8 +16,8 @@ function eva_create_evaluation_detail_firstdoc_GetSearchParameter() { function eva_create_evaluation_detail_firstdoc_FeedDataToSearchForm(data) { $("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id); DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_firstdoc_org_id"), data, "id", "external_name", "item_org_id", data.org_id); - $("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val(data.search_employee_code); - $("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(data.search_employee_fullname); + DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_firstdoc_employee_id"), data, "external_id", "external_name", "item_employee_id", data.employee_id); + DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_firstdoc_evaluation_round_search"), data, "id_guid", "external_name", "item_evaluation_round_search", data.evaluation_round_search); } diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js index 5668881..4e7d138 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js @@ -10,6 +10,7 @@ function eva_create_evaluation_detail_process_GetSearchParameter() { eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val(); eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(); eva_create_evaluation_detail_processSearchObject.employee_id = $("#s_eva_create_evaluation_detail_process_employee_id").val(); + eva_create_evaluation_detail_processSearchObject.evaluation_round_search = $("#s_eva_create_evaluation_detail_process_evaluation_round_search").val(); eva_create_evaluation_detail_processSearchObject.path = "d"; @@ -22,7 +23,7 @@ function eva_create_evaluation_detail_process_FeedDataToSearchForm(data) { $("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code); $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname); DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id); - console.log(data.item_employee_id); + DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_evaluation_round_search"), data, "id_guid", "external_name", "item_evaluation_round_search", data.evaluation_round_search); } //================= Form Data Customizaiton =========================================