This commit is contained in:
42
server/PickList/AyaPickListFieldDefinition.cs
Normal file
42
server/PickList/AyaPickListFieldDefinition.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Sockeye.Biz;
|
||||
using Newtonsoft.Json;
|
||||
namespace Sockeye.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 TKey { get; set; }
|
||||
// Used for casting query
|
||||
public UiFieldDataType ColumnDataType { get; set; }
|
||||
public bool IsRowId { get; set; }//both indicates is row ID but also that it's required as the only required field. Not technically necessary maybe but to prevent foot shooting.
|
||||
public bool IsActiveColumn { 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user