Files
raven/server/AyaNova/DataList/TaxCodeDataList.cs
2021-01-29 21:31:09 +00:00

130 lines
7.5 KiB
C#

using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TaxCodeDataList : DataListProcessingBase
{
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);
DefaultColumns = new List<string>() { "Name", "TaxCodeTaxA", "TaxCodeTaxB", "TaxCodeTaxOnTax", "Active" };
DefaultSortBy = new Dictionary<string, string>() { { "Name", "+" } };
//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<DataListFieldDefinition>();
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "Name",
FieldKey = "Name",
AyaObjectType = (int)AyaType.TaxCode,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "ataxcode.id",
SqlValueColumnName = "ataxcode.name",
IsRowId = true
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "TaxCodeNotes",
FieldKey = "TaxCodeNotes",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "ataxcode.notes"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "Active",
FieldKey = "Active",
UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "ataxcode.active"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "Tags",
FieldKey = "Tags",
UiFieldDataType = (int)UiFieldDataType.Tags,
SqlValueColumnName = "ataxcode.tags"
});
//------------
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "TaxCodeTaxA",
FieldKey = "TaxCodeTaxA",
UiFieldDataType = (int)UiFieldDataType.Decimal,
SqlValueColumnName = "ataxcode.taxa"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "TaxCodeTaxB",
FieldKey = "TaxCodeTaxB",
UiFieldDataType = (int)UiFieldDataType.Decimal,
SqlValueColumnName = "ataxcode.taxb"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "TaxCodeTaxOnTax",
FieldKey = "TaxCodeTaxOnTax",
UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "ataxcode.taxontax"
});
//-----------
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom1", FieldKey = "TaxCodecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom2", FieldKey = "TaxCodecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom3", FieldKey = "TaxCodecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom4", FieldKey = "TaxCodecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom5", FieldKey = "TaxCodecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom6", FieldKey = "TaxCodecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom7", FieldKey = "TaxCodecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom8", FieldKey = "TaxCodecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom9", FieldKey = "TaxCodecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom10", FieldKey = "TaxCodecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom11", FieldKey = "TaxCodecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom12", FieldKey = "TaxCodecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom13", FieldKey = "TaxCodecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom14", FieldKey = "TaxCodecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom15", FieldKey = "TaxCodecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "TaxCodeCustom16", FieldKey = "TaxCodecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "ataxcode.customfields" });
}
}//eoc
}//eons