This commit is contained in:
2020-12-29 01:02:08 +00:00
parent de9d096ed3
commit fc6527b027
3 changed files with 186 additions and 1 deletions

View File

@@ -0,0 +1,128 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TaxCodeDataList : AyaDataList
{
public TaxCodeDataList()
{
DefaultListObjectType = AyaType.TaxCode;
SQLFrom = "from ataxcode";
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
//Default ListView
dynamic dlistView = new JArray();
dynamic cm = new JObject();
cm.fld = "Name";
cm.sort = "+";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "TaxCodeTaxA";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "TaxCodeTaxB";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "TaxCodeTaxOnTax";
dlistView.Add(cm);
cm = new JObject();
cm.fld = "Active";
dlistView.Add(cm);
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
FieldDefinitions = new List<AyaDataListFieldDefinition>();
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "Name",
FieldKey = "Name",
AyaObjectType = (int)AyaType.TaxCode,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "ataxcode.id",
SqlValueColumnName = "ataxcode.name",
IsRowId = true
});
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "TaxCodeNotes",
FieldKey = "TaxCodeNotes",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "ataxcode.notes"
});
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "Active",
FieldKey = "Active",
UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "ataxcode.active"
});
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "Tags",
FieldKey = "Tags",
UiFieldDataType = (int)UiFieldDataType.Tags,
SqlValueColumnName = "ataxcode.tags"
});
//------------
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "TaxCodeTaxA",
FieldKey = "TaxCodeTaxA",
UiFieldDataType = (int)UiFieldDataType.Percentage,
SqlValueColumnName = "ataxcode.taxa"
});
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "TaxCodeTaxB",
FieldKey = "TaxCodeTaxB",
UiFieldDataType = (int)UiFieldDataType.Percentage,
SqlValueColumnName = "ataxcode.taxb"
});
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "TaxCodeTaxOnTax",
FieldKey = "TaxCodeTaxOnTax",
UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "ataxcode.taxontax"
});
//-----------
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom1", FieldKey = "TaxCodecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom2", FieldKey = "TaxCodecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom3", FieldKey = "TaxCodecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom4", FieldKey = "TaxCodecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom5", FieldKey = "TaxCodecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom6", FieldKey = "TaxCodecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom7", FieldKey = "TaxCodecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom8", FieldKey = "TaxCodecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom9", FieldKey = "TaxCodecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom10", FieldKey = "TaxCodecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom11", FieldKey = "TaxCodecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom12", FieldKey = "TaxCodecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom13", FieldKey = "TaxCodecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom14", FieldKey = "TaxCodecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom15", FieldKey = "TaxCodecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TaxCodeCustom16", FieldKey = "TaxCodecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
}
}//eoc
}//eons

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.PickList
{
internal class TaxCodePickList : AyaPickList
{
public TaxCodePickList()
{
DefaultListObjectType = AyaType.TaxCode;
SQLFrom = "from ataxcode";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();
cm.fld = "Name";
dTemplate.Add(cm);
cm = new JObject();
cm.fld = "Tags";
dTemplate.Add(cm);
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Active",
FieldKey = "Active",
ColumnDataType = UiFieldDataType.Bool,
SqlValueColumnName = "ataxcode.active",
IsActiveColumn = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Name",
FieldKey = "Name",
ColumnDataType = UiFieldDataType.Text,
SqlIdColumnName = "ataxcode.id",
SqlValueColumnName = "ataxcode.name",
IsRowId = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Tags",
FieldKey = "Tags",
ColumnDataType = UiFieldDataType.Tags,
SqlValueColumnName = "ataxcode.tags"
});
}
}//eoc
}//eons

View File

@@ -22,6 +22,7 @@ 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
TimeSpan=15,
PhoneNumber=16,//this is so client can dial directly,
Roles = 17//for grid display (users),
Roles = 17,//for grid display (users),
Percentage = 18
}
}