This commit is contained in:
@@ -238,7 +238,7 @@ namespace AyaNova.DataList
|
||||
// break;
|
||||
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] IN STRING");
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "DataListSqlFilterCriteriaBuilder unhandled operator type [" + sOperator + "] IN STRING");
|
||||
|
||||
}
|
||||
#endregion build text ops criteria
|
||||
@@ -264,7 +264,7 @@ namespace AyaNova.DataList
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] in BOOL");
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "DataListSqlFilterCriteriaBuilder unhandled operator type [" + sOperator + "] in BOOL");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -644,7 +644,7 @@ namespace AyaNova.DataList
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("TOKEN", sOperator, "GridToSqlCriteria invalid filter TOKEN type [" + sValue + "] IN DATE_TIME");
|
||||
throw new System.ArgumentOutOfRangeException("TOKEN", sOperator, "DataListSqlFilterCriteriaBuilder invalid filter TOKEN type [" + sValue + "] IN DATE_TIME");
|
||||
|
||||
//-----
|
||||
}
|
||||
@@ -709,7 +709,7 @@ namespace AyaNova.DataList
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] IN DATE_TIME");
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "DataListSqlFilterCriteriaBuilder unhandled operator type [" + sOperator + "] IN DATE_TIME");
|
||||
|
||||
|
||||
}
|
||||
@@ -775,7 +775,7 @@ namespace AyaNova.DataList
|
||||
sb.Append(sValue);
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "GridToSqlCriteria unhandled operator type [" + sOperator + "] IN NUMBER");
|
||||
throw new System.ArgumentOutOfRangeException("OPERATOR_TYPE", sOperator, "DataListSqlFilterCriteriaBuilder unhandled operator type [" + sOperator + "] IN NUMBER");
|
||||
|
||||
|
||||
}
|
||||
@@ -800,7 +800,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException("DATA_TYPE", DataType, "GridToSqlCriteria unhandled data type[" + DataType + "]");
|
||||
throw new System.ArgumentOutOfRangeException("DATA_TYPE", DataType, "DataListSqlFilterCriteriaBuilder unhandled data type[" + DataType + "]");
|
||||
}
|
||||
#endregion
|
||||
}//end of nonnull path
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace AyaNova.DataList
|
||||
AyaDataListFieldDefinition def = objectFieldsList.FirstOrDefault(x => x.FieldKey == "df");
|
||||
if (def == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("SqlSelectBuilder: objectFieldList is missing the df default field");
|
||||
throw new System.ArgumentNullException("DataListSqlSelectBuilder: objectFieldList is missing the df default field");
|
||||
}
|
||||
if (string.IsNullOrEmpty(def.SqlIdColumnName))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace AyaNova.DataList
|
||||
//Developers little helper
|
||||
if (o == null)
|
||||
{
|
||||
throw new System.ArgumentNullException($"DEV ERROR in SqlSelectBuilder.cs: field {ColumnName} specified in template was NOT found in ObjectFields list");
|
||||
throw new System.ArgumentNullException($"DEV ERROR in DataListSqlSelectBuilder.cs: field {ColumnName} specified in template was NOT found in ObjectFields list");
|
||||
}
|
||||
#endif
|
||||
if (o != null)
|
||||
|
||||
@@ -12,17 +12,68 @@ namespace AyaNova.DataList
|
||||
AllowedRoles = AuthorizationRoles.AllInternalStaff;//anyone but clients and subcontractors (just for test)
|
||||
DefaultListObjectType = AyaType.Widget;
|
||||
|
||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
||||
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.Widget });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetName", FieldKey = "name", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetSerial", FieldKey = "serial", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetDollarAmount", FieldKey = "dollaramount", UiFieldDataType = (int)AyaUiFieldDataType.Currency });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCount", FieldKey = "count", UiFieldDataType = (int)AyaUiFieldDataType.Integer });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetRoles", FieldKey = "roles", UiFieldDataType = (int)AyaUiFieldDataType.Enum, EnumType = typeof(AuthorizationRoles).ToString() });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetStartDate", FieldKey = "startdate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetEndDate", FieldKey = "enddate", UiFieldDataType = (int)AyaUiFieldDataType.DateTime });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetNotes", FieldKey = "notes", UiFieldDataType = (int)AyaUiFieldDataType.Text });
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetName",
|
||||
FieldKey = "widgetname",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||
SqlIdColumnName = "awidget.id",
|
||||
SqlValueColumnName = "awidget.name"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetSerial",
|
||||
FieldKey = "widgetserial",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Integer,
|
||||
SqlValueColumnName = "awidget.serial"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetDollarAmount",
|
||||
FieldKey = "widgetdollaramount",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Currency,
|
||||
SqlValueColumnName = "awidget.dollaramount"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetCount",
|
||||
FieldKey = "widgetcount",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Integer,
|
||||
SqlValueColumnName = "awidget.count"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetRoles",
|
||||
FieldKey = "widgetroles",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Enum,
|
||||
EnumType = typeof(AuthorizationRoles).ToString(),
|
||||
SqlValueColumnName = "awidget.roles"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetStartDate",
|
||||
FieldKey = "widgetstartdate",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "awidget.startdate"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetEndDate",
|
||||
FieldKey = "widgetenddate",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "awidget.enddate"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetNotes",
|
||||
FieldKey = "widgetnotes",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||
SqlValueColumnName = "awidget.notes"
|
||||
});
|
||||
|
||||
//FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "User", FieldKey = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
@@ -33,8 +84,20 @@ namespace AyaNova.DataList
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "Active", FieldKey = "Active", UiFieldDataType = (int)AyaUiFieldDataType.Bool });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "Tags", FieldKey = "Tags", UiFieldDataType = (int)AyaUiFieldDataType.Tags });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "Active",
|
||||
FieldKey = "widgetactive",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Bool,
|
||||
SqlValueColumnName = "awidget.active"
|
||||
});
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "Tags",
|
||||
FieldKey = "widgettags",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Tags,
|
||||
SqlValueColumnName = "awidget.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true });
|
||||
|
||||
@@ -277,10 +277,11 @@ namespace AyaNova.Biz
|
||||
internal async Task<ApiPagedResponse> GetList(IUrlHelper Url, string routeName, ListOptions listOptions)
|
||||
{
|
||||
|
||||
//TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
|
||||
//TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
|
||||
|
||||
var MOCK_WIDGET_DISPLAY_TEMPLATE_JSON = @"
|
||||
{
|
||||
""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetroles"",""widgetstartdate"",""active"",""username""],
|
||||
""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetroles"",""widgetstartdate"",""widgetactive"",""username""],
|
||||
""mini"":[""widgetname"",""widgetserial""]
|
||||
}
|
||||
";
|
||||
|
||||
Reference in New Issue
Block a user