แก้ไขปัญหา จอยข้อมูลไม่เจอ
This commit is contained in:
@@ -519,11 +519,11 @@ namespace TodoAPI2.Models
|
||||
model.decimal_limit_quota = Convert.ToDecimal(model.limit_quota);
|
||||
|
||||
var postponement_data = (from postponement in _repository.Context.eva_adjust_postponement
|
||||
join create_evaluation in _repository.Context.eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id
|
||||
//join create_evaluation in _repository.Context.eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id
|
||||
where postponement.id == model.quota_id
|
||||
select new
|
||||
{
|
||||
create_evaluation.performance_plan_id,
|
||||
//create_evaluation.performance_plan_id,
|
||||
postponement.fiscal_year,
|
||||
postponement.theDate,
|
||||
postponement.limit_frame,
|
||||
@@ -532,28 +532,23 @@ namespace TodoAPI2.Models
|
||||
|
||||
if(postponement_data != null)
|
||||
{
|
||||
var plan_id = postponement_data.performance_plan_id;
|
||||
|
||||
if(plan_id == null)
|
||||
{
|
||||
plan_id = (from plan_in_db in _repository.Context.eva_performance_plan
|
||||
var plan_id = (from plan_in_db in _repository.Context.eva_performance_plan
|
||||
where plan_in_db.fiscal_year == postponement_data.fiscal_year
|
||||
&& plan_in_db.theTime == plan_in_db.theTime
|
||||
select plan_in_db.id).FirstOrDefault();
|
||||
}
|
||||
|
||||
if (plan_id.HasValue)
|
||||
{
|
||||
var plan = (from eva_p_p in _repository.Context.eva_performance_plan
|
||||
where eva_p_p.id == plan_id
|
||||
select eva_p_p).FirstOrDefault();
|
||||
|
||||
if(plan != null)
|
||||
{
|
||||
var start_plan = (from s in _repository.Context.eva_performance_plan_detail
|
||||
where s.performance_plan_id == postponement_data.performance_plan_id
|
||||
where s.performance_plan_id == plan_id
|
||||
select s.start_date).Min();
|
||||
|
||||
var end_plan = (from s in _repository.Context.eva_performance_plan_detail
|
||||
where s.performance_plan_id == postponement_data.performance_plan_id
|
||||
where s.performance_plan_id == plan_id
|
||||
select s.end_date).Max();
|
||||
|
||||
model.theTime = plan.theTime;
|
||||
|
||||
Reference in New Issue
Block a user