This commit is contained in:
2020-01-20 18:37:44 +00:00
parent d815b38ebd
commit 7d92f15439
12 changed files with 82 additions and 82 deletions

View File

@@ -145,7 +145,7 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
return Ok(ApiOkResponse.Response(AyaObjectFieldDefinitions.AvailableObjectKeys, true));
return Ok(ApiOkResponse.Response(AyaObjectFieldDefinitions.AyaObjectFieldDefinitionKeys, true));
}

View File

@@ -61,7 +61,7 @@ namespace AyaNova.Api.Controllers
if (AyaObjectFieldDefinitions.IsValidObjectKey(objectKey))
{
return Ok(ApiOkResponse.Response(AyaObjectFieldDefinitions.ObjectFieldsList(objectKey), true));
return Ok(ApiOkResponse.Response(AyaObjectFieldDefinitions.AyaObjectFields(objectKey), true));
}
else
{

View File

@@ -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;

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Biz
return;
var FormTemplate = JArray.Parse(formCustom.Template);
var ThisFormCustomFieldsList = AyaObjectFieldDefinitions.ObjectFieldsList(formCustom.FormKey).Where(x => x.IsCustomField == true).Select(x => x.LtKey).ToList();
var ThisFormCustomFieldsList = AyaObjectFieldDefinitions.AyaObjectFields(formCustom.FormKey).Where(x => x.IsCustomField == true).Select(x => x.LtKey).ToList();
//If the customFields string is empty then only validation is if any of the fields are required to be filled in
if (!hasCustomData)

View File

@@ -247,14 +247,14 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey");
List<AyaFieldDefinition> FieldList = null;
List<AyaObjectFieldDefinition> FieldList = null;
if (!AyaObjectFieldDefinitions.IsValidObjectKey(inObj.ListKey))
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ListKey", $"ListKey \"{inObj.ListKey}\" is empty or in-valid");
}
else
{
FieldList = AyaObjectFieldDefinitions.ObjectFieldsList(inObj.ListKey);
FieldList = AyaObjectFieldDefinitions.AyaObjectFields(inObj.ListKey);
}

View File

@@ -96,7 +96,7 @@ namespace AyaNova.Biz
}
//If it doesn't exist, vet the form key name is ok by checking with this list
if (!AyaObjectFieldDefinitions.AvailableObjectKeys.Contains(formKey))
if (!AyaObjectFieldDefinitions.AyaObjectFieldDefinitionKeys.Contains(formKey))
{
//Nope, whatever it is, it's not valid
return null;
@@ -192,7 +192,7 @@ namespace AyaNova.Biz
if ((!PropertyHasErrors("FormKey") && !string.IsNullOrWhiteSpace(inObj.Template)))
{
var ValidCustomFieldTypes = CustomFieldType.ValidCustomFieldTypes;
var ValidFormFields = AyaObjectFieldDefinitions.ObjectFieldsList(inObj.FormKey);
var ValidFormFields = AyaObjectFieldDefinitions.AyaObjectFields(inObj.FormKey);
try
{
//Parse the json, expecting something like this:
@@ -206,7 +206,7 @@ namespace AyaNova.Biz
for (int i = 0; i < v.Count; i++)
{
AyaFieldDefinition MasterFormField = null;
AyaObjectFieldDefinition MasterFormField = null;
var formFieldItem = v[i];
if (formFieldItem["fld"] == null)

View File

@@ -10,7 +10,7 @@ namespace AyaNova.Biz
internal static class PickListFetcher
{
internal static PickListResult GetPickList(AyContext ct, long userId, ListOptions pagingOptions, List<AyaFieldDefinition> objectFields, string tableName)
internal static PickListResult GetPickList(AyContext ct, long userId, ListOptions pagingOptions, List<AyaObjectFieldDefinition> objectFields, string tableName)
{
List<NameIdItem> listItems = new List<NameIdItem>();

View File

@@ -18,7 +18,7 @@ namespace AyaNova.Biz
//var OuterJson=JObject.Parse(formCustom.Template);
var FormTemplate = JArray.Parse(formCustom.Template);
// var FormTemplate=(JArray)OuterJson["template"];
var FormFields = AyaObjectFieldDefinitions.ObjectFieldsList(formCustom.FormKey);
var FormFields = AyaObjectFieldDefinitions.AyaObjectFields(formCustom.FormKey);
// var ThisFormNormalFieldsList = FormFields.Where(x => x.Custom == false).Select(x => x.Key).ToList();
foreach (JObject jo in FormTemplate)
@@ -30,7 +30,7 @@ namespace AyaNova.Biz
// - e.g.: {template:[{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"bool"},{fld:"ltkeyfieldname",hide:"true/false",required:"true/false", type:"text"]}
//get the FormField object
AyaFieldDefinition FF = FormFields.Where(x => x.LtKey == FldLtKey).Single();
AyaObjectFieldDefinition FF = FormFields.Where(x => x.LtKey == FldLtKey).Single();
//don't validate custom fields, just skip them
// if (!string.IsNullOrWhiteSpace(FF.PropertyName))//this used to work because there would be no property name but now there is so it doesn't

View File

@@ -11,7 +11,7 @@ namespace AyaNova.Biz
{
public static class SqlFilterCriteriaBuilder
{
public static string DataFilterToSQLCriteria(AyaNova.Models.DataFilter dataFilter, List<AyaFieldDefinition> objectFields, long userId)
public static string DataFilterToSQLCriteria(AyaNova.Models.DataFilter dataFilter, List<AyaObjectFieldDefinition> objectFields, long userId)
{
if (string.IsNullOrWhiteSpace(dataFilter.Filter))

View File

@@ -20,7 +20,7 @@ namespace AyaNova.Biz
var jtemplate = JObject.Parse(template);
//get the fields list
var objectFieldsList = AyaObjectFieldDefinitions.ObjectFieldsList(objectKey);
var objectFieldsList = AyaObjectFieldDefinitions.AyaObjectFields(objectKey);
//convert to strings array (https://stackoverflow.com/a/33836599/8939)
string[] templateFieldList;
@@ -37,7 +37,7 @@ namespace AyaNova.Biz
sb.Append("SELECT ");
//Default ID column for each row (always is aliased as df)
AyaFieldDefinition def = objectFieldsList.FirstOrDefault(x => x.FieldKey == "df");
AyaObjectFieldDefinition def = objectFieldsList.FirstOrDefault(x => x.FieldKey == "df");
if (def == null)
{
throw new System.ArgumentNullException($"SqlSelectBuilder: objectFieldList for key \"{objectKey}\" is missing the df default field");
@@ -55,7 +55,7 @@ namespace AyaNova.Biz
foreach (string ColumnName in templateFieldList)
{
AyaFieldDefinition o = objectFieldsList.FirstOrDefault(x => x.FieldKey == ColumnName);
AyaObjectFieldDefinition o = objectFieldsList.FirstOrDefault(x => x.FieldKey == ColumnName);
#if (DEBUG)
//Developers little helper
if (o == null)

View File

@@ -191,7 +191,7 @@ namespace AyaNova.Biz
var TheFilter = await ct.DataFilter.FirstOrDefaultAsync(x => x.Id == pagingOptions.DataFilterId);
//BUILD WHERE AND APPEND IT
q = q + SqlFilterCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, AyaObjectFieldDefinitions.ObjectFieldsList(AyaObjectFieldDefinitions.USER_KEY), UserId);
q = q + SqlFilterCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldDefinitions.USER_KEY), UserId);
//BUILD ORDER BY AND APPEND IT
q = q + SqlFilterOrderByBuilder.DataFilterToSQLOrderBy(TheFilter);
@@ -252,7 +252,7 @@ namespace AyaNova.Biz
pagingOptions.Limit = pagingOptions.Limit ?? ListOptions.DefaultLimit;
var ret = PickListFetcher.GetPickList(ct, UserId, pagingOptions, AyaObjectFieldDefinitions.ObjectFieldsList(AyaObjectFieldDefinitions.USER_KEY), "auser");
var ret = PickListFetcher.GetPickList(ct, UserId, pagingOptions, AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldDefinitions.USER_KEY), "auser");
var pageLinks = new PaginationLinkBuilder(Url, routeName, null, pagingOptions, ret.TotalRecordCount).PagingLinksObject();

View File

@@ -440,7 +440,7 @@ namespace AyaNova.Biz
{
TheFilter = await ct.DataFilter.FirstOrDefaultAsync(x => x.Id == listOptions.DataFilterId);
//WHERE CLAUSE - FILTER
qWhere = SqlFilterCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, AyaObjectFieldDefinitions.ObjectFieldsList(AyaObjectFieldsKey), UserId);
qWhere = SqlFilterCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldsKey), UserId);
//ORDER BY CLAUSE - SORT
//BUILD ORDER BY AND APPEND IT
qOrderBy = SqlFilterOrderByBuilder.DataFilterToSQLOrderBy(TheFilter);