137 lines
7.9 KiB
C#
137 lines
7.9 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class ServiceRateDataList : DataListProcessingBase
|
|
{
|
|
public ServiceRateDataList()
|
|
{
|
|
DefaultListObjectType = AyaType.ServiceRate;
|
|
SQLFrom = "from aservicerate";
|
|
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 = "Cost";
|
|
// dlistView.Add(cm);
|
|
|
|
// cm = new JObject();
|
|
// cm.fld = "RateCharge";
|
|
// dlistView.Add(cm);
|
|
|
|
// cm = new JObject();
|
|
// cm.fld = "RateUnitChargeDescriptionID";
|
|
// dlistView.Add(cm);
|
|
|
|
// cm = new JObject();
|
|
// cm.fld = "Active";
|
|
// dlistView.Add(cm);
|
|
|
|
// DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
|
|
|
|
|
DefaultColumns = new List<string>() { "Name", "Cost", "RateCharge", "RateUnitChargeDescriptionID", "Active" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "Name", "+" } };
|
|
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Name",
|
|
FieldKey = "Name",
|
|
AyaObjectType = (int)AyaType.ServiceRate,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "aservicerate.id",
|
|
SqlValueColumnName = "aservicerate.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "ServiceRateNotes",
|
|
FieldKey = "ServiceRateNotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "aservicerate.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "Active",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "aservicerate.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "Tags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "aservicerate.tags"
|
|
});
|
|
|
|
|
|
//------------
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "RateAccountNumber",
|
|
FieldKey = "RateAccountNumber",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "aservicerate.accountnumber"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Cost",
|
|
FieldKey = "Cost",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aservicerate.cost"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "RateCharge",
|
|
FieldKey = "RateCharge",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "aservicerate.charge"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "RateUnitChargeDescriptionID",
|
|
FieldKey = "RateUnitChargeDescriptionID",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "aservicerate.unit"
|
|
});
|
|
|
|
//-----------
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom1", FieldKey = "ServiceRatecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom2", FieldKey = "ServiceRatecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom3", FieldKey = "ServiceRatecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom4", FieldKey = "ServiceRatecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom5", FieldKey = "ServiceRatecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom6", FieldKey = "ServiceRatecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom7", FieldKey = "ServiceRatecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom8", FieldKey = "ServiceRatecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom9", FieldKey = "ServiceRatecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom10", FieldKey = "ServiceRatecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom11", FieldKey = "ServiceRatecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom12", FieldKey = "ServiceRatecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom13", FieldKey = "ServiceRatecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom14", FieldKey = "ServiceRatecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom15", FieldKey = "ServiceRatecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "ServiceRateCustom16", FieldKey = "ServiceRatecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
|
}
|
|
}//eoc
|
|
}//eons |