This commit is contained in:
@@ -16,7 +16,7 @@ namespace AyaNova.Biz
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var FormTemplate = JArray.Parse(formCustom.Template);
|
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 the customFields string is empty then only validation is if any of the fields are required to be filled in
|
||||||
if (!hasCustomData)
|
if (!hasCustomData)
|
||||||
|
|||||||
@@ -282,13 +282,13 @@ namespace AyaNova.Biz
|
|||||||
if (FieldList != null)
|
if (FieldList != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var TheField = FieldList.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld);
|
var TheField = FieldList.SingleOrDefault(x => x.FieldName.ToLowerInvariant() == fld);
|
||||||
|
|
||||||
if (TheField == null)
|
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");
|
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");
|
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 != 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");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Sort", $"Sort array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,13 +221,13 @@ namespace AyaNova.Biz
|
|||||||
if (ValidFormFields != null)
|
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");
|
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
|
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
|
//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");
|
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 (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");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is not valid, only Custom fields can have types specified");
|
||||||
else
|
else
|
||||||
{//It is a custom field, is it a valid type value
|
{//It is a custom field, is it a valid type value
|
||||||
|
|||||||
@@ -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
|
//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
|
//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 { LtKey = "df", AyaObjectType = (int)AyaType.Widget });
|
||||||
l.Add(new ObjectField { Key = "WidgetName", PropertyName = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
l.Add(new ObjectField { LtKey = "WidgetName", FieldName = "Name", UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
||||||
l.Add(new ObjectField { Key = "WidgetSerial", PropertyName = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
l.Add(new ObjectField { LtKey = "WidgetSerial", FieldName = "Serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||||
l.Add(new ObjectField { Key = "WidgetDollarAmount", PropertyName = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency });
|
l.Add(new ObjectField { LtKey = "WidgetDollarAmount", FieldName = "DollarAmount", UiFieldDataType = (int)AyaUiFieldDataType.Currency });
|
||||||
l.Add(new ObjectField { Key = "WidgetCount", PropertyName = "Count", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
l.Add(new ObjectField { LtKey = "WidgetCount", FieldName = "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 { LtKey = "WidgetRoles", FieldName = "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 { LtKey = "WidgetStartDate", FieldName = "StartDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||||
l.Add(new ObjectField { Key = "WidgetEndDate", PropertyName = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
l.Add(new ObjectField { LtKey = "WidgetEndDate", FieldName = "EndDate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||||
l.Add(new ObjectField { Key = "WidgetNotes", PropertyName = "Notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
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
|
//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
|
//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 { LtKey = "User", FieldName = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User });
|
||||||
l.Add(new ObjectField { Key = "Active", PropertyName = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool, Hideable = false, SharedLTKey = true });
|
l.Add(new ObjectField { LtKey = "Active", FieldName = "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 = "Tags", FieldName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true });
|
||||||
|
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom1", PropertyName = "WidgetCustom1", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom1", FieldName = "WidgetCustom1", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom2", PropertyName = "WidgetCustom2", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom2", FieldName = "WidgetCustom2", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom3", PropertyName = "WidgetCustom3", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom3", FieldName = "WidgetCustom3", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom4", PropertyName = "WidgetCustom4", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom4", FieldName = "WidgetCustom4", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom5", PropertyName = "WidgetCustom5", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom5", FieldName = "WidgetCustom5", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom6", PropertyName = "WidgetCustom6", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom6", FieldName = "WidgetCustom6", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom7", PropertyName = "WidgetCustom7", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom7", FieldName = "WidgetCustom7", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom8", PropertyName = "WidgetCustom8", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom8", FieldName = "WidgetCustom8", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom9", PropertyName = "WidgetCustom9", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom9", FieldName = "WidgetCustom9", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom10", PropertyName = "WidgetCustom10", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom10", FieldName = "WidgetCustom10", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom11", PropertyName = "WidgetCustom11", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom11", FieldName = "WidgetCustom11", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom12", PropertyName = "WidgetCustom12", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom12", FieldName = "WidgetCustom12", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom13", PropertyName = "WidgetCustom13", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom13", FieldName = "WidgetCustom13", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom14", PropertyName = "WidgetCustom14", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom14", FieldName = "WidgetCustom14", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom15", PropertyName = "WidgetCustom15", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom15", FieldName = "WidgetCustom15", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "WidgetCustom16", PropertyName = "WidgetCustom16", Custom = true });
|
l.Add(new ObjectField { LtKey = "WidgetCustom16", FieldName = "WidgetCustom16", IsCustomField = true });
|
||||||
break;
|
break;
|
||||||
#endregion
|
#endregion
|
||||||
case USER_KEY:
|
case USER_KEY:
|
||||||
#region USER_KEY
|
#region USER_KEY
|
||||||
l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.User });
|
l.Add(new ObjectField { LtKey = "df", AyaObjectType = (int)AyaType.User });
|
||||||
l.Add(new ObjectField { Key = "Name", PropertyName = "Name", SharedLTKey = true, UiFieldDataType = (int)AyaUiFieldDataType.Text, Hideable = false });
|
l.Add(new ObjectField { LtKey = "Name", FieldName = "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 { LtKey = "UserEmployeeNumber", FieldName = "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 { LtKey = "AuthorizationRoles", FieldName = "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 { LtKey = "UserNotes", FieldName = "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 { LtKey = "UserUserType", FieldName = "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 { LtKey = "Active", FieldName = "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 = "Tags", FieldName = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags, SharedLTKey = true });
|
||||||
|
|
||||||
l.Add(new ObjectField { Key = "UserCustom1", PropertyName = "UserCustom1", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom1", FieldName = "UserCustom1", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom2", PropertyName = "UserCustom2", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom2", FieldName = "UserCustom2", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom3", PropertyName = "UserCustom3", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom3", FieldName = "UserCustom3", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom4", PropertyName = "UserCustom4", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom4", FieldName = "UserCustom4", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom5", PropertyName = "UserCustom5", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom5", FieldName = "UserCustom5", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom6", PropertyName = "UserCustom6", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom6", FieldName = "UserCustom6", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom7", PropertyName = "UserCustom7", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom7", FieldName = "UserCustom7", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom8", PropertyName = "UserCustom8", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom8", FieldName = "UserCustom8", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom9", PropertyName = "UserCustom9", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom9", FieldName = "UserCustom9", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom10", PropertyName = "UserCustom10", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom10", FieldName = "UserCustom10", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom11", PropertyName = "UserCustom11", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom11", FieldName = "UserCustom11", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom12", PropertyName = "UserCustom12", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom12", FieldName = "UserCustom12", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom13", PropertyName = "UserCustom13", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom13", FieldName = "UserCustom13", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom14", PropertyName = "UserCustom14", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom14", FieldName = "UserCustom14", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom15", PropertyName = "UserCustom15", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom15", FieldName = "UserCustom15", IsCustomField = true });
|
||||||
l.Add(new ObjectField { Key = "UserCustom16", PropertyName = "UserCustom16", Custom = true });
|
l.Add(new ObjectField { LtKey = "UserCustom16", FieldName = "UserCustom16", IsCustomField = true });
|
||||||
break;
|
break;
|
||||||
#endregion
|
#endregion
|
||||||
case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY:
|
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
|
l.Add(new ObjectField
|
||||||
{
|
{
|
||||||
Key = "WidgetName",
|
LtKey = "WidgetName",
|
||||||
PropertyName = "widgetname",
|
FieldName = "widgetname",
|
||||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||||
AyObjectType = (int)AyaType.Widget,
|
AyaObjectType = (int)AyaType.Widget,
|
||||||
SqlIdColumn = "awidget.id as widgetid",
|
SqlIdColumnName = "awidget.id as widgetid",
|
||||||
SqlDisplayColumn = "awidget.name as widgetname"
|
SqlDisplayColumnName = "awidget.name as widgetname"
|
||||||
});
|
});
|
||||||
l.Add(new ObjectField
|
l.Add(new ObjectField
|
||||||
{
|
{
|
||||||
Key = "User",
|
LtKey = "User",
|
||||||
PropertyName = "username",
|
FieldName = "username",
|
||||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||||
AyObjectType = (int)AyaType.User,
|
AyaObjectType = (int)AyaType.User,
|
||||||
SqlIdColumn = "userid",
|
SqlIdColumnName = "userid",
|
||||||
SqlDisplayColumn = "auser.name as username"
|
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;
|
break;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ So rename things and see what breaks I guess
|
|||||||
|
|
||||||
foreach (string s in fullFields)
|
foreach (string s in fullFields)
|
||||||
{
|
{
|
||||||
ObjectField o = fields.FirstOrDefault(x => x.Key == s);
|
ObjectField o = fields.FirstOrDefault(x => x.LtKey == s);
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
//Developers little helper
|
//Developers little helper
|
||||||
if (o == null)
|
if (o == null)
|
||||||
@@ -387,11 +387,11 @@ So rename things and see what breaks I guess
|
|||||||
sb.Append(",");
|
sb.Append(",");
|
||||||
sb.Append("{");
|
sb.Append("{");
|
||||||
//Build required part of column definition
|
//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)
|
//Has a AyObjectType? (linkable / openable)
|
||||||
if (o.AyObjectType != 0)
|
if (o.AyaObjectType != 0)
|
||||||
sb.Append($",\"ay\":{(int)o.AyObjectType}");
|
sb.Append($",\"ay\":{(int)o.AyaObjectType}");
|
||||||
|
|
||||||
sb.Append("}");
|
sb.Append("}");
|
||||||
|
|
||||||
@@ -408,13 +408,13 @@ So rename things and see what breaks I guess
|
|||||||
|
|
||||||
public class ObjectField
|
public class ObjectField
|
||||||
{
|
{
|
||||||
public string Key { get; set; }
|
public string LtKey { get; set; }
|
||||||
public string PropertyName { get; set; }
|
public string FieldName { get; set; }
|
||||||
public bool Hideable { get; set; }
|
public bool Hideable { get; set; }
|
||||||
public bool SharedLTKey { get; set; }
|
// public bool SharedLTKey { get; set; }
|
||||||
public bool Custom { get; set; }
|
public bool IsCustomField { get; set; }
|
||||||
public bool Filterable { get; set; }
|
public bool IsFilterable { get; set; }
|
||||||
public bool Sortable { get; set; }
|
public bool IsSortable { get; set; }
|
||||||
//had this but don't know why
|
//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
|
//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; }
|
//public bool MiniAvailable { get; set; }
|
||||||
@@ -423,12 +423,12 @@ So rename things and see what breaks I guess
|
|||||||
public string EnumType { get; set; }
|
public string EnumType { get; set; }
|
||||||
//if field is a reference to another object (i.e. a client in a workorders list)
|
//if field is a reference to another object (i.e. a client in a workorders list)
|
||||||
//then the type to open is set here
|
//then the type to open is set here
|
||||||
public int AyObjectType { get; set; }
|
public int AyaObjectType { get; set; }
|
||||||
|
|
||||||
//For query building
|
//For query building
|
||||||
//This is the equivalent of the v7 SqlColumnNameAttribute
|
//This is the equivalent of the v7 SqlColumnNameAttribute
|
||||||
public string SqlIdColumn { get; set; }
|
public string SqlIdColumnName { get; set; }
|
||||||
public string SqlDisplayColumn { get; set; }
|
public string SqlDisplayColumnName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ObjectField()
|
public ObjectField()
|
||||||
@@ -436,24 +436,24 @@ So rename things and see what breaks I guess
|
|||||||
//most common defaults
|
//most common defaults
|
||||||
SharedLTKey = false;
|
SharedLTKey = false;
|
||||||
Hideable = true;
|
Hideable = true;
|
||||||
Custom = false;
|
IsCustomField = false;
|
||||||
Filterable = true;
|
IsFilterable = true;
|
||||||
Sortable = true;
|
IsSortable = true;
|
||||||
//Set openable object type to no type which is the default and means it's not a link to another object
|
//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
|
//Get column to query for display name or use PropertyName if there is no difference
|
||||||
public string GetSqlDisplayColumnName()
|
public string GetSqlDisplayColumnName()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(SqlDisplayColumn))
|
if (string.IsNullOrEmpty(SqlDisplayColumnName))
|
||||||
{
|
{
|
||||||
return PropertyName.ToLowerInvariant();
|
return FieldName.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return SqlDisplayColumn;
|
return SqlDisplayColumnName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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"]}
|
// - 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
|
//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
|
//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 (!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
|
//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
|
//use reflection to get the underlying value from the proposed object to be saved
|
||||||
object propertyValue = proposedObject.GetType().GetProperty(RequiredPropertyName).GetValue(proposedObject, null);
|
object propertyValue = proposedObject.GetType().GetProperty(RequiredPropertyName).GetValue(proposedObject, null);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace AyaNova.Biz
|
|||||||
tagList = filterItem["value"].ToObject<List<String>>();
|
tagList = filterItem["value"].ToObject<List<String>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
var dataType = objectFields.Find(x => x.PropertyName.ToLowerInvariant() == fld).UiFieldDataType;
|
var dataType = objectFields.Find(x => x.FieldName.ToLowerInvariant() == fld).UiFieldDataType;
|
||||||
sb.Append("(");
|
sb.Append("(");
|
||||||
sb.Append(DataFilterToColumnCriteria(fld, (AyaUiFieldDataType)dataType, opType, val, tagList, userId));
|
sb.Append(DataFilterToColumnCriteria(fld, (AyaUiFieldDataType)dataType, opType, val, tagList, userId));
|
||||||
if (i < FilterArray.Count - 1)
|
if (i < FilterArray.Count - 1)
|
||||||
|
|||||||
@@ -37,25 +37,25 @@ namespace AyaNova.Biz
|
|||||||
sb.Append("SELECT ");
|
sb.Append("SELECT ");
|
||||||
|
|
||||||
//Default ID column for each row (always is aliased as df)
|
//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)
|
if (def == null)
|
||||||
{
|
{
|
||||||
throw new System.ArgumentNullException($"SqlSelectBuilder: objectFieldList for key \"{objectKey}\" is missing the df default field");
|
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
|
sb.Append("id");//default when no alternate column is specified
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.Append(def.SqlIdColumn);
|
sb.Append(def.SqlIdColumnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(" AS df");
|
sb.Append(" AS df");
|
||||||
|
|
||||||
foreach (string ColumnName in templateFieldList)
|
foreach (string ColumnName in templateFieldList)
|
||||||
{
|
{
|
||||||
ObjectField o = objectFieldsList.FirstOrDefault(x => x.Key == ColumnName);
|
ObjectField o = objectFieldsList.FirstOrDefault(x => x.LtKey == ColumnName);
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
//Developers little helper
|
//Developers little helper
|
||||||
if (o == null)
|
if (o == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user