ปรับปรุงตามที่ได้รับแจ้ง
This commit is contained in:
@@ -42,6 +42,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string search_employee_fullname { get; set; }
|
||||
|
||||
public string evaluation_round_search { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string search_employee_fullname { get; set; }
|
||||
|
||||
public string evaluation_round_search { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +145,22 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var item = Get(id);
|
||||
var i = item;
|
||||
|
||||
var option_1 = new external_linkageViewModel();
|
||||
option_1.id_guid = Guid.Empty;
|
||||
option_1.external_name = "ทั้งหมด";
|
||||
var option_all = new List<external_linkageViewModel>();
|
||||
option_all.Add(option_1);
|
||||
|
||||
i.item_org_id = ext.GetDepartmentData();
|
||||
|
||||
var allround = (from y in _repository.Context.eva_create_evaluation
|
||||
select y.performance_plan_id).ToList();
|
||||
i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan
|
||||
where allround.Contains(x.id)
|
||||
orderby x.fiscal_year descending, x.theTime descending
|
||||
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
|
||||
)).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -155,6 +169,19 @@ namespace TodoAPI2.Models
|
||||
var i = new eva_create_evaluation_detail_agreementWithSelectionViewModel();
|
||||
i.item_org_id = ext.GetDepartmentData();
|
||||
|
||||
var option_1 = new external_linkageViewModel();
|
||||
option_1.id_guid = Guid.Empty;
|
||||
option_1.external_name = "ทั้งหมด";
|
||||
var option_all = new List<external_linkageViewModel>();
|
||||
option_all.Add(option_1);
|
||||
|
||||
var allround = (from y in _repository.Context.eva_create_evaluation
|
||||
select y.performance_plan_id).ToList();
|
||||
i.item_evaluation_round_search = option_all.Union((from x in _repository.Context.eva_performance_plan
|
||||
where allround.Contains(x.id)
|
||||
orderby x.fiscal_year descending, x.theTime descending
|
||||
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
|
||||
)).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -168,6 +195,17 @@ namespace TodoAPI2.Models
|
||||
|
||||
public List<eva_create_evaluation_detail_agreementViewModel> GetListBySearch(eva_create_evaluation_detail_agreementSearchModel model, int? emp_id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.evaluation_round_search))
|
||||
{
|
||||
model.evaluation_round_search = (from x in _repository.Context.eva_performance_plan
|
||||
orderby x.fiscal_year descending, x.theTime descending
|
||||
select new external_linkageViewModel { id_guid = x.id, external_name = checkNull(x.theTime) + "/" + checkNull(x.fiscal_year) }
|
||||
).FirstOrDefault().id_guid.ToString();
|
||||
}
|
||||
else if (Guid.Parse(model.evaluation_round_search) == Guid.Empty)
|
||||
{
|
||||
model.evaluation_round_search = null;
|
||||
}
|
||||
|
||||
var allemp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
@@ -196,6 +234,7 @@ namespace TodoAPI2.Models
|
||||
&& (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code))
|
||||
&& (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname))
|
||||
&& m_eva_create_evaluation_detail_agreement.employee_id == emp_id
|
||||
&& (string.IsNullOrEmpty(model.evaluation_round_search) || fk_planResult.id == Guid.Parse(model.evaluation_round_search))
|
||||
|
||||
orderby m_eva_create_evaluation_detail_agreement.created descending
|
||||
select new eva_create_evaluation_detail_agreementViewModel()
|
||||
|
||||
@@ -89,6 +89,8 @@ namespace TodoAPI2.Models
|
||||
return "";
|
||||
}
|
||||
|
||||
public string evaluation_round_search { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace TodoAPI2.Models
|
||||
public class eva_create_evaluation_detail_agreementWithSelectionViewModel: eva_create_evaluation_detail_agreementViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_org_id { get; set; }
|
||||
|
||||
public List<external_linkageViewModel> item_evaluation_round_search { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user