diff --git a/server/AyaNova/biz/DataListTemplateBiz.cs b/server/AyaNova/biz/DataListTemplateBiz.cs index f2a0dab7..1e7b7128 100644 --- a/server/AyaNova/biz/DataListTemplateBiz.cs +++ b/server/AyaNova/biz/DataListTemplateBiz.cs @@ -36,79 +36,10 @@ namespace AyaNova.Biz return new DataListTemplateBiz(ct, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.BizAdminFull); } - // //////////////////////////////////////////////////////////////////////////////////////////////// - // //EXISTS - // internal async Task ExistsAsync(long id) - // { - // return await ct.DataListTemplate.AnyAsync(e => e.Id == id); - // } - - // //////////////////////////////////////////////////////////////////////////////////////////////// - // //CREATE - // internal async Task CreateAsync(DataListTemplate inObj) - // { - // Validate(inObj, true); - // if (HasErrors) - // return null; - // else - // { - // //do stuff with datafilter - // DataListTemplate outObj = inObj; - // outObj.UserId = UserId; - - - // await ct.DataListTemplate.AddAsync(outObj); - // await ct.SaveChangesAsync(); - - // //Handle child and associated items: - - // //EVENT LOG - // EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct); - - // //SEARCH INDEXING - // // Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name); - - // return outObj; - - // } - // } - - // //////////////////////////////////////////////////////////////////////////////////////////////// - // //CREATE - // internal DataListTemplate Create(AyContext TempContext, DataListTemplate inObj) - // { - // Validate(inObj, true); - // if (HasErrors) - // return null; - // else - // { - // //do stuff with datafilter - // DataListTemplate outObj = inObj; - // outObj.UserId = UserId; - - - // TempContext.DataListTemplate.Add(outObj); - // TempContext.SaveChanges(); - - // //Handle child and associated items: - - // //EVENT LOG - // EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext); - - // //SEARCH INDEXING - // // Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name); - - // return outObj; - - // } - // } - //////////////////////////////////////////////////////////////////////////////////////////////// - /// GET - - //Get one + /// GET internal async Task GetAsync(string DataListKey, bool log, IAyaDataList dataList) { //DataListKey always exists, if not in db then in default form @@ -116,7 +47,11 @@ namespace AyaNova.Biz //Not in db? then put it in the db with the default then return it if (ret == null) { - + ret = new DataListTemplate(); + ret.DataListKey = dataList.ListKey; + ret.Template = dataList.DefaultDataListDisplayTemplate; + await ct.DataListTemplate.AddAsync(ret); + await ct.SaveChangesAsync(); } if (log) @@ -150,7 +85,6 @@ namespace AyaNova.Biz //Log modification EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); - return true; }