ปรับปรุงตามที่ได้รับแจ้ง
This commit is contained in:
@@ -32,6 +32,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public decimal? limit { get; set; }
|
||||
|
||||
public int? fiscal_year_search { get; set; }
|
||||
|
||||
public int? theRound_search { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
|
||||
public List<eva_adjust_postponement_detail_quota_02InputModel> adjust_postponement_detail_quota_02_model;
|
||||
|
||||
@@ -20,6 +20,9 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? theRound { get; set; }
|
||||
|
||||
public int? fiscal_year_search { get; set; }
|
||||
|
||||
public int? theRound_search { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,13 @@ namespace TodoAPI2.Models
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem()
|
||||
@@ -85,6 +92,13 @@ namespace TodoAPI2.Models
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -112,6 +126,9 @@ namespace TodoAPI2.Models
|
||||
&& (m_eva_adjust_postponement_quota.theRound == model.theRound || !model.theRound.HasValue)
|
||||
&& !m_eva_adjust_postponement_quota.create_evaluation_id.HasValue
|
||||
|
||||
&& (!model.fiscal_year_search.HasValue || m_eva_adjust_postponement_quota.fiscal_year == model.fiscal_year_search)
|
||||
&& (!model.theRound_search.HasValue || m_eva_adjust_postponement_quota.theRound == model.theRound_search)
|
||||
|
||||
orderby m_eva_adjust_postponement_quota.created descending
|
||||
select new eva_adjust_postponement_quotaViewModel()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace TodoAPI2.Models
|
||||
public class eva_adjust_postponement_quotaWithSelectionViewModel: eva_adjust_postponement_quotaViewModel
|
||||
{
|
||||
public List<external_employeeViewModel> item_managed_by { get; set; }
|
||||
|
||||
public List<external_linkageViewModel> item_fiscal_year_search { get; set; }
|
||||
public List<external_linkageViewModel> item_theRound_search { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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