ปรับปรุงสูตรการคำนวณต่างๆ

This commit is contained in:
Nakorn Rientrakrunchai
2020-08-16 16:20:47 +07:00
parent 9df224d42d
commit a1ff729171
14 changed files with 171 additions and 24 deletions

View File

@@ -149,7 +149,8 @@ namespace TodoAPI2.Models
fk_eva_create_evaluationResult10.supervisor1_id,
fk_eva_create_evaluationResult10.supervisor2_id, path),
remark_hrm_work_record = fk_external_employee.remark_hrm_work_record,
remark_hrm_work_record = fk_external_employee.remark_hrm_work_record
+ GetWorkTimeText(fk_external_employee.packing_date, end_date),
start_date = start_date,
end_date = end_date,
@@ -183,6 +184,19 @@ namespace TodoAPI2.Models
return i;
}
public string GetWorkTimeText(DateTime? startDate, DateTime? endDate)
{
if (!endDate.HasValue || !startDate.HasValue)
return "";
int monthsApart = 12 * (startDate.Value.Year - endDate.Value.Year) + startDate.Value.Month - endDate.Value.Month;
if (Math.Abs(monthsApart) < 4)
{
return "ปฏิบัติงานไม่ครบ 4 เดือน";
}
return "";
}
public List<eva_create_evaluation_detail_processViewModel> GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id, string path)
{
var model = new eva_create_evaluation_detail_processSearchModel();
@@ -193,7 +207,7 @@ namespace TodoAPI2.Models
public List<eva_create_evaluation_detail_processViewModel> GetListBySearch(eva_create_evaluation_detail_processSearchModel model, int? emp_id, string path)
{
var allemp = emp.GetListByemployee_type(null, null);
var all_org_id = from i in ext.GetAllChildInDep(model.org_id) select i.external_id;
var all_org_id = from i in ext.GetAllChildInDep(model.org_id) select i.external_id;
var data = (
from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail