ปรับปรุง คนที่ได้สิทธิพิเศษ ให้ดูรายชื่อได้ทั้งเนติ
This commit is contained in:
@@ -74,6 +74,9 @@ namespace TodoAPI2.Models
|
||||
|
||||
public eva_create_evaluation_detail_processWithSelectionViewModel Get(int id, int? emp_id, string path)
|
||||
{
|
||||
object special_person = (from x in _repository.Context.eva_setup_permission
|
||||
select x.employee_id).ToArray();
|
||||
|
||||
var allemp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
var plan_id = (from m_eva_create_evaluation_detail_process in _repository.Context.eva_create_evaluation_detail
|
||||
@@ -181,14 +184,16 @@ namespace TodoAPI2.Models
|
||||
m_eva_create_evaluation_detail_process.eva_employee_id.HasValue ? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id,
|
||||
path),
|
||||
path,
|
||||
special_person),
|
||||
|
||||
role_desc = getRoleName(emp_id, m_eva_create_evaluation_detail_process.chief,
|
||||
m_eva_create_evaluation_detail_process.chief,
|
||||
m_eva_create_evaluation_detail_process.eva_employee_id.HasValue ? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id,
|
||||
path),
|
||||
path,
|
||||
special_person),
|
||||
|
||||
remark_hrm_work_record = fk_external_employee.remark_hrm_work_record
|
||||
+ GetWorkTimeText(fk_external_employee.packing_date, end_date),
|
||||
@@ -228,12 +233,15 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var item = Get(id, emp_id, path);
|
||||
|
||||
var special_person = (from x in _repository.Context.eva_setup_permission
|
||||
select x.employee_id).ToList();
|
||||
|
||||
var dep = (from x in emp.GetAllEmployee()
|
||||
where x.id == emp_id
|
||||
select x.department_id).FirstOrDefault();
|
||||
var alldep = (from x in emp.GetDeptMapping()
|
||||
where x.id == dep || x.id2 == dep
|
||||
select x.id);
|
||||
where x.id == dep || x.id2 == dep || special_person.Contains(emp_id)
|
||||
select x.id);
|
||||
var option_1 = new external_linkageViewModel();
|
||||
option_1.id_guid = Guid.Empty;
|
||||
option_1.external_name = "ทั้งหมด";
|
||||
@@ -248,6 +256,7 @@ namespace TodoAPI2.Models
|
||||
|| y.eva_employee_id == emp_id
|
||||
|| y.supervisor1_id == emp_id
|
||||
|| y.supervisor2_id == emp_id
|
||||
|| special_person.Contains(emp_id)
|
||||
select y.employee_id).ToList();
|
||||
|
||||
item.item_org_id = (from i in ext.GetDepartmentData() where alldep.Contains(i.id) select i).ToList();
|
||||
@@ -275,11 +284,14 @@ namespace TodoAPI2.Models
|
||||
public eva_create_evaluation_detail_processWithSelectionViewModel GetBlankItemWithEmp(int? emp_id)
|
||||
{
|
||||
var i = new eva_create_evaluation_detail_processWithSelectionViewModel();
|
||||
var special_person = (from x in _repository.Context.eva_setup_permission
|
||||
select x.employee_id).ToList();
|
||||
|
||||
var dep = (from x in emp.GetAllEmployee()
|
||||
where x.id == emp_id
|
||||
select x.department_id).FirstOrDefault();
|
||||
var alldep = (from x in emp.GetDeptMapping()
|
||||
where x.id == dep || x.id2 == dep
|
||||
where x.id == dep || x.id2 == dep || special_person.Contains(emp_id)
|
||||
select x.id);
|
||||
var option_1 = new external_linkageViewModel();
|
||||
option_1.id_guid = Guid.Empty;
|
||||
@@ -296,6 +308,7 @@ namespace TodoAPI2.Models
|
||||
|| y.eva_employee_id == emp_id
|
||||
|| y.supervisor1_id == emp_id
|
||||
|| y.supervisor2_id == emp_id
|
||||
|| special_person.Contains(emp_id)
|
||||
select y.employee_id).ToList();
|
||||
|
||||
i.item_org_id = (from q in ext.GetDepartmentData() where alldep.Contains(q.id) select q).ToList();
|
||||
@@ -352,6 +365,9 @@ namespace TodoAPI2.Models
|
||||
|
||||
public List<eva_create_evaluation_detail_processViewModel> GetListBySearch(eva_create_evaluation_detail_processSearchModel model, int? emp_id, string path)
|
||||
{
|
||||
object special_person = (from x in _repository.Context.eva_setup_permission
|
||||
select x.employee_id).ToArray();
|
||||
|
||||
if (string.IsNullOrEmpty(model.evaluation_round_search))
|
||||
{
|
||||
model.evaluation_round_search = (from x in _repository.Context.eva_performance_plan
|
||||
@@ -406,6 +422,7 @@ namespace TodoAPI2.Models
|
||||
|| (((m_eva_create_evaluation_detail_process.eva_employee_id.HasValue ? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id)).HasValue && emp_id == (m_eva_create_evaluation_detail_process.eva_employee_id.HasValue ? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id))
|
||||
|| ((m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id).HasValue && emp_id == (m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id))
|
||||
|| ((m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id).HasValue && emp_id == (m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id))
|
||||
|| ((int?[])special_person).Contains(emp_id)
|
||||
)
|
||||
&& (!model.employee_id.HasValue || m_eva_create_evaluation_detail_process.employee_id == model.employee_id)
|
||||
|
||||
@@ -450,7 +467,8 @@ namespace TodoAPI2.Models
|
||||
m_eva_create_evaluation_detail_process.eva_employee_id.HasValue? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor1_id.HasValue? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id,
|
||||
m_eva_create_evaluation_detail_process.status_chief
|
||||
m_eva_create_evaluation_detail_process.status_chief,
|
||||
special_person
|
||||
),
|
||||
|
||||
role_desc = getRoleName(emp_id, m_eva_create_evaluation_detail_process.chief,
|
||||
@@ -458,7 +476,8 @@ namespace TodoAPI2.Models
|
||||
m_eva_create_evaluation_detail_process.eva_employee_id.HasValue ? m_eva_create_evaluation_detail_process.eva_employee_id : fk_eva_create_evaluationResult10.employee_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id,
|
||||
m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id,
|
||||
path),
|
||||
path,
|
||||
special_person),
|
||||
|
||||
status_self_click_date = m_eva_create_evaluation_detail_process.status_self_click_date,
|
||||
status_chief_click_date = m_eva_create_evaluation_detail_process.status_chief_click_date,
|
||||
@@ -486,7 +505,7 @@ namespace TodoAPI2.Models
|
||||
return "";
|
||||
}
|
||||
|
||||
private string getRoleCode(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string path)
|
||||
private string getRoleCode(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string path, object special_person)
|
||||
{
|
||||
if ((emp_id == chief || emp_id == supervisor1) && chief == supervisor2 && path == "d2") return "2";
|
||||
else if (emp_id == chief) return "1";
|
||||
@@ -494,10 +513,11 @@ namespace TodoAPI2.Models
|
||||
else if (emp_id == supervisor2) return "2";
|
||||
else if (emp_id == supervisor1A) return "3";
|
||||
else if (emp_id == supervisor2A) return "4";
|
||||
if (((int?[])special_person).Contains(emp_id)) return "99";
|
||||
return "";
|
||||
}
|
||||
|
||||
private string getRoleCodeSearch(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string status_chief)
|
||||
private string getRoleCodeSearch(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string status_chief, object special_person)
|
||||
{
|
||||
if ((emp_id == chief || emp_id == supervisor1) && chief == supervisor2 && status_chief=="Y") return "2";
|
||||
else if (emp_id == chief) return "1";
|
||||
@@ -505,10 +525,11 @@ namespace TodoAPI2.Models
|
||||
else if (emp_id == supervisor2) return "2";
|
||||
else if (emp_id == supervisor1A) return "3";
|
||||
else if (emp_id == supervisor2A) return "4";
|
||||
if (((int?[])special_person).Contains(emp_id)) return "99";
|
||||
return "";
|
||||
}
|
||||
|
||||
private string getRoleName(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string path)
|
||||
private string getRoleName(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A, string path, object special_person)
|
||||
{
|
||||
if ((emp_id == chief || emp_id == supervisor1) && chief == supervisor2 && path == "d2") return "ผู้ประเมินสูงสุด";
|
||||
else if (emp_id == chief) return "ผู้ประเมิน";
|
||||
@@ -516,6 +537,7 @@ namespace TodoAPI2.Models
|
||||
else if (emp_id == supervisor2) return "ผู้ประเมินสูงสุด";
|
||||
else if (emp_id == supervisor1A) return "ผู้บังคับบัญชาเหนือขึ้นไป";
|
||||
else if (emp_id == supervisor2A) return "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)";
|
||||
if (((int?[])special_person).Contains(emp_id)) return "ผู้ตรวจสอบ";
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user