diff --git a/server/AyaNova/biz/AyaFieldData.cs b/server/AyaNova/biz/AyaFieldData.cs index 0a6cbb45..c2379822 100644 --- a/server/AyaNova/biz/AyaFieldData.cs +++ b/server/AyaNova/biz/AyaFieldData.cs @@ -9,7 +9,7 @@ namespace AyaNova.Biz public class AyaFieldData { public object v { get; set; } - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm public long? Id { get; set; } } } \ No newline at end of file diff --git a/server/AyaNova/biz/AyaObjectFieldDefinitions.cs b/server/AyaNova/biz/AyaObjectFieldDefinitions.cs index 0335b982..e6b81f4e 100644 --- a/server/AyaNova/biz/AyaObjectFieldDefinitions.cs +++ b/server/AyaNova/biz/AyaObjectFieldDefinitions.cs @@ -221,7 +221,7 @@ namespace AyaNova.Biz #endregion case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY: #region TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY - + l.Add(new AyaObjectFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" }); l.Add(new AyaObjectFieldDefinition { @@ -281,12 +281,12 @@ namespace AyaNova.Biz //Accept a json template //return a column list suitable for api list return - public static string GenerateListColumnsJSONFromTemplate(AyaType defaultLinkType, List objectFields, string template) + public static string GenerateListColumnsJSONFromTemplate(AyaType defaultLinkType, List objectFields, string template) { //parse the template var jtemplate = JObject.Parse(template); - + //convert to strings (https://stackoverflow.com/a/33836599/8939) var fullFields = ((JArray)jtemplate["full"]).ToObject(); @@ -304,7 +304,7 @@ namespace AyaNova.Biz //Developers little helper if (o == null) { - throw new System.ArgumentNullException($"DEV ERROR in objectFields::GenerateListColumnsJSONFromTemplate - field {s} specified in template was NOT found in ObjectFields list for key \"{ObjectKey}\""); + throw new System.ArgumentNullException($"DEV ERROR in objectFields::GenerateListColumnsJSONFromTemplate - field {s} specified in template was NOT found in ObjectFields list"); } #endif diff --git a/server/AyaNova/biz/SqlSelectBuilder.cs b/server/AyaNova/biz/SqlSelectBuilder.cs index 1e8b9fe5..6a3d9d34 100644 --- a/server/AyaNova/biz/SqlSelectBuilder.cs +++ b/server/AyaNova/biz/SqlSelectBuilder.cs @@ -13,13 +13,13 @@ namespace AyaNova.Biz { //Build the SELECT portion of a list query based on the template, mini or full and the object key in question - public static string Build( List objectFieldsList, string template, bool mini) + public static string Build(List objectFieldsList, string template, bool mini) { //parse the template var jtemplate = JObject.Parse(template); - + //convert to strings array (https://stackoverflow.com/a/33836599/8939) string[] templateFieldList; if (mini) @@ -38,7 +38,7 @@ namespace AyaNova.Biz 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"); + throw new System.ArgumentNullException("SqlSelectBuilder: objectFieldList is missing the df default field"); } if (string.IsNullOrEmpty(def.SqlIdColumnName)) { @@ -58,7 +58,7 @@ namespace AyaNova.Biz //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 for key \"{objectKey}\""); + throw new System.ArgumentNullException($"DEV ERROR in SqlSelectBuilder.cs: field {ColumnName} specified in template was NOT found in ObjectFields list"); } #endif if (o != null) diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 26df7fcd..fd535b49 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -467,8 +467,7 @@ namespace AyaNova.Biz } - //RETURN OBJECTS - //get the return row object count (number of items in each return row) + //RETURN OBJECTS int returnRowCount = AyaObjectFields.Count(); List> rows = new List>(); long totalRecordCount = 0; @@ -478,6 +477,8 @@ namespace AyaNova.Biz { ct.Database.OpenConnection(); + + //GET DATA RETURN ROWS command.CommandText = qDataQuery; using (var dr = command.ExecuteReader()) { @@ -496,11 +497,11 @@ namespace AyaNova.Biz d.Id = dr.GetInt64(dr.GetOrdinal(f.SqlIdColumnName)); } } - rows.Add(row); } } + //GET TOTAL RECORD COUNT command.CommandText = qTotalRecordsQuery; using (var dr = command.ExecuteReader()) { @@ -514,7 +515,7 @@ namespace AyaNova.Biz //TODO: Build the return object in a clean format //I could just use a actual object class to return (object v {get;set;}) //with a optional ID that is set to json not serialize if null? - //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm +