เตรียม UI รายงานแบบประเมิน
This commit is contained in:
@@ -139,7 +139,7 @@ namespace TodoAPI2.Models
|
||||
entity.id = GetNewPrimaryKey();
|
||||
|
||||
|
||||
|
||||
entity.SetAutoField(_repository.Context);
|
||||
var inserted = _repository.Insert(entity);
|
||||
|
||||
return Get(inserted.id);
|
||||
@@ -156,7 +156,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.start_date = model.start_date;
|
||||
existingEntity.end_date = model.end_date;
|
||||
|
||||
|
||||
existingEntity.SetAutoField(_repository.Context);
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
}
|
||||
@@ -228,5 +228,16 @@ namespace TodoAPI2.Models
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
public void RefreshAutoFieldOfAllData()
|
||||
{
|
||||
var all_items = from i in _repository.Context.eva_idp_plan
|
||||
select i;
|
||||
foreach (var item in all_items)
|
||||
{
|
||||
item.SetAutoField(_repository.Context);
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user