diff --git a/server/AyaNova/biz/CustomFieldsValidator.cs b/server/AyaNova/biz/CustomFieldsValidator.cs index 501cb695..15e1e8b4 100644 --- a/server/AyaNova/biz/CustomFieldsValidator.cs +++ b/server/AyaNova/biz/CustomFieldsValidator.cs @@ -16,7 +16,7 @@ namespace AyaNova.Biz return; var FormTemplate = JArray.Parse(formCustom.Template); - var ThisFormCustomFieldsList = ObjectFields.ObjectFieldsList(formCustom.FormKey).Where(x => x.Custom == true).Select(x => x.Key).ToList(); + var ThisFormCustomFieldsList = ObjectFields.ObjectFieldsList(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) diff --git a/server/AyaNova/biz/DataFilterBiz.cs b/server/AyaNova/biz/DataFilterBiz.cs index 1f0ab396..78857f6b 100644 --- a/server/AyaNova/biz/DataFilterBiz.cs +++ b/server/AyaNova/biz/DataFilterBiz.cs @@ -282,13 +282,13 @@ namespace AyaNova.Biz if (FieldList != null) { - var TheField = FieldList.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld); + var TheField = FieldList.SingleOrDefault(x => x.FieldName.ToLowerInvariant() == fld); if (TheField == null) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified"); } - else if (TheField.Filterable == false) + else if (TheField.IsFilterable == false) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not filterable"); } @@ -351,7 +351,7 @@ namespace AyaNova.Biz if (FieldList != null) { - if (!FieldList.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable)) + if (!FieldList.Exists(x => x.FieldName.ToLowerInvariant() == fld && x.IsFilterable)) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Sort", $"Sort array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified"); } diff --git a/server/AyaNova/biz/FormCustomBiz.cs b/server/AyaNova/biz/FormCustomBiz.cs index 8bd94792..b79e9296 100644 --- a/server/AyaNova/biz/FormCustomBiz.cs +++ b/server/AyaNova/biz/FormCustomBiz.cs @@ -221,13 +221,13 @@ namespace AyaNova.Biz if (ValidFormFields != null) { - if (!ValidFormFields.Exists(x => x.Key == fldKey)) + if (!ValidFormFields.Exists(x => x.LtKey == fldKey)) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, fld property value \"{fldKey}\" is not a valid form field value for formKey specified"); } else { - MasterFormField = ValidFormFields.FirstOrDefault(x => x.Key == fldKey); + MasterFormField = ValidFormFields.FirstOrDefault(x => x.LtKey == fldKey); } } @@ -245,7 +245,7 @@ namespace AyaNova.Biz } //validate if it's a custom field that it has a type specified - if (MasterFormField.Custom && formFieldItem["type"] == null) + if (MasterFormField.IsCustomField && formFieldItem["type"] == null) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is MISSING for custom filed, Custom fields MUST have types specified"); } @@ -254,7 +254,7 @@ namespace AyaNova.Biz if (formFieldItem["type"] != null) { - if (!MasterFormField.Custom) + if (!MasterFormField.IsCustomField) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is not valid, only Custom fields can have types specified"); else {//It is a custom field, is it a valid type value diff --git a/server/AyaNova/biz/ObjectFields.cs b/server/AyaNova/biz/ObjectFields.cs index 11b1982e..b76e25d5 100644 --- a/server/AyaNova/biz/ObjectFields.cs +++ b/server/AyaNova/biz/ObjectFields.cs @@ -157,66 +157,66 @@ 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 ObjectField { Key = "df", AyObjectType = (int)AyaType.Widget }); - l.Add(new ObjectField { Key = "WidgetName", PropertyName = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false }); - l.Add(new ObjectField { Key = "WidgetSerial", PropertyName = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer }); - l.Add(new ObjectField { Key = "WidgetDollarAmount", PropertyName = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency }); - l.Add(new ObjectField { Key = "WidgetCount", PropertyName = "Count", UiFieldDataType = (int)AyaUiFieldDataType.Integer }); - l.Add(new ObjectField { Key = "WidgetRoles", PropertyName = "Roles", UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() }); - l.Add(new ObjectField { Key = "WidgetStartDate", PropertyName = "StartDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime }); - l.Add(new ObjectField { Key = "WidgetEndDate", PropertyName = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime }); - l.Add(new ObjectField { Key = "WidgetNotes", PropertyName = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text }); + l.Add(new ObjectField { LtKey = "df", AyaObjectType = (int)AyaType.Widget }); + l.Add(new ObjectField { LtKey = "WidgetName", FieldName = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false }); + l.Add(new ObjectField { LtKey = "WidgetSerial", FieldName = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer }); + l.Add(new ObjectField { LtKey = "WidgetDollarAmount", FieldName = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency }); + l.Add(new ObjectField { LtKey = "WidgetCount", FieldName = "Count", UiFieldDataType = (int)AyaUiFieldDataType.Integer }); + l.Add(new ObjectField { LtKey = "WidgetRoles", FieldName = "Roles", UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() }); + l.Add(new ObjectField { LtKey = "WidgetStartDate", FieldName = "StartDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime }); + l.Add(new ObjectField { LtKey = "WidgetEndDate", FieldName = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime }); + l.Add(new ObjectField { LtKey = "WidgetNotes", FieldName = "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 ObjectField { Key = "User", PropertyName = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyObjectType = (int)AyaType.User }); - l.Add(new ObjectField { Key = "Active", PropertyName = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false, SharedLTKey = true }); - l.Add(new ObjectField { Key = "Tags", PropertyName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true }); + l.Add(new ObjectField { LtKey = "User", FieldName = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User }); + l.Add(new ObjectField { LtKey = "Active", FieldName = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false, SharedLTKey = true }); + l.Add(new ObjectField { LtKey = "Tags", FieldName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true }); - l.Add(new ObjectField { Key = "WidgetCustom1", PropertyName = "WidgetCustom1", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom2", PropertyName = "WidgetCustom2", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom3", PropertyName = "WidgetCustom3", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom4", PropertyName = "WidgetCustom4", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom5", PropertyName = "WidgetCustom5", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom6", PropertyName = "WidgetCustom6", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom7", PropertyName = "WidgetCustom7", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom8", PropertyName = "WidgetCustom8", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom9", PropertyName = "WidgetCustom9", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom10", PropertyName = "WidgetCustom10", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom11", PropertyName = "WidgetCustom11", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom12", PropertyName = "WidgetCustom12", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom13", PropertyName = "WidgetCustom13", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom14", PropertyName = "WidgetCustom14", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom15", PropertyName = "WidgetCustom15", Custom = true }); - l.Add(new ObjectField { Key = "WidgetCustom16", PropertyName = "WidgetCustom16", Custom = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom1", FieldName = "WidgetCustom1", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom2", FieldName = "WidgetCustom2", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom3", FieldName = "WidgetCustom3", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom4", FieldName = "WidgetCustom4", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom5", FieldName = "WidgetCustom5", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom6", FieldName = "WidgetCustom6", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom7", FieldName = "WidgetCustom7", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom8", FieldName = "WidgetCustom8", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom9", FieldName = "WidgetCustom9", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom10", FieldName = "WidgetCustom10", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom11", FieldName = "WidgetCustom11", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom12", FieldName = "WidgetCustom12", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom13", FieldName = "WidgetCustom13", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom14", FieldName = "WidgetCustom14", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom15", FieldName = "WidgetCustom15", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "WidgetCustom16", FieldName = "WidgetCustom16", IsCustomField = true }); break; #endregion case USER_KEY: #region USER_KEY - l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.User }); - l.Add(new ObjectField { Key = "Name", PropertyName = "Name", SharedLTKey = true, UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false }); - l.Add(new ObjectField { Key = "UserEmployeeNumber", PropertyName = "EmployeeNumber", UiFieldDataType = (int)AyaUiFieldDataType.Text }); - l.Add(new ObjectField { Key = "AuthorizationRoles", PropertyName = "Roles", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() }); - l.Add(new ObjectField { Key = "UserNotes", PropertyName = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text }); - l.Add(new ObjectField { Key = "UserUserType", PropertyName = "UserType", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(UserType).ToString() }); - l.Add(new ObjectField { Key = "Active", PropertyName = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false, SharedLTKey = true }); - l.Add(new ObjectField { Key = "Tags", PropertyName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true }); + l.Add(new ObjectField { LtKey = "df", AyaObjectType = (int)AyaType.User }); + l.Add(new ObjectField { LtKey = "Name", FieldName = "Name", SharedLTKey = true, UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false }); + l.Add(new ObjectField { LtKey = "UserEmployeeNumber", FieldName = "EmployeeNumber", UiFieldDataType = (int)AyaUiFieldDataType.Text }); + l.Add(new ObjectField { LtKey = "AuthorizationRoles", FieldName = "Roles", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() }); + l.Add(new ObjectField { LtKey = "UserNotes", FieldName = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text }); + l.Add(new ObjectField { LtKey = "UserUserType", FieldName = "UserType", Hideable = false, UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(UserType).ToString() }); + l.Add(new ObjectField { LtKey = "Active", FieldName = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false, SharedLTKey = true }); + l.Add(new ObjectField { LtKey = "Tags", FieldName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true }); - l.Add(new ObjectField { Key = "UserCustom1", PropertyName = "UserCustom1", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom2", PropertyName = "UserCustom2", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom3", PropertyName = "UserCustom3", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom4", PropertyName = "UserCustom4", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom5", PropertyName = "UserCustom5", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom6", PropertyName = "UserCustom6", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom7", PropertyName = "UserCustom7", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom8", PropertyName = "UserCustom8", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom9", PropertyName = "UserCustom9", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom10", PropertyName = "UserCustom10", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom11", PropertyName = "UserCustom11", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom12", PropertyName = "UserCustom12", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom13", PropertyName = "UserCustom13", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom14", PropertyName = "UserCustom14", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom15", PropertyName = "UserCustom15", Custom = true }); - l.Add(new ObjectField { Key = "UserCustom16", PropertyName = "UserCustom16", Custom = true }); + l.Add(new ObjectField { LtKey = "UserCustom1", FieldName = "UserCustom1", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom2", FieldName = "UserCustom2", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom3", FieldName = "UserCustom3", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom4", FieldName = "UserCustom4", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom5", FieldName = "UserCustom5", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom6", FieldName = "UserCustom6", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom7", FieldName = "UserCustom7", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom8", FieldName = "UserCustom8", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom9", FieldName = "UserCustom9", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom10", FieldName = "UserCustom10", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom11", FieldName = "UserCustom11", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom12", FieldName = "UserCustom12", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom13", FieldName = "UserCustom13", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom14", FieldName = "UserCustom14", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom15", FieldName = "UserCustom15", IsCustomField = true }); + l.Add(new ObjectField { LtKey = "UserCustom16", FieldName = "UserCustom16", IsCustomField = true }); break; #endregion case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY: @@ -299,26 +299,26 @@ So rename things and see what breaks I guess */ - l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.Widget, SqlIdColumn = "awidget.id as df" }); + l.Add(new ObjectField { LtKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id as df" }); l.Add(new ObjectField { - Key = "WidgetName", - PropertyName = "widgetname", + LtKey = "WidgetName", + FieldName = "widgetname", UiFieldDataType = (int)AyaUiFieldDataType.Text, - AyObjectType = (int)AyaType.Widget, - SqlIdColumn = "awidget.id as widgetid", - SqlDisplayColumn = "awidget.name as widgetname" + AyaObjectType = (int)AyaType.Widget, + SqlIdColumnName = "awidget.id as widgetid", + SqlDisplayColumnName = "awidget.name as widgetname" }); l.Add(new ObjectField { - Key = "User", - PropertyName = "username", + LtKey = "User", + FieldName = "username", UiFieldDataType = (int)AyaUiFieldDataType.Text, - AyObjectType = (int)AyaType.User, - SqlIdColumn = "userid", - SqlDisplayColumn = "auser.name as username" + AyaObjectType = (int)AyaType.User, + SqlIdColumnName = "userid", + SqlDisplayColumnName = "auser.name as username" }); - l.Add(new ObjectField { Key = "UserEmailAddress", PropertyName = "emailaddress", UiFieldDataType = (int)AyaUiFieldDataType.EmailAddress }); + l.Add(new ObjectField { LtKey = "UserEmailAddress", FieldName = "emailaddress", UiFieldDataType = (int)AyaUiFieldDataType.EmailAddress }); break; #endregion @@ -372,7 +372,7 @@ So rename things and see what breaks I guess foreach (string s in fullFields) { - ObjectField o = fields.FirstOrDefault(x => x.Key == s); + ObjectField o = fields.FirstOrDefault(x => x.LtKey == s); #if (DEBUG) //Developers little helper if (o == null) @@ -387,11 +387,11 @@ So rename things and see what breaks I guess sb.Append(","); sb.Append("{"); //Build required part of column definition - sb.Append($"\"cm\":\"{o.Key}\",\"dt\":{(int)o.UiFieldDataType}"); + sb.Append($"\"cm\":\"{o.LtKey}\",\"dt\":{(int)o.UiFieldDataType}"); //Has a AyObjectType? (linkable / openable) - if (o.AyObjectType != 0) - sb.Append($",\"ay\":{(int)o.AyObjectType}"); + if (o.AyaObjectType != 0) + sb.Append($",\"ay\":{(int)o.AyaObjectType}"); sb.Append("}"); @@ -408,13 +408,13 @@ So rename things and see what breaks I guess public class ObjectField { - public string Key { get; set; } - public string PropertyName { get; set; } + public string LtKey { get; set; } + public string FieldName { 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 SharedLTKey { get; set; } + public bool IsCustomField { get; set; } + public bool IsFilterable { get; set; } + public bool IsSortable { get; set; } //had this but don't know why //if a user wants to shove a bunch of notes into a single column with other shit that's their lookout surely //public bool MiniAvailable { get; set; } @@ -423,12 +423,12 @@ So rename things and see what breaks I guess 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; } + public int AyaObjectType { get; set; } //For query building //This is the equivalent of the v7 SqlColumnNameAttribute - public string SqlIdColumn { get; set; } - public string SqlDisplayColumn { get; set; } + public string SqlIdColumnName { get; set; } + public string SqlDisplayColumnName { get; set; } public ObjectField() @@ -436,24 +436,24 @@ So rename things and see what breaks I guess //most common defaults SharedLTKey = false; Hideable = true; - Custom = false; - Filterable = true; - Sortable = true; + IsCustomField = false; + IsFilterable = true; + IsSortable = true; //Set openable object type to no type which is the default and means it's not a link to another object - AyObjectType = (int)AyaType.NoType; + AyaObjectType = (int)AyaType.NoType; } //Get column to query for display name or use PropertyName if there is no difference public string GetSqlDisplayColumnName() { - if (string.IsNullOrEmpty(SqlDisplayColumn)) + if (string.IsNullOrEmpty(SqlDisplayColumnName)) { - return PropertyName.ToLowerInvariant(); + return FieldName.ToLowerInvariant(); } else { - return SqlDisplayColumn; + return SqlDisplayColumnName; } } diff --git a/server/AyaNova/biz/RequiredFieldsValidator.cs b/server/AyaNova/biz/RequiredFieldsValidator.cs index 78b65486..cbc0bb1a 100644 --- a/server/AyaNova/biz/RequiredFieldsValidator.cs +++ b/server/AyaNova/biz/RequiredFieldsValidator.cs @@ -30,14 +30,14 @@ 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 - ObjectField FF = FormFields.Where(x => x.Key == FldLtKey).Single(); + ObjectField 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 - if (!FF.Custom) + if (!FF.IsCustomField) { //Now get the actual property name from the available fields using the lt key - string RequiredPropertyName = FF.PropertyName; + string RequiredPropertyName = FF.FieldName; //use reflection to get the underlying value from the proposed object to be saved object propertyValue = proposedObject.GetType().GetProperty(RequiredPropertyName).GetValue(proposedObject, null); diff --git a/server/AyaNova/biz/SqlFilterCriteriaBuilder.cs b/server/AyaNova/biz/SqlFilterCriteriaBuilder.cs index 0df44a63..bda57a70 100644 --- a/server/AyaNova/biz/SqlFilterCriteriaBuilder.cs +++ b/server/AyaNova/biz/SqlFilterCriteriaBuilder.cs @@ -38,7 +38,7 @@ namespace AyaNova.Biz tagList = filterItem["value"].ToObject>(); } - var dataType = objectFields.Find(x => x.PropertyName.ToLowerInvariant() == fld).UiFieldDataType; + var dataType = objectFields.Find(x => x.FieldName.ToLowerInvariant() == fld).UiFieldDataType; sb.Append("("); sb.Append(DataFilterToColumnCriteria(fld, (AyaUiFieldDataType)dataType, opType, val, tagList, userId)); if (i < FilterArray.Count - 1) diff --git a/server/AyaNova/biz/SqlSelectBuilder.cs b/server/AyaNova/biz/SqlSelectBuilder.cs index 96a4ed74..52c0d4bd 100644 --- a/server/AyaNova/biz/SqlSelectBuilder.cs +++ b/server/AyaNova/biz/SqlSelectBuilder.cs @@ -37,25 +37,25 @@ namespace AyaNova.Biz sb.Append("SELECT "); //Default ID column for each row (always is aliased as df) - ObjectField def = objectFieldsList.FirstOrDefault(x => x.Key == "df"); + ObjectField def = objectFieldsList.FirstOrDefault(x => x.LtKey == "df"); if (def == null) { throw new System.ArgumentNullException($"SqlSelectBuilder: objectFieldList for key \"{objectKey}\" is missing the df default field"); } - if (string.IsNullOrEmpty(def.SqlIdColumn)) + if (string.IsNullOrEmpty(def.SqlIdColumnName)) { sb.Append("id");//default when no alternate column is specified } else { - sb.Append(def.SqlIdColumn); + sb.Append(def.SqlIdColumnName); } sb.Append(" AS df"); foreach (string ColumnName in templateFieldList) { - ObjectField o = objectFieldsList.FirstOrDefault(x => x.Key == ColumnName); + ObjectField o = objectFieldsList.FirstOrDefault(x => x.LtKey == ColumnName); #if (DEBUG) //Developers little helper if (o == null)