43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using AyaNova.Biz;
|
|
using Newtonsoft.Json;
|
|
namespace AyaNova.PickList
|
|
{
|
|
//This class defines a field used for pick list templating querying processing editing and returning
|
|
public class AyaPickListFieldDefinition
|
|
{
|
|
//CLIENT / SERVER Unique identifier used at BOTH client and server
|
|
//also the sql displaycolumnname if identical
|
|
public string FieldKey { get; set; }
|
|
//CLIENT Use only for display
|
|
public string LtKey { get; set; }
|
|
// Used for casting query
|
|
public UiFieldDataType ColumnDataType { get; set; }
|
|
public bool IsRowId { get; set; }
|
|
public bool IsActiveColumn { get; set; }
|
|
public AyaType AyaObjectType { get; set; }
|
|
[JsonIgnore]
|
|
public string SqlIdColumnName { get; set; }
|
|
[JsonIgnore]
|
|
public string SqlValueColumnName { get; set; }
|
|
|
|
public AyaPickListFieldDefinition()
|
|
{
|
|
//most common defaults
|
|
IsRowId = false;
|
|
IsActiveColumn = false;
|
|
}
|
|
|
|
//Get column to query for display name or use FieldName if there is no difference
|
|
public string GetSqlValueColumnName()
|
|
{
|
|
if (string.IsNullOrEmpty(SqlValueColumnName))
|
|
{
|
|
return FieldKey.ToLowerInvariant();
|
|
}
|
|
else
|
|
{
|
|
return SqlValueColumnName;
|
|
}
|
|
}
|
|
}
|
|
} |