รวม code แก้ Change Request จากทีม
This commit is contained in:
@@ -56,10 +56,39 @@ namespace TodoAPI2.Models
|
|||||||
#region Public Functions
|
#region Public Functions
|
||||||
#region Query 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)
|
public eva_create_evaluation_detail_processWithSelectionViewModel Get(int id, int? emp_id, string path)
|
||||||
{
|
{
|
||||||
var allemp = emp.GetListByemployee_type(null, null);
|
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 = (
|
var data = (
|
||||||
from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail
|
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,
|
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,
|
isActive = m_eva_create_evaluation_detail_process.isActive,
|
||||||
Created = m_eva_create_evaluation_detail_process.created,
|
Created = m_eva_create_evaluation_detail_process.created,
|
||||||
Updated = m_eva_create_evaluation_detail_process.updated
|
Updated = m_eva_create_evaluation_detail_process.updated
|
||||||
|
|||||||
@@ -15,5 +15,8 @@ namespace TodoAPI2.Models
|
|||||||
|
|
||||||
public decimal? create_evaluation_score2 { get; set; }
|
public decimal? create_evaluation_score2 { get; set; }
|
||||||
|
|
||||||
|
public DateTime? start_date { get; set; }
|
||||||
|
|
||||||
|
public DateTime? end_date { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,16 +86,16 @@
|
|||||||
ข้อมูลการลา ณ วันที่
|
ข้อมูลการลา ณ วันที่
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<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>
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
ถึง
|
ถึง
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<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>
|
||||||
<div class="col-md-2">
|
<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>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -135,16 +135,16 @@
|
|||||||
ข้อมูลการลา ณ วันที่
|
ข้อมูลการลา ณ วันที่
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<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>
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
ถึง
|
ถึง
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<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>
|
||||||
<div class="col-md-2">
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ function cal_level(){
|
|||||||
var item_level_score;
|
var item_level_score;
|
||||||
|
|
||||||
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
|
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_id").val(data.id);
|
||||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
$("#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);
|
$("#remark_hrm_work_record").val(data.remark_hrm_work_record);
|
||||||
|
|
||||||
|
searchVacation();
|
||||||
|
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
item_level_score = data.item_level_score;
|
item_level_score = data.item_level_score;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ var item_level_score;
|
|||||||
|
|
||||||
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
|
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_id").val(data.id);
|
||||||
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
$("#eva_create_evaluation_detail_process_employee_id").val(data.employee_id);
|
||||||
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
|
$("#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);
|
$("#remark_hrm_work_record").val(data.remark_hrm_work_record);
|
||||||
|
|
||||||
|
searchVacation();
|
||||||
|
|
||||||
item_level_score = data.item_level_score;
|
item_level_score = data.item_level_score;
|
||||||
|
|
||||||
$("#w1").text(data.create_evaluation_score1.toFixed(2)+"%");
|
$("#w1").text(data.create_evaluation_score1.toFixed(2)+"%");
|
||||||
|
|||||||
Reference in New Issue
Block a user