This commit is contained in:
@@ -47,7 +47,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ayaType">The AyaType object type to select from</param>
|
/// <param name="ayaType">The AyaType object type to select from</param>
|
||||||
/// <param name="query">The query to filter the returned list by</param>
|
/// <param name="query">The query to filter the returned list by</param>
|
||||||
/// <returns>Filtered list (maximum 25 items are returned for any query)</returns>
|
/// <returns>Filtered list</returns>
|
||||||
[HttpGet("List")]
|
[HttpGet("List")]
|
||||||
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query)
|
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query)
|
||||||
{
|
{
|
||||||
@@ -92,13 +92,11 @@ namespace AyaNova.Api.Controllers
|
|||||||
//Instantiate the business object handler
|
//Instantiate the business object handler
|
||||||
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
|
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
|
||||||
|
|
||||||
|
|
||||||
long TranslationId = UserTranslationIdFromContext.Id(HttpContext.Items);
|
long TranslationId = UserTranslationIdFromContext.Id(HttpContext.Items);
|
||||||
var o = biz.GetListOfAllPickListTypes(TranslationId);
|
var o = biz.GetListOfAllPickListTypes(TranslationId);
|
||||||
if (o == null)
|
if (o == null)
|
||||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(o, true));
|
return Ok(ApiOkResponse.Response(o, true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ namespace AyaNova.PickList
|
|||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
|
|
||||||
|
TODO: build a sql select and order by and a where clause that searches appropriately in each field (tags)
|
||||||
|
//it should return results based on the query where there is a single name (display) column and an id column for rowid
|
||||||
|
//and the fields should be combined in a standard way separated by spaces "Widget widgetserial username" for compactness
|
||||||
|
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
// sb.Append("SELECT ");
|
// sb.Append("SELECT ");
|
||||||
|
|
||||||
|
|||||||
@@ -12,49 +12,22 @@ namespace AyaNova.PickList
|
|||||||
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id)";
|
SQLFrom = "from awidget left outer join auser on (awidget.userid=auser.id)";
|
||||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
|
|
||||||
//Default ListView
|
//Default template
|
||||||
dynamic dlistView = new JArray();
|
dynamic dTemplate = new JArray();
|
||||||
|
|
||||||
dynamic cm = new JObject();
|
dynamic cm = new JObject();
|
||||||
cm.fld = "widgetname";
|
cm.fld = "widgetname";
|
||||||
dlistView.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "widgetserial";
|
cm.fld = "widgetserial";
|
||||||
dlistView.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "widgetdollaramount";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "widgetusertype";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "widgetstartdate";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "widgetactive";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "username";
|
cm.fld = "username";
|
||||||
dlistView.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
DefaultTemplate = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DefaultPickListView = @"
|
|
||||||
// {
|
|
||||||
// [{key:""COLUMN UNIQUE KEY ID",sort:"-" or "+",filter:{any:true/false,items:[{FILTER OBJECT SEE BELOW}]} }, {key:"second column unique key"},{...etc...}]
|
|
||||||
|
|
||||||
// ""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetusertype"",""widgetstartdate"",""widgetactive"",""username""],
|
|
||||||
|
|
||||||
// }
|
|
||||||
// ";
|
|
||||||
|
|
||||||
//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
|
//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<AyaPickListFieldDefinition>();
|
FieldDefinitions = new List<AyaPickListFieldDefinition>();
|
||||||
@@ -70,6 +43,7 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "awidget.name",
|
SqlValueColumnName = "awidget.name",
|
||||||
IsRowId = true
|
IsRowId = true
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "WidgetSerial",
|
LtKey = "WidgetSerial",
|
||||||
@@ -77,51 +51,7 @@ namespace AyaNova.PickList
|
|||||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||||
SqlValueColumnName = "awidget.serial"
|
SqlValueColumnName = "awidget.serial"
|
||||||
});
|
});
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetDollarAmount",
|
|
||||||
FieldKey = "widgetdollaramount",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
||||||
SqlValueColumnName = "awidget.dollaramount"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetCount",
|
|
||||||
FieldKey = "widgetcount",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
|
||||||
SqlValueColumnName = "awidget.count"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetUserType",
|
|
||||||
FieldKey = "widgetusertype",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
|
||||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
|
||||||
SqlValueColumnName = "awidget.usertype"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetStartDate",
|
|
||||||
FieldKey = "widgetstartdate",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
||||||
SqlValueColumnName = "awidget.startdate"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetEndDate",
|
|
||||||
FieldKey = "widgetenddate",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
||||||
SqlValueColumnName = "awidget.enddate"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "WidgetNotes",
|
|
||||||
FieldKey = "widgetnotes",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
||||||
SqlValueColumnName = "awidget.notes"
|
|
||||||
});
|
|
||||||
|
|
||||||
//FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "User", FieldKey = "userid", UiFieldDataType = (int)AyaUiFieldDataType.Text, AyaObjectType = (int)AyaType.User });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
FieldKey = "username",
|
FieldKey = "username",
|
||||||
@@ -131,13 +61,7 @@ namespace AyaNova.PickList
|
|||||||
SqlIdColumnName = "auser.id",
|
SqlIdColumnName = "auser.id",
|
||||||
SqlValueColumnName = "auser.name"
|
SqlValueColumnName = "auser.name"
|
||||||
});
|
});
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
|
||||||
{
|
|
||||||
LtKey = "Active",
|
|
||||||
FieldKey = "widgetactive",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
||||||
SqlValueColumnName = "awidget.active"
|
|
||||||
});
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "Tags",
|
LtKey = "Tags",
|
||||||
@@ -146,22 +70,6 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "awidget.tags"
|
SqlValueColumnName = "awidget.tags"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom4", FieldKey = "widgetcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom6", FieldKey = "widgetcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom8", FieldKey = "widgetcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom10", FieldKey = "widgetcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom12", FieldKey = "widgetcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom14", FieldKey = "widgetcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition { LtKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
||||||
}
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user