ปรับปรุง การอนุมัติแบบข้อตกลง ของ ผอ
This commit is contained in:
@@ -150,12 +150,19 @@ namespace TodoAPI2.Models
|
||||
entity.id = Guid.NewGuid();
|
||||
entity.limit_frame_005 = (decimal?)0.05;
|
||||
|
||||
var start = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == model.plan_guid
|
||||
select n.start_date).Min();
|
||||
var end = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == model.plan_guid
|
||||
select n.end_date).Max();
|
||||
|
||||
var all_all_emp = emp.GetAllEmployee();
|
||||
var mapping_dept = emp.GetDeptMapping();
|
||||
var working_record = from i in emp.GetWorkingRecord() where
|
||||
model.executed_date.HasValue
|
||||
&& i.start_date <= model.executed_date
|
||||
&& i.end_date >= model.executed_date
|
||||
var working_record = from i in emp.GetWorkingRecord()
|
||||
where
|
||||
i.start_date >= start
|
||||
&& i.end_date <= end
|
||||
select i;
|
||||
var result_frame_group = new List<eva_limit_frame_groupEntity>();
|
||||
var result_frame_employee = new List<eva_limit_frame_employeeEntity>();
|
||||
@@ -242,13 +249,16 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var theemp = (from q in all_all_emp where q.id == y.employee_id select q).FirstOrDefault();
|
||||
var thedetail = (from r in working_record where r.employee_id == y.employee_id select r).FirstOrDefault();
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if(theemp != null && thedetail != null && help_at != null)
|
||||
if(thedetail != null)
|
||||
{
|
||||
if (x.remark != "") x.remark += "\n";
|
||||
x.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if (theemp != null && help_at != null)
|
||||
{
|
||||
if (x.remark != "") x.remark += "\n";
|
||||
x.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user