This commit is contained in:
2020-12-18 19:31:24 +00:00
parent 4e51e45e95
commit ddee772f08
8 changed files with 32 additions and 11 deletions

View File

@@ -25,7 +25,7 @@ namespace AyaNova.DataList
cm.fld = "ayatype"; cm.fld = "ayatype";
dlistView.Add(cm); dlistView.Add(cm);
cm = new JObject(); cm = new JObject();
cm.fld = "ayatypeex"; cm.fld = "ayatypeex";
dlistView.Add(cm); dlistView.Add(cm);
@@ -81,6 +81,7 @@ namespace AyaNova.DataList
}); });
FieldDefinitions.Add(new AyaDataListFieldDefinition FieldDefinitions.Add(new AyaDataListFieldDefinition
{ {
TKey = "AyaType", TKey = "AyaType",

View File

@@ -47,7 +47,7 @@ namespace AyaNova.DataList
[JsonIgnore] [JsonIgnore]
public string SqlValueColumnName { get; set; } public string SqlValueColumnName { get; set; }
[JsonIgnore] [JsonIgnore]
public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType for this field to set it dynamically instead of preset public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType openabel for this field to set it dynamically instead of preset
@@ -62,7 +62,7 @@ namespace AyaNova.DataList
IsMeta = false; IsMeta = false;
//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
AyaObjectType = (int)AyaType.NoType; AyaObjectType = (int)AyaType.NoType;
SqlAyTypeColumnName=string.Empty; SqlAyTypeColumnName=null;//must be null as that is checked against specifically
} }

View File

@@ -181,8 +181,15 @@ namespace AyaNova.DataList
var ordinal = SelectBuild.map[f.SqlIdColumnName]; var ordinal = SelectBuild.map[f.SqlIdColumnName];
if (!await dr.IsDBNullAsync(ordinal)) if (!await dr.IsDBNullAsync(ordinal))
AyaField.i = dr.GetInt64(ordinal); AyaField.i = dr.GetInt64(ordinal);
} }
if (f.SqlAyTypeColumnName != null)
{
var ordinal = SelectBuild.map[f.SqlAyTypeColumnName];
if (!await dr.IsDBNullAsync(ordinal))
AyaField.ot = dr.GetInt32(ordinal);
}
row.Add(AyaField); row.Add(AyaField);
} }
} }

View File

@@ -111,6 +111,8 @@ namespace AyaNova.DataList
//this is indicated by this column being an id type //this is indicated by this column being an id type
//and by the comparison operator being eq or neq //and by the comparison operator being eq or neq
//and the value being a number not a string //and the value being a number not a string
//NOTE: This is not actually used anywhere at the client or on server, only defined here in this class
//it was probabaly for supporting filtering by ID but I have found that unnecessary so far
if (DataListField.HasIdColumn() && IsPossibleIdValue && (opType == DataListFilterComparisonOperator.Equality || opType == DataListFilterComparisonOperator.NotEqual)) if (DataListField.HasIdColumn() && IsPossibleIdValue && (opType == DataListFilterComparisonOperator.Equality || opType == DataListFilterComparisonOperator.NotEqual))
{ {
columnNameToFilter = DataListField.SqlIdColumnName; columnNameToFilter = DataListField.SqlIdColumnName;

View File

@@ -1,11 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System;
using System.Globalization;
using System.Text; using System.Text;
using Newtonsoft.Json.Linq;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace AyaNova.DataList namespace AyaNova.DataList
{ {
@@ -81,6 +76,20 @@ namespace AyaNova.DataList
map.Add(idColumnName, nOrdinal++); map.Add(idColumnName, nOrdinal++);
} }
} }
//does it also have an openable AyaType column?
var ayaTypeColumnName = o.SqlAyTypeColumnName;
if (!string.IsNullOrWhiteSpace(ayaTypeColumnName))
{
if (!map.ContainsKey(ayaTypeColumnName))
{
if (firstColumnAdded)
sb.Append(", ");
sb.Append(ayaTypeColumnName);
firstColumnAdded = true;
map.Add(ayaTypeColumnName, nOrdinal++);
}
}
} }
} }
} }

View File

@@ -74,7 +74,7 @@ namespace AyaNova.DataList
UiFieldDataType = (int)UiFieldDataType.Enum, UiFieldDataType = (int)UiFieldDataType.Enum,
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()), EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
SqlValueColumnName = "aevent.ayatype", SqlValueColumnName = "aevent.ayatype",
SqlIdColumnName = "aevent.ayid"//Test to see if can make this column openable SqlIdColumnName = "aevent.ayid"
}); });
FieldDefinitions.Add(new AyaDataListFieldDefinition FieldDefinitions.Add(new AyaDataListFieldDefinition

View File

@@ -13,5 +13,7 @@ namespace AyaNova.Biz
public long? i { get; set; } public long? i { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
public bool? rid { get; set; } public bool? rid { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] //https://www.newtonsoft.com/json/help/html/JsonPropertyPropertyLevelSetting.htm
public int? ot { get; set; }
} }
} }

View File

@@ -22,6 +22,6 @@ namespace AyaNova.Biz
MemorySize = 14,//this is so client can convert what would normally be an Integer type to human readable file / ram size value MemorySize = 14,//this is so client can convert what would normally be an Integer type to human readable file / ram size value
TimeSpan=15, TimeSpan=15,
PhoneNumber=16,//this is so client can dial directly, PhoneNumber=16,//this is so client can dial directly,
Roles = 17//for grid display (users) Roles = 17//for grid display (users),
} }
} }