แก้ไข OP 2651

This commit is contained in:
Nakorn Rientrakrunchai
2020-07-21 16:08:46 +07:00
parent 13dc865ad1
commit 764cd3c398
13 changed files with 153 additions and 79 deletions

View File

@@ -202,10 +202,14 @@ namespace TodoAPI2.Models
where k.id == existingEntity.create_evaluation_detail_id
select k).FirstOrDefault();
var current_eva = (from k in _repository.Context.eva_create_evaluation
where k.id == current_detail.create_evaluation_id
select k).FirstOrDefault();
if (current_detail.status_chief == "Y")
{
throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้");
}
}
if (existingEntity != null)
{
@@ -214,8 +218,18 @@ namespace TodoAPI2.Models
//existingEntity.weight = i.weight;
existingEntity.score = i.score;
existingEntity.sumary = i.sumary;
existingEntity.score2 = i.score;
existingEntity.sumary2 = i.sumary;
if(current_eva.employee_id == current_detail.chief) // หัวหน้าและผู้ประเมินสูงสุด เป็นคนคนเดียวกัน
{
existingEntity.score2 = i.score;
existingEntity.sumary2 = i.sumary;
}
//else // เป็นคนละคน (แต่ดึงค่า default ไปใส่ให้)
//{
// existingEntity.score2 = i.score;
// existingEntity.sumary2 = i.sumary;
//}
existingEntity.target_score1 = i.target_score1;
existingEntity.target_score2 = i.target_score2;
existingEntity.target_score3 = i.target_score3;