ปรับปรุงสิทธิการมองเห็นต่างๆ
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user