ปรับปรุง report
This commit is contained in:
@@ -51,6 +51,31 @@ namespace TodoAPI2.Models
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public string GetDisplayText(int? round_id)
|
||||
{
|
||||
var postponement = (from i in _repository.Context.eva_adjust_postponement
|
||||
where i.id == round_id
|
||||
select i).FirstOrDefault();
|
||||
if(postponement != null)
|
||||
{
|
||||
var plan = (from i in _repository.Context.eva_performance_plan
|
||||
where i.fiscal_year == postponement.fiscal_year
|
||||
&& i.theTime == postponement.theRound
|
||||
select i).FirstOrDefault();
|
||||
if(plan != null)
|
||||
{
|
||||
var start = (from i in _repository.Context.eva_performance_plan_detail
|
||||
where i.performance_plan_id == plan.id
|
||||
select i.start_date).Min();
|
||||
var end = (from i in _repository.Context.eva_performance_plan_detail
|
||||
where i.performance_plan_id == plan.id
|
||||
select i.end_date).Max();
|
||||
return $"รอบที่ {postponement.theRound} ปี {postponement.fiscal_year} ({MyHelper.GetDateStringForReport(start)} - {MyHelper.GetDateStringForReport(end)})";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user