From e91666e9db6a8f34cf91aa2d9c642fa09d1a349c Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Fri, 27 Aug 2021 13:58: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=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B9=88=E0=B8=A5=E0=B8=B2=E0=B9=83=E0=B8=99?= =?UTF-8?q?=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiControllers/rep_eva_xControllers.cs | 6 +++--- .../eva_create_evaluation_detail_processService.cs | 12 +++++++++++- ...valuation_detail_processWithSelectionViewModel.cs | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ApiControllers/rep_eva_xControllers.cs b/ApiControllers/rep_eva_xControllers.cs index ca8990a..1e0f408 100644 --- a/ApiControllers/rep_eva_xControllers.cs +++ b/ApiControllers/rep_eva_xControllers.cs @@ -355,7 +355,7 @@ namespace TodoAPI2.Controllers if (i.main_dept != null) i.main_dept = i.main_dept.Replace("กอง",""); - i.leave_period = MyHelper.GetDateStringForReport(p.start_date) + " ถึง " + MyHelper.GetDateStringForReport(p.end_date); + i.leave_period = MyHelper.GetDateStringForReport(p.leave_start_date) + " ถึง " + MyHelper.GetDateStringForReport(p.leave_end_date); i.selected_round = p.selected_round; var context = _process.GetDataContext(); @@ -402,9 +402,9 @@ namespace TodoAPI2.Controllers i.w1 = p.create_evaluation_score1; i.w2 = p.create_evaluation_score2; - if(p.start_date.HasValue && p.end_date.HasValue) + if(p.leave_start_date.HasValue && p.leave_end_date.HasValue) { - var q = emp.GetLeaveOfEmployee(p.employee_id.Value, p.start_date, p.end_date); + var q = emp.GetLeaveOfEmployee(p.employee_id.Value, p.leave_start_date, p.leave_end_date); i.sum_day_sick_leave = q.sum_day_sick_leave; i.count_sick_leave = q.count_sick_leave; i.sum_day_personal_leave = q.sum_day_personal_leave; 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 836e64f..18607d3 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 @@ -89,6 +89,13 @@ namespace TodoAPI2.Models var start_date = getPlanStart(plan_id); var end_date = getPlanEnd(plan_id); + var plan = (from i in _repository.Context.eva_performance_plan + where i.id == plan_id + select i).FirstOrDefault(); + + var leave_start_date = plan.start_leave; + var leave_end_date = plan.end_leave; + var data = ( from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail @@ -199,7 +206,10 @@ namespace TodoAPI2.Models supervisor1A_position_level_text = fk_external_supervisor1A.position_level_text, supervisor2A_position_level_text = fk_external_supervisor2A.position_level_text, employee_position_level_text = fk_external_employee.position_level_text, - chief_position_level_text = fk_external_chief.position_level_text + chief_position_level_text = fk_external_chief.position_level_text, + + leave_start_date = leave_start_date, + leave_end_date = leave_end_date } ).ToList(); 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 0646ac7..6eab281 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 @@ -36,5 +36,8 @@ namespace TodoAPI2.Models public string employee_position_level_text { get; set; } public string chief_position_level_text { get; set; } + public DateTime? leave_start_date { get; set; } + + public DateTime? leave_end_date { get; set; } } }