diff --git a/server/AyaNova/DataList/DataListFetcher.cs b/server/AyaNova/DataList/DataListFetcher.cs index 3497f086..9dcce8d4 100644 --- a/server/AyaNova/DataList/DataListFetcher.cs +++ b/server/AyaNova/DataList/DataListFetcher.cs @@ -190,6 +190,13 @@ namespace AyaNova.DataList AyaField.ot = dr.GetInt32(ordinal); } + if (f.SqlColorColumnName != null) + { + var ordinal = SelectBuild.map[f.SqlColorColumnName]; + if (!await dr.IsDBNullAsync(ordinal)) + AyaField.clr = dr.GetInt32(ordinal); + } + row.Add(AyaField); } } diff --git a/server/AyaNova/DataList/DataListSqlSelectBuilder.cs b/server/AyaNova/DataList/DataListSqlSelectBuilder.cs index fa0fd89b..cd612d91 100644 --- a/server/AyaNova/DataList/DataListSqlSelectBuilder.cs +++ b/server/AyaNova/DataList/DataListSqlSelectBuilder.cs @@ -90,6 +90,20 @@ namespace AyaNova.DataList map.Add(ayaTypeColumnName, nOrdinal++); } } + + //does it also have a Color column? + var ayaColorColumnName = o.SqlColorColumnName; + if (!string.IsNullOrWhiteSpace(ayaColorColumnName)) + { + if (!map.ContainsKey(ayaColorColumnName)) + { + if (firstColumnAdded) + sb.Append(", "); + sb.Append(ayaColorColumnName); + firstColumnAdded = true; + map.Add(ayaColorColumnName, nOrdinal++); + } + } } } } diff --git a/server/AyaNova/DataList/ReminderDataList.cs b/server/AyaNova/DataList/ReminderDataList.cs index 83ff3cbc..6939738c 100644 --- a/server/AyaNova/DataList/ReminderDataList.cs +++ b/server/AyaNova/DataList/ReminderDataList.cs @@ -79,6 +79,7 @@ namespace AyaNova.DataList UiFieldDataType = (int)UiFieldDataType.Text, SqlIdColumnName = "areminder.id", SqlValueColumnName = "areminder.name", + SqlColorColumnName = "areminder.color", IsRowId = true }); @@ -107,7 +108,7 @@ namespace AyaNova.DataList SqlValueColumnName = "areminder.stopdate" }); - FieldDefinitions.Add(new AyaDataListFieldDefinition + FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderColor", FieldKey = "ReminderColor", diff --git a/server/AyaNova/biz/AyaFieldData.cs b/server/AyaNova/biz/AyaFieldData.cs index 4a9dd8ba..3a2e6a9d 100644 --- a/server/AyaNova/biz/AyaFieldData.cs +++ b/server/AyaNova/biz/AyaFieldData.cs @@ -8,12 +8,14 @@ namespace AyaNova.Biz { public class AyaFieldData { - public object v { get; set; } + public object v { get; set; }//v for vvvvvvvv? [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm - public long? i { get; set; } + public long? i { get; set; }//id value [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm - public bool? rid { get; set; } + public bool? rid { get; set; } //row id for opening entire row by one field id [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm - public int? ot { get; set; } + public int? ot { get; set; }//openable type + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm + public int? clr { get; set; }//color } } \ No newline at end of file