This commit is contained in:
@@ -155,9 +155,11 @@ namespace AyaNova.Biz
|
||||
internal async Task<bool> ReplaceAsync(PickListTemplate template)
|
||||
{
|
||||
var o = await ct.PickListTemplate.FirstOrDefaultAsync(m => m.Id == (long)template.Id);
|
||||
bool bAdd = false;
|
||||
if (o == null)
|
||||
{
|
||||
o = new PickListTemplate();
|
||||
bAdd = true;
|
||||
}
|
||||
o.Id = (long)template.Id;
|
||||
o.Template = template.Template;
|
||||
@@ -166,6 +168,9 @@ namespace AyaNova.Biz
|
||||
Validate(o);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
if (bAdd)
|
||||
await ct.PickListTemplate.AddAsync(o);
|
||||
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log modification and save context
|
||||
|
||||
Reference in New Issue
Block a user