รวม code แก้ Change Request จากทีม

This commit is contained in:
Nakorn Rientrakrunchai
2020-07-26 17:58:22 +07:00
parent 565fa89be2
commit a76f746961
6 changed files with 56 additions and 7 deletions

View File

@@ -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

View File

@@ -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; }
}
}
}

View File

@@ -86,16 +86,16 @@
ข้อมูลการลา ณ วันที่
</div>
<div class="col-md-3">
<input class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
<input disabled class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
</div>
<div class="col-md-1">
ถึง
</div>
<div class="col-md-3">
<input class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
<input disabled class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff;">ค้นหา</button>
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff; display:none;">ค้นหา</button>
</div>
</div>
<div class="row">

View File

@@ -135,16 +135,16 @@
ข้อมูลการลา ณ วันที่
</div>
<div class="col-md-3">
<input class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
<input disabled class="form-control" type="text" id="date_from" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เริ่ม" />
</div>
<div class="col-md-1">
ถึง
</div>
<div class="col-md-3">
<input class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
<input disabled class="form-control" type="text" id="date_to" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่สิ้นสุด" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff;">ค้นหา</button>
<button type="button" class="btn btn-outline" onclick="javascript:searchVacation();" style="background-color: #fff; display:none;">ค้นหา</button>
</div>
</div>

View File

@@ -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;

View File

@@ -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)+"%");