This commit is contained in:
136
server/AyaNova/DataList/ServiceRateDataList.cs
Normal file
136
server/AyaNova/DataList/ServiceRateDataList.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class ServiceRateDataList : AyaDataList
|
||||
{
|
||||
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);
|
||||
|
||||
|
||||
//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.ServiceRate,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aservicerate.id",
|
||||
SqlValueColumnName = "aservicerate.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Notes",
|
||||
FieldKey = "Notes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aservicerate.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "Active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aservicerate.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aservicerate.tags"
|
||||
});
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateAccountNumber",
|
||||
FieldKey = "RateAccountNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aservicerate.accountnumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Cost",
|
||||
FieldKey = "Cost",
|
||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
||||
SqlValueColumnName = "aservicerate.cost"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateCharge",
|
||||
FieldKey = "RateCharge",
|
||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
||||
SqlValueColumnName = "aservicerate.charge"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateUnitChargeDescriptionID",
|
||||
FieldKey = "RateUnitChargeDescriptionID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aservicerate.unit"
|
||||
});
|
||||
|
||||
//-----------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom1", FieldKey = "ServiceRatecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom2", FieldKey = "ServiceRatecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom3", FieldKey = "ServiceRatecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom4", FieldKey = "ServiceRatecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom5", FieldKey = "ServiceRatecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom6", FieldKey = "ServiceRatecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom7", FieldKey = "ServiceRatecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom8", FieldKey = "ServiceRatecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom9", FieldKey = "ServiceRatecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom10", FieldKey = "ServiceRatecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom11", FieldKey = "ServiceRatecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom12", FieldKey = "ServiceRatecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom13", FieldKey = "ServiceRatecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom14", FieldKey = "ServiceRatecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom15", FieldKey = "ServiceRatecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ServiceRateCustom16", FieldKey = "ServiceRatecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aservicerate.customfields" });
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
136
server/AyaNova/DataList/TravelRateDataList.cs
Normal file
136
server/AyaNova/DataList/TravelRateDataList.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TravelRateDataList : AyaDataList
|
||||
{
|
||||
public TravelRateDataList()
|
||||
{
|
||||
DefaultListObjectType = AyaType.TravelRate;
|
||||
SQLFrom = "from atravelrate";
|
||||
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);
|
||||
|
||||
|
||||
//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.TravelRate,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "atravelrate.id",
|
||||
SqlValueColumnName = "atravelrate.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Notes",
|
||||
FieldKey = "Notes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "atravelrate.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "Active",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "atravelrate.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "atravelrate.tags"
|
||||
});
|
||||
|
||||
|
||||
//------------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateAccountNumber",
|
||||
FieldKey = "RateAccountNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "atravelrate.accountnumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Cost",
|
||||
FieldKey = "Cost",
|
||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
||||
SqlValueColumnName = "atravelrate.cost"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateCharge",
|
||||
FieldKey = "RateCharge",
|
||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
||||
SqlValueColumnName = "atravelrate.charge"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "RateUnitChargeDescriptionID",
|
||||
FieldKey = "RateUnitChargeDescriptionID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "atravelrate.unit"
|
||||
});
|
||||
|
||||
//-----------
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom1", FieldKey = "TravelRatecustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom2", FieldKey = "TravelRatecustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom3", FieldKey = "TravelRatecustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom4", FieldKey = "TravelRatecustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom5", FieldKey = "TravelRatecustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom6", FieldKey = "TravelRatecustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom7", FieldKey = "TravelRatecustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom8", FieldKey = "TravelRatecustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom9", FieldKey = "TravelRatecustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom10", FieldKey = "TravelRatecustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom11", FieldKey = "TravelRatecustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom12", FieldKey = "TravelRatecustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom13", FieldKey = "TravelRatecustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom14", FieldKey = "TravelRatecustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom15", FieldKey = "TravelRatecustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "TravelRateCustom16", FieldKey = "TravelRatecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "atravelrate.customfields" });
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
@@ -553,8 +553,6 @@ namespace AyaNova.Biz
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "RateCharge", FieldKey = "RateCharge" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "RateUnitChargeDescriptionID", FieldKey = "RateUnitChargeDescriptionID" });
|
||||
|
||||
|
||||
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "ServiceRateCustom1", FieldKey = "ServiceRateCustom1", IsCustomField = true });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "ServiceRateCustom2", FieldKey = "ServiceRateCustom2", IsCustomField = true });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "ServiceRateCustom3", FieldKey = "ServiceRateCustom3", IsCustomField = true });
|
||||
@@ -592,8 +590,6 @@ namespace AyaNova.Biz
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "RateCharge", FieldKey = "RateCharge" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "RateUnitChargeDescriptionID", FieldKey = "RateUnitChargeDescriptionID" });
|
||||
|
||||
|
||||
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "TravelRateCustom1", FieldKey = "TravelRateCustom1", IsCustomField = true });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "TravelRateCustom2", FieldKey = "TravelRateCustom2", IsCustomField = true });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "TravelRateCustom3", FieldKey = "TravelRateCustom3", IsCustomField = true });
|
||||
|
||||
Reference in New Issue
Block a user