This commit is contained in:
@@ -26,7 +26,7 @@ namespace AyaNova.Biz
|
||||
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
|
||||
public static List<string> AyaObjectFieldDefinitionKeys
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -39,10 +39,10 @@ namespace AyaNova.Biz
|
||||
|
||||
public static bool IsValidObjectKey(string key)
|
||||
{
|
||||
return AvailableObjectKeys.Contains(key);
|
||||
return AyaObjectFieldDefinitionKeys.Contains(key);
|
||||
}
|
||||
|
||||
public static List<AyaFieldDefinition> ObjectFieldsList(string key)
|
||||
public static List<AyaObjectFieldDefinition> AyaObjectFields(string key)
|
||||
{
|
||||
/*
|
||||
***************************** WARNING: Be careful here, if a standard field is hideable and also it's DB SCHEMA is set to NON NULLABLE then the CLIENT end needs to set a default
|
||||
@@ -55,7 +55,7 @@ namespace AyaNova.Biz
|
||||
Sortable = true;
|
||||
MiniAvailable = true;
|
||||
*/
|
||||
List<AyaFieldDefinition> l = new List<AyaFieldDefinition>();
|
||||
List<AyaObjectFieldDefinition> l = new List<AyaObjectFieldDefinition>();
|
||||
switch (key)
|
||||
{
|
||||
/*
|
||||
@@ -157,73 +157,73 @@ namespace AyaNova.Biz
|
||||
|
||||
//first column is the non visible Default Id column so that the client knows what to open when there is no field with ID selected that matches underlying record type
|
||||
//in this case the default of id is sufficient for this list
|
||||
l.Add(new AyaFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.Widget });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetName", FieldKey = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetSerial", FieldKey = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetDollarAmount", FieldKey = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCount", FieldKey = "Count", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetRoles", FieldKey = "Roles", UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetStartDate", FieldKey = "StartDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetEndDate", FieldKey = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetNotes", FieldKey = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.Widget });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetName", FieldKey = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetSerial", FieldKey = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetDollarAmount", FieldKey = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCount", FieldKey = "Count", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetRoles", FieldKey = "Roles", UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetStartDate", FieldKey = "StartDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetEndDate", FieldKey = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetNotes", FieldKey = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
//More to do on this, maybe the datatype should be a LINK or something for UI purposes
|
||||
//circle back on this when there is enough infrastructure to test
|
||||
l.Add(new AyaFieldDefinition { LtKey = "User", FieldKey = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "Active", FieldKey = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "Tags", FieldKey = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "User", FieldKey = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "Active", FieldKey = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "Tags", FieldKey = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags });
|
||||
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "WidgetCustom1", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "WidgetCustom2", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom3", FieldKey = "WidgetCustom3", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom4", FieldKey = "WidgetCustom4", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom5", FieldKey = "WidgetCustom5", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom6", FieldKey = "WidgetCustom6", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom7", FieldKey = "WidgetCustom7", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom8", FieldKey = "WidgetCustom8", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom9", FieldKey = "WidgetCustom9", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom10", FieldKey = "WidgetCustom10", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom11", FieldKey = "WidgetCustom11", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom12", FieldKey = "WidgetCustom12", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom13", FieldKey = "WidgetCustom13", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom14", FieldKey = "WidgetCustom14", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom15", FieldKey = "WidgetCustom15", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "WidgetCustom16", FieldKey = "WidgetCustom16", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "WidgetCustom1", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "WidgetCustom2", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom3", FieldKey = "WidgetCustom3", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom4", FieldKey = "WidgetCustom4", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom5", FieldKey = "WidgetCustom5", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom6", FieldKey = "WidgetCustom6", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom7", FieldKey = "WidgetCustom7", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom8", FieldKey = "WidgetCustom8", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom9", FieldKey = "WidgetCustom9", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom10", FieldKey = "WidgetCustom10", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom11", FieldKey = "WidgetCustom11", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom12", FieldKey = "WidgetCustom12", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom13", FieldKey = "WidgetCustom13", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom14", FieldKey = "WidgetCustom14", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom15", FieldKey = "WidgetCustom15", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "WidgetCustom16", FieldKey = "WidgetCustom16", IsCustomField = true });
|
||||
break;
|
||||
#endregion
|
||||
case USER_KEY:
|
||||
#region USER_KEY
|
||||
l.Add(new AyaFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.User });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "Name", FieldKey = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserEmployeeNumber", FieldKey = "EmployeeNumber", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "AuthorizationRoles", FieldKey = "Roles", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserNotes", FieldKey = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserUserType", FieldKey = "UserType", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(UserType).ToString() });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "Active", FieldKey = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "Tags", FieldKey = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.User });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "Name", FieldKey = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserEmployeeNumber", FieldKey = "EmployeeNumber", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "AuthorizationRoles", FieldKey = "Roles", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserNotes", FieldKey = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserUserType", FieldKey = "UserType", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(UserType).ToString() });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "Active", FieldKey = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "Tags", FieldKey = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags });
|
||||
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom1", FieldKey = "UserCustom1", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom2", FieldKey = "UserCustom2", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom3", FieldKey = "UserCustom3", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom4", FieldKey = "UserCustom4", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom5", FieldKey = "UserCustom5", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom6", FieldKey = "UserCustom6", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom7", FieldKey = "UserCustom7", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom8", FieldKey = "UserCustom8", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom9", FieldKey = "UserCustom9", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom10", FieldKey = "UserCustom10", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom11", FieldKey = "UserCustom11", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom12", FieldKey = "UserCustom12", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom13", FieldKey = "UserCustom13", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom14", FieldKey = "UserCustom14", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom15", FieldKey = "UserCustom15", IsCustomField = true });
|
||||
l.Add(new AyaFieldDefinition { LtKey = "UserCustom16", FieldKey = "UserCustom16", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom1", FieldKey = "UserCustom1", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom2", FieldKey = "UserCustom2", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom3", FieldKey = "UserCustom3", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom4", FieldKey = "UserCustom4", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom5", FieldKey = "UserCustom5", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom6", FieldKey = "UserCustom6", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom7", FieldKey = "UserCustom7", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom8", FieldKey = "UserCustom8", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom9", FieldKey = "UserCustom9", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom10", FieldKey = "UserCustom10", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom11", FieldKey = "UserCustom11", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom12", FieldKey = "UserCustom12", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom13", FieldKey = "UserCustom13", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom14", FieldKey = "UserCustom14", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom15", FieldKey = "UserCustom15", IsCustomField = true });
|
||||
l.Add(new AyaObjectFieldDefinition { LtKey = "UserCustom16", FieldKey = "UserCustom16", IsCustomField = true });
|
||||
break;
|
||||
#endregion
|
||||
case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY:
|
||||
#region TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY
|
||||
|
||||
l.Add(new AyaFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" });
|
||||
l.Add(new AyaFieldDefinition
|
||||
l.Add(new AyaObjectFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" });
|
||||
l.Add(new AyaObjectFieldDefinition
|
||||
{
|
||||
FieldKey = "widgetname",
|
||||
LtKey = "WidgetName",
|
||||
@@ -232,7 +232,7 @@ namespace AyaNova.Biz
|
||||
SqlIdColumnName = "awidget.id",
|
||||
SqlDisplayColumnName = "awidget.name"
|
||||
});
|
||||
l.Add(new AyaFieldDefinition
|
||||
l.Add(new AyaObjectFieldDefinition
|
||||
{
|
||||
FieldKey = "username",
|
||||
LtKey = "User",
|
||||
@@ -241,7 +241,7 @@ namespace AyaNova.Biz
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlDisplayColumnName = "auser.name"
|
||||
});
|
||||
l.Add(new AyaFieldDefinition
|
||||
l.Add(new AyaObjectFieldDefinition
|
||||
{
|
||||
LtKey = "UserEmailAddress",
|
||||
FieldKey = "emailaddress",
|
||||
@@ -287,7 +287,7 @@ namespace AyaNova.Biz
|
||||
var jtemplate = JObject.Parse(template);
|
||||
|
||||
//get the fields list
|
||||
var fields = ObjectFieldsList(ObjectKey);
|
||||
var fields = AyaObjectFields(ObjectKey);
|
||||
|
||||
//convert to strings (https://stackoverflow.com/a/33836599/8939)
|
||||
var fullFields = ((JArray)jtemplate["full"]).ToObject<string[]>();
|
||||
@@ -301,7 +301,7 @@ namespace AyaNova.Biz
|
||||
|
||||
foreach (string s in fullFields)
|
||||
{
|
||||
AyaFieldDefinition o = fields.FirstOrDefault(x => x.FieldKey == s);
|
||||
AyaObjectFieldDefinition o = fields.FirstOrDefault(x => x.FieldKey == s);
|
||||
#if (DEBUG)
|
||||
//Developers little helper
|
||||
if (o == null)
|
||||
@@ -335,7 +335,7 @@ namespace AyaNova.Biz
|
||||
|
||||
}//eoc ObjectFields
|
||||
|
||||
public class AyaFieldDefinition
|
||||
public class AyaObjectFieldDefinition
|
||||
{
|
||||
//CLIENT / SERVER Unique identifier used at BOTH client and server
|
||||
//also the sql displaycolumnname if identical
|
||||
@@ -370,7 +370,7 @@ namespace AyaNova.Biz
|
||||
public string SqlDisplayColumnName { get; set; }
|
||||
|
||||
|
||||
public AyaFieldDefinition()
|
||||
public AyaObjectFieldDefinition()
|
||||
{
|
||||
//most common defaults
|
||||
Hideable = true;
|
||||
|
||||
Reference in New Issue
Block a user