This commit is contained in:
2020-02-14 21:20:32 +00:00
parent 8c0bdb05de
commit 5acf0b8a80
11 changed files with 16 additions and 14 deletions

View File

@@ -37,7 +37,7 @@ namespace AyaNova.Biz
case AyaType.FileAttachment:
return await ct.FileAttachment.AnyAsync(m => m.Id == id);
case AyaType.DataListView:
return await ct.DataListSortFilter.AnyAsync(m => m.Id == id);
return await ct.DataListView.AnyAsync(m => m.Id == id);
case AyaType.FormCustom:
return await ct.FormCustom.AnyAsync(m => m.Id == id);

View File

@@ -171,7 +171,7 @@ namespace AyaNova.Biz
//ONGOING VALIDATION TO CATCH MISMATCH WHEN NEW ROLES ADDED (wont' catch changes to existing unfortunately)
//var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":32767},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":32767},\"DataListFilter\":{\"Change\":2,\"ReadFullRecord\":32767},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":32767}}";
var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":131071},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":131071},\"DataListSortFilter\":{\"Change\":2,\"ReadFullRecord\":131071},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":131071}}";
var lastRoles = "{\"User\":{\"Change\":2,\"ReadFullRecord\":1},\"UserOptions\":{\"Change\":2,\"ReadFullRecord\":1},\"Widget\":{\"Change\":34,\"ReadFullRecord\":17},\"ServerState\":{\"Change\":16384,\"ReadFullRecord\":131071},\"License\":{\"Change\":16386,\"ReadFullRecord\":8193},\"LogFile\":{\"Change\":0,\"ReadFullRecord\":24576},\"JobOperations\":{\"Change\":16384,\"ReadFullRecord\":8195},\"AyaNova7Import\":{\"Change\":16384,\"ReadFullRecord\":0},\"Metrics\":{\"Change\":0,\"ReadFullRecord\":24576},\"Locale\":{\"Change\":16386,\"ReadFullRecord\":131071},\"DataListView\":{\"Change\":2,\"ReadFullRecord\":131071},\"FormCustom\":{\"Change\":2,\"ReadFullRecord\":131071}}";
Dictionary<AyaType, BizRoleSet> lastRolesDeserialized = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<AyaType, BizRoleSet>>(lastRoles);
if (lastRolesDeserialized.Count != roles.Count)
{

View File

@@ -40,7 +40,7 @@ namespace AyaNova.Biz
//EXISTS
internal async Task<bool> ExistsAsync(long id)
{
return await ct.DataListSortFilter.AnyAsync(e => e.Id == id);
return await ct.DataListView.AnyAsync(e => e.Id == id);
}
@@ -59,7 +59,7 @@ namespace AyaNova.Biz
outObj.UserId = UserId;
await ct.DataListSortFilter.AddAsync(outObj);
await ct.DataListView.AddAsync(outObj);
await ct.SaveChangesAsync();
//Handle child and associated items:
@@ -84,7 +84,7 @@ namespace AyaNova.Biz
internal async Task<DataListView> GetAsync(long fetchId, bool logTheGetEvent = true)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
var ret = await ct.DataListSortFilter.SingleOrDefaultAsync(m => m.Id == fetchId && (m.Public == true || m.UserId == UserId));
var ret = await ct.DataListView.SingleOrDefaultAsync(m => m.Id == fetchId && (m.Public == true || m.UserId == UserId));
if (logTheGetEvent && ret != null)
{
//Log
@@ -102,7 +102,7 @@ namespace AyaNova.Biz
List<NameIdItem> items = new List<NameIdItem>();
if (!string.IsNullOrWhiteSpace(listKey))
{
items = await ct.DataListSortFilter
items = await ct.DataListView
.AsNoTracking()
.Where(m => m.ListKey == listKey && (m.Public == true || m.UserId == UserId))
.OrderBy(m => m.Name)
@@ -164,7 +164,7 @@ namespace AyaNova.Biz
if (HasErrors)
return false;
ct.DataListSortFilter.Remove(dbObj);
ct.DataListView.Remove(dbObj);
await ct.SaveChangesAsync();
//Delete sibling objects
@@ -209,7 +209,7 @@ namespace AyaNova.Biz
if (!PropertyHasErrors("Name"))
{
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
if (await ct.DataListSortFilter.AnyAsync(m => m.Name == inObj.Name && m.Id != inObj.Id))
if (await ct.DataListView.AnyAsync(m => m.Name == inObj.Name && m.Id != inObj.Id))
{
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
}

View File

@@ -17,7 +17,7 @@ namespace AyaNova.Models
public virtual DbSet<OpsJobLog> OpsJobLog { get; set; }
public virtual DbSet<Locale> Locale { get; set; }
public virtual DbSet<LocaleItem> LocaleItem { get; set; }
public virtual DbSet<DataListView> DataListSortFilter { get; set; }
public virtual DbSet<DataListView> DataListView { get; set; }
public virtual DbSet<Tag> Tag { get; set; }
public virtual DbSet<FormCustom> FormCustom { get; set; }

View File

@@ -1612,5 +1612,5 @@
"NotificationSettings": "Benachrichtigungseinstellungen",
"Review": "Überprüfung",
"UserSettings": "Benutzereinstellungen",
"DataListSortFilter": "Sortieren und Filtern"
"DataListView": "Datenlistenansicht"
}

View File

@@ -1611,7 +1611,7 @@
"NotificationSettings": "Notification settings",
"Review": "Review",
"UserSettings": "User settings",
"DataListSortFilter": "Sort & filter"
"DataListView": "Data list view"

View File

@@ -1612,7 +1612,7 @@
"NotificationSettings": "Configuración de notificaciones",
"Review": "Revisión",
"UserSettings": "Configuración de usuario",
"DataListSortFilter": "Ordenar y filtrar"
"DataListView": "Vista de lista de datos"
}

View File

@@ -1611,7 +1611,7 @@
"NotificationSettings": "Paramètres de notification",
"Review": "Évaluation",
"UserSettings": "Paramètres utilisateur",
"DataListSortFilter": "Trier et filtrer"
"DataListView": "Affichage de la liste des données"
}