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 527eaca..b26d6b1 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 @@ -56,10 +56,39 @@ namespace TodoAPI2.Models #region Public Functions #region Query Functions + private DateTime? getPlanStart(Guid? plan_id) + { + var start = (from i in _repository.Context.eva_performance_plan_detail + where i.performance_plan_id == plan_id + select i.start_date).Min(); + return start; + } + + private DateTime? getPlanEnd(Guid? plan_id) + { + var end = (from i in _repository.Context.eva_performance_plan_detail + where i.performance_plan_id == plan_id + select i.end_date).Max(); + return end; + } + public eva_create_evaluation_detail_processWithSelectionViewModel Get(int id, int? emp_id, string path) { var allemp = emp.GetListByemployee_type(null, null); + var plan_id = (from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail + + join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_process.create_evaluation_id equals fk_eva_create_evaluation10.id + into eva_create_evaluationResult10 + from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty() + + where m_eva_create_evaluation_detail_process.id == id + + select fk_eva_create_evaluationResult10.performance_plan_id).FirstOrDefault(); + + var start_date = getPlanStart(plan_id); + var end_date = getPlanEnd(plan_id); + var data = ( from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail @@ -122,6 +151,9 @@ namespace TodoAPI2.Models remark_hrm_work_record = fk_external_employee.remark_hrm_work_record, + start_date = start_date, + end_date = end_date, + isActive = m_eva_create_evaluation_detail_process.isActive, Created = m_eva_create_evaluation_detail_process.created, Updated = m_eva_create_evaluation_detail_process.updated 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 3d0e224..bcfcfdb 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 @@ -15,5 +15,8 @@ namespace TodoAPI2.Models public decimal? create_evaluation_score2 { get; set; } + public DateTime? start_date { get; set; } + + public DateTime? end_date { get; set; } } -} \ No newline at end of file +} diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml index bc5560a..beaa529 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml @@ -86,16 +86,16 @@ ข้อมูลการลา ณ วันที่
- +
ถึง
- +
- +
diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index fedf4c9..8519c1e 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -135,16 +135,16 @@ ข้อมูลการลา ณ วันที่
- +
ถึง
- +
- +
diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js index 7102a89..9de1adc 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js @@ -27,6 +27,13 @@ function cal_level(){ var item_level_score; function eva_create_evaluation_detail_process_FeedDataToForm(data) { + +//console.log(data); + +$("#date_from").val(formatDate(data.start_date)); +$("#date_to").val(formatDate(data.end_date)); + + $("#eva_create_evaluation_detail_process_id").val(data.id); $("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id); $("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round); @@ -45,6 +52,8 @@ $("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.sea $("#remark_hrm_work_record").val(data.remark_hrm_work_record); +searchVacation(); + //console.log(data); item_level_score = data.item_level_score; diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js index 2d2afd7..c4778a4 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js @@ -28,6 +28,9 @@ var item_level_score; function eva_create_evaluation_detail_process_FeedDataToForm(data) { +$("#date_from").val(formatDate(data.start_date)); +$("#date_to").val(formatDate(data.end_date)); + $("#eva_create_evaluation_detail_process_id").val(data.id); $("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id); $("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round); @@ -46,6 +49,8 @@ $("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.sea $("#remark_hrm_work_record").val(data.remark_hrm_work_record); +searchVacation(); + item_level_score = data.item_level_score; $("#w1").text(data.create_evaluation_score1.toFixed(2)+"%");