This commit is contained in:
116
server/AyaNova/biz/FormAvailableFields.cs
Normal file
116
server/AyaNova/biz/FormAvailableFields.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
public static class FormAvailableFields
|
||||
{
|
||||
private const string WIDGET = "widget";
|
||||
public static List<string> AvailableFormKeys
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> l = new List<string>{
|
||||
WIDGET//,USER_CRUD, WIDGET etc
|
||||
};
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValidFormKey(string key)
|
||||
{
|
||||
return AvailableFormKeys.Contains(key);
|
||||
}
|
||||
|
||||
public static List<FormField> FormFields(string key)
|
||||
{
|
||||
|
||||
List<FormField> l = new List<FormField>();
|
||||
switch (key)
|
||||
{
|
||||
case WIDGET:
|
||||
/*"Widget":"Widget",
|
||||
"WidgetList":"Widgets",
|
||||
"WidgetName":"Name",
|
||||
"WidgetSerial":"Serial #",
|
||||
"WidgetDollarAmount":"Price",
|
||||
"WidgetCount":"Count",
|
||||
"WidgetRoles":"Roles",
|
||||
"WidgetStartDate":"Start",
|
||||
"WidgetEndDate":"End",
|
||||
"WidgetNotes":"Notes",
|
||||
"WidgetCustom1": "Custom1",
|
||||
"WidgetCustom2": "Custom2",
|
||||
"WidgetCustom3": "Custom3",
|
||||
"WidgetCustom4": "Custom4",
|
||||
"WidgetCustom5": "Custom5",
|
||||
"WidgetCustom6": "Custom6",
|
||||
"WidgetCustom7": "Custom7",
|
||||
"WidgetCustom8": "Custom8",
|
||||
"WidgetCustom9": "Custom9",
|
||||
"WidgetCustom10": "Custom10",
|
||||
"WidgetCustom11": "Custom11",
|
||||
"WidgetCustom12": "Custom12",
|
||||
"WidgetCustom13": "Custom13",
|
||||
"WidgetCustom14": "Custom14",
|
||||
"WidgetCustom15": "Custom15",
|
||||
"WidgetCustom16": "Custom16", */
|
||||
|
||||
l.Add(new FormField("WidgetName", false, false));//is not shared localized text key and not hideable as it is in the validation rules for widget
|
||||
l.Add(new FormField("WidgetSerial"));//not in validation rules...you get the idea
|
||||
l.Add(new FormField("WidgetDollarAmount"));
|
||||
l.Add(new FormField("WidgetCount"));
|
||||
l.Add(new FormField("WidgetRoles"));
|
||||
l.Add(new FormField("WidgetStartDate", false, false));
|
||||
l.Add(new FormField("WidgetEndDate", false, false));
|
||||
l.Add(new FormField("WidgetNotes"));
|
||||
l.Add(new FormField("CommonActive", true));
|
||||
l.Add(new FormField("Tags", true));
|
||||
l.Add(new FormField("WidgetCustom1", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom2", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom3", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom4", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom5", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom6", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom7", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom8", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom9", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom10", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom11", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom12", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom13", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom14", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom15", false, true, true));
|
||||
l.Add(new FormField("WidgetCustom16", false, true, true));
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new System.ArgumentOutOfRangeException($"FormAvailableFields: {key} is not a valid form key");
|
||||
|
||||
|
||||
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}//eoc FormAvailableFields
|
||||
|
||||
public class FormField
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public bool Hideable { get; set; }
|
||||
public bool SharedLTKey { get; set; }
|
||||
public bool Custom { get; set; }
|
||||
public FormField(string key, bool sharedLTKey = false, bool hideable = true, bool custom = false)
|
||||
{
|
||||
Key = key;
|
||||
Hideable = hideable;
|
||||
Custom = custom;
|
||||
SharedLTKey = sharedLTKey;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}//ens
|
||||
Reference in New Issue
Block a user