This commit is contained in:
2020-01-17 00:18:10 +00:00
parent 17a5e9b34e
commit d47f8d64b7
3 changed files with 41 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ namespace AyaNova.Biz
//For objects that are compound list objects or reporting objects it's whatever uniquely but clearly identifies that and ends in _LIST
public const string WIDGET_KEY = "widget";
public const string USER_KEY = "user";
public const string USER_EMAIL_ADDRESS_LIST_KEY = "UserEmailAddress";//for development testing, not a real thing going forward
public const string TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY = "TEST_WIDGET_USER_EMAIL_ADDRESS_LIST";//for development testing, not a real thing going forward
public static List<string> AvailableObjectKeys
@@ -219,9 +219,38 @@ namespace AyaNova.Biz
l.Add(new ObjectField { Key = "UserCustom16", PropertyName = "UserCustom16", Custom = true });
break;
#endregion
case USER_EMAIL_ADDRESS_LIST_KEY:
#region USER_EMAIL_ADDRESS_LIST_KEY
l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.User });
case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY:
#region WIDGET_USER_EMAIL_ADDRESS_LIST_KEY
/*
Select awidget.id as widgetid, awidget.name as widgetname, auser.name as username, auser.id as userid, auseroptions.emailaddress
from awidget
left outer join auser on (awidget.userid=auser.id)
left outer join auseroptions on (auser.id=auseroptions.userid)
public string Key { get; set; }
public string PropertyName { get; set; }
public bool Hideable { get; set; }
public bool SharedLTKey { get; set; }
public bool Custom { get; set; }
public bool Filterable { get; set; }
public bool Sortable { get; set; }
public bool MiniAvailable { get; set; }
public int DataType { get; set; }
//If it's an enum DataType then this is the specific enum type which sb the name of the class that holds the enum in the server project
public string EnumType { get; set; }
//if field is a reference to another object (i.e. a client in a workorders list)
//then the type to open is set here
public int AyObjectType { get; set; }
//For query building
//This is the equivalent of the v7 SqlColumnNameAttribute
public string SqlIdColumn { get; set; }
public string SqlColumn { get; set; }
*/
l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.Widget });
l.Add(new ObjectField { Key = "WidgetName", PropertyName = "Name", DataType = (int)AyaDataType.Text, Hideable = false, });//not hideable for strictly list must mean it has to be in template?
l.Add(new ObjectField { Key = "User", PropertyName = "userid", DataType = (int)AyaDataType.Text, AyObjectType = (int)AyaType.User });
l.Add(new ObjectField { Key = "Name", PropertyName = "Name", SharedLTKey = true, DataType = (int)AyaDataType.Text, Hideable = false });
l.Add(new ObjectField { Key = "UserEmailAddress", PropertyName = "Emailaddress", DataType = (int)AyaDataType.EmailAddress, SqlColumn = "emailaddress" });
break;

View File

@@ -95,7 +95,7 @@ namespace AyaNova.Models
.HasForeignKey<UserOptions>(b => b.UserId)
.OnDelete(DeleteBehavior.Cascade);//Hopefully will delete the useroptions with the user?
//User->Widget this might be wrong
//User->Widget Not certain about this definition
modelBuilder.Entity<User>()
.HasOne(p => p.Widget)
.WithOne(i => i.User)