ปรับปรุงสิทธิการมองเห็นต่างๆ

This commit is contained in:
Nakorn Rientrakrunchai
2020-03-01 17:17:43 +07:00
parent c65c179e85
commit f8f46bb346
29 changed files with 448 additions and 696 deletions

View File

@@ -156,6 +156,15 @@ namespace TodoAPI2.Models
public eva_evaluation_achievement_processViewModel Update(int id, eva_evaluation_achievement_processInputModel model)
{
var current_detail = (from i in _repository.Context.eva_create_evaluation_detail
where i.id == model.create_evaluation_detail_id
select i).FirstOrDefault();
if (current_detail.status_chief == "Y")
{
throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้");
}
var existingEntity = _repository.Get(id);
if (existingEntity != null)
{
@@ -186,6 +195,16 @@ namespace TodoAPI2.Models
if (i.active_mode == "1" && i.id.HasValue) // update
{
var existingEntity = _repository.Get(i.id.Value);
var current_detail = (from k in _repository.Context.eva_create_evaluation_detail
where k.id == existingEntity.create_evaluation_detail_id
select k).FirstOrDefault();
if (current_detail.status_chief == "Y")
{
throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้");
}
if (existingEntity != null)
{
//existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id;