diff --git a/EXCEL/eva_adjust_postponement@eva_adjust_postponement_quota.xlsx b/EXCEL/eva_adjust_postponement@eva_adjust_postponement_quota.xlsx index d4412c0..36a6d5d 100644 Binary files a/EXCEL/eva_adjust_postponement@eva_adjust_postponement_quota.xlsx and b/EXCEL/eva_adjust_postponement@eva_adjust_postponement_quota.xlsx differ diff --git a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_agreement.xlsx b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_agreement.xlsx index 304c55f..e41a31e 100644 Binary files a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_agreement.xlsx and b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_agreement.xlsx differ diff --git a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaInputModel.cs b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaInputModel.cs index 460a501..9a35530 100644 --- a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaInputModel.cs +++ b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaInputModel.cs @@ -32,6 +32,10 @@ namespace TodoAPI2.Models public decimal? limit { get; set; } + public int? fiscal_year_search { get; set; } + + public int? theRound_search { get; set; } + public string active_mode { get; set; } public List adjust_postponement_detail_quota_02_model; diff --git a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaSearchModel.cs b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaSearchModel.cs index 6e148cc..0ec17d2 100644 --- a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaSearchModel.cs +++ b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaSearchModel.cs @@ -20,6 +20,9 @@ namespace TodoAPI2.Models public int? theRound { get; set; } + public int? fiscal_year_search { get; set; } + + public int? theRound_search { get; set; } } } diff --git a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs index 148f28e..3a64728 100644 --- a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs +++ b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs @@ -77,6 +77,13 @@ namespace TodoAPI2.Models var all_emp = emp.GetListByemployee_type(null, null); i.item_managed_by = all_emp.ToList(); + i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement + select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() } + ).Distinct().OrderByDescending(x => x.external_id).ToList(); + i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement + select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() } + ).Distinct().OrderByDescending(x => x.external_id).ToList(); + return i; } public eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem() @@ -85,6 +92,13 @@ namespace TodoAPI2.Models var all_emp = emp.GetListByemployee_type(null, null); i.item_managed_by = all_emp.ToList(); + i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement + select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() } + ).Distinct().OrderByDescending(x => x.external_id).ToList(); + i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement + select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() } + ).Distinct().OrderByDescending(x => x.external_id).ToList(); + return i; } @@ -112,6 +126,9 @@ namespace TodoAPI2.Models && (m_eva_adjust_postponement_quota.theRound == model.theRound || !model.theRound.HasValue) && !m_eva_adjust_postponement_quota.create_evaluation_id.HasValue + && (!model.fiscal_year_search.HasValue || m_eva_adjust_postponement_quota.fiscal_year == model.fiscal_year_search) + && (!model.theRound_search.HasValue || m_eva_adjust_postponement_quota.theRound == model.theRound_search) + orderby m_eva_adjust_postponement_quota.created descending select new eva_adjust_postponement_quotaViewModel() { diff --git a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaWithSelectionViewModel.cs b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaWithSelectionViewModel.cs index 877e400..97c4e84 100644 --- a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaWithSelectionViewModel.cs +++ b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaWithSelectionViewModel.cs @@ -8,6 +8,7 @@ namespace TodoAPI2.Models public class eva_adjust_postponement_quotaWithSelectionViewModel: eva_adjust_postponement_quotaViewModel { public List item_managed_by { get; set; } - + public List item_fiscal_year_search { get; set; } + public List item_theRound_search { get; set; } } } \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementInputModel.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementInputModel.cs index 8e3f88b..088134f 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementInputModel.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementInputModel.cs @@ -42,6 +42,8 @@ namespace TodoAPI2.Models public string search_employee_fullname { get; set; } + public string evaluation_round_search { get; set; } + public string active_mode { get; set; } } } diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementSearchModel.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementSearchModel.cs index 1817ca5..223722d 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementSearchModel.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementSearchModel.cs @@ -22,6 +22,8 @@ namespace TodoAPI2.Models public string search_employee_fullname { get; set; } + public string evaluation_round_search { get; set; } + } } diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs index b74ad13..17d488b 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs @@ -145,8 +145,22 @@ namespace TodoAPI2.Models { var item = Get(id); var i = item; + + 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); + i.item_org_id = ext.GetDepartmentData(); + 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(); return i; } @@ -155,6 +169,19 @@ namespace TodoAPI2.Models var i = new eva_create_evaluation_detail_agreementWithSelectionViewModel(); i.item_org_id = ext.GetDepartmentData(); + 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 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(); return i; } @@ -168,6 +195,17 @@ namespace TodoAPI2.Models public List GetListBySearch(eva_create_evaluation_detail_agreementSearchModel 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(); + } + else if (Guid.Parse(model.evaluation_round_search) == Guid.Empty) + { + model.evaluation_round_search = null; + } var allemp = emp.GetListByemployee_type(null, null); @@ -196,6 +234,7 @@ namespace TodoAPI2.Models && (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)) && m_eva_create_evaluation_detail_agreement.employee_id == emp_id + && (string.IsNullOrEmpty(model.evaluation_round_search) || fk_planResult.id == Guid.Parse(model.evaluation_round_search)) orderby m_eva_create_evaluation_detail_agreement.created descending select new eva_create_evaluation_detail_agreementViewModel() diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs index b53171c..81a8400 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs @@ -89,6 +89,8 @@ namespace TodoAPI2.Models return ""; } + public string evaluation_round_search { get; set; } + } } diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementWithSelectionViewModel.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementWithSelectionViewModel.cs index 769d172..1e2c790 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementWithSelectionViewModel.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementWithSelectionViewModel.cs @@ -8,6 +8,6 @@ namespace TodoAPI2.Models public class eva_create_evaluation_detail_agreementWithSelectionViewModel: eva_create_evaluation_detail_agreementViewModel { public List item_org_id { get; set; } - + public List item_evaluation_round_search { get; set; } } } \ No newline at end of file diff --git a/Views/eva_adjust_postponement_normalView/eva_adjust_postponement_normal.cshtml b/Views/eva_adjust_postponement_normalView/eva_adjust_postponement_normal.cshtml index 2cd05d9..86d2bea 100644 --- a/Views/eva_adjust_postponement_normalView/eva_adjust_postponement_normal.cshtml +++ b/Views/eva_adjust_postponement_normalView/eva_adjust_postponement_normal.cshtml @@ -94,7 +94,7 @@ -
+ diff --git a/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota.cshtml b/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota.cshtml index 5d68f09..9e4adc6 100644 --- a/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota.cshtml +++ b/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota.cshtml @@ -82,16 +82,26 @@
-
+ -
+ +
+ + +
+ +
+ + +
+

diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement.cshtml index ad6b317..5e839c1 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement.cshtml @@ -28,19 +28,22 @@
- -
+ + +
+ + -
+ -
+ diff --git a/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota.js b/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota.js index fa31195..e8fb8a4 100644 --- a/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota.js +++ b/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota.js @@ -7,6 +7,8 @@ function eva_adjust_postponement_quota_GetSearchParameter() { var eva_adjust_postponement_quotaSearchObject = new Object(); eva_adjust_postponement_quotaSearchObject.fiscal_year = $("#s_eva_adjust_postponement_quota_fiscal_year").val(); eva_adjust_postponement_quotaSearchObject.theRound = $("#s_eva_adjust_postponement_quota_theRound").val(); + eva_adjust_postponement_quotaSearchObject.fiscal_year_search = $("#s_eva_adjust_postponement_quota_fiscal_year_search").val(); + eva_adjust_postponement_quotaSearchObject.theRound_search = $("#s_eva_adjust_postponement_quota_theRound_search").val(); return eva_adjust_postponement_quotaSearchObject; } @@ -15,6 +17,9 @@ function eva_adjust_postponement_quota_FeedDataToSearchForm(data) { $("#s_eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year); $("#s_eva_adjust_postponement_quota_theRound").val(data.theRound); + DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_quota_fiscal_year_search"), data, "external_id", "external_name", "item_fiscal_year_search", data.fiscal_year_search); + DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_quota_theRound_search"), data, "external_id", "external_name", "item_theRound_search", data.theRound_search); + } //================= Form Data Customizaiton ========================================= diff --git a/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement.js b/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement.js index 7c7e298..7fb877d 100644 --- a/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement.js +++ b/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement.js @@ -9,6 +9,8 @@ function eva_create_evaluation_detail_agreement_GetSearchParameter() { eva_create_evaluation_detail_agreementSearchObject.org_id = $("#s_eva_create_evaluation_detail_agreement_org_id").val(); eva_create_evaluation_detail_agreementSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_agreement_search_employee_code").val(); eva_create_evaluation_detail_agreementSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val(); + eva_create_evaluation_detail_agreementSearchObject.evaluation_round_search = $("#s_eva_create_evaluation_detail_agreement_evaluation_round_search").val(); + return eva_create_evaluation_detail_agreementSearchObject; } @@ -18,6 +20,7 @@ function eva_create_evaluation_detail_agreement_FeedDataToSearchForm(data) { DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id); $("#s_eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code); $("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname); + DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_evaluation_round_search"), data, "id_guid", "external_name", "item_evaluation_round_search", data.evaluation_round_search); }