Service bank feature removed from front, back and e2e testing mostly commented out in case need to add back again but in some places such as db schema it had to be removed entirely so refer here if adding back in again
290 lines
14 KiB
C#
290 lines
14 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class CustomerDataList : DataListProcessingBase
|
|
{
|
|
public CustomerDataList()
|
|
{
|
|
DefaultListAType = AyaType.Customer;
|
|
SQLFrom = "from acustomer left join aheadoffice on (acustomer.headofficeid=aheadoffice.id) left join acontract on (acustomer.contractid=acontract.id)";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "customername", "customerphone1", "customeremail", "customerheadoffice" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "customername", "+" } };
|
|
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerName",
|
|
FieldKey = "customername",
|
|
AType = (int)AyaType.Customer,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "acustomer.id",
|
|
SqlValueColumnName = "acustomer.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerNotes",
|
|
FieldKey = "customernotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "customeractive",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "acustomer.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "customertags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "acustomer.tags"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WebAddress",
|
|
FieldKey = "customerwebaddress",
|
|
UiFieldDataType = (int)UiFieldDataType.HTTP,
|
|
SqlValueColumnName = "acustomer.webaddress"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPopUpNotes",
|
|
FieldKey = "customerpopupnotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.popupnotes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "HeadOffice",
|
|
FieldKey = "customerheadoffice",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.HeadOffice,
|
|
SqlIdColumnName = "aheadoffice.id",
|
|
SqlValueColumnName = "aheadoffice.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerBillHeadOffice",
|
|
FieldKey = "customerbillheadoffice",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "acustomer.billheadoffice"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerTechNotes",
|
|
FieldKey = "customertechnotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.technotes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerAccountNumber",
|
|
FieldKey = "customeraccountnumber",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.accountnumber"
|
|
});
|
|
|
|
// FieldDefinitions.Add(new DataListFieldDefinition
|
|
// {
|
|
// TKey = "UsesBanking",
|
|
// FieldKey = "customerusesbanking",
|
|
// UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
// SqlValueColumnName = "acustomer.usesbanking"
|
|
// });
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Contract",
|
|
FieldKey = "customercontract",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.Contract,
|
|
SqlIdColumnName = "acontract.id",
|
|
SqlValueColumnName = "acontract.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "ContractExpires",
|
|
FieldKey = "customercontractexpires",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "acustomer.contractexpires"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPhone1",
|
|
FieldKey = "customerphone1",
|
|
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
|
SqlValueColumnName = "acustomer.phone1"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPhone2",
|
|
FieldKey = "customerphone2",
|
|
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
|
SqlValueColumnName = "acustomer.phone2"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPhone3",
|
|
FieldKey = "customerphone3",
|
|
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
|
SqlValueColumnName = "acustomer.phone3"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPhone4",
|
|
FieldKey = "customerphone4",
|
|
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
|
SqlValueColumnName = "acustomer.phone4"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerPhone5",
|
|
FieldKey = "customerphone5",
|
|
UiFieldDataType = (int)UiFieldDataType.PhoneNumber,
|
|
SqlValueColumnName = "acustomer.phone5"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "CustomerEmail",
|
|
FieldKey = "customeremail",
|
|
UiFieldDataType = (int)UiFieldDataType.EmailAddress,
|
|
SqlValueColumnName = "acustomer.emailaddress"
|
|
});
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressPostalDeliveryAddress",
|
|
FieldKey = "customerpostaddress",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.postaddress"
|
|
});
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressPostalCity",
|
|
FieldKey = "customerpostcity",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.postcity"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressPostalStateProv",
|
|
FieldKey = "customerpostregion",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.postregion"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressPostalCountry",
|
|
FieldKey = "customerpostcountry",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.postcountry"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressPostalPostal",
|
|
FieldKey = "customerpostcode",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.postcode"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressDeliveryAddress",
|
|
FieldKey = "customeraddress",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.address"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressCity",
|
|
FieldKey = "customercity",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.city"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressStateProv",
|
|
FieldKey = "customerregion",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.region"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressCountry",
|
|
FieldKey = "customercountry",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "acustomer.country"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressLatitude",
|
|
FieldKey = "customerlatitude",
|
|
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
|
SqlValueColumnName = "acustomer.latitude"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AddressLongitude",
|
|
FieldKey = "customerlongitude",
|
|
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
|
SqlValueColumnName = "acustomer.longitude"
|
|
});
|
|
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom1", FieldKey = "customercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom2", FieldKey = "customercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom3", FieldKey = "customercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom4", FieldKey = "customercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom5", FieldKey = "customercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom6", FieldKey = "customercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom7", FieldKey = "customercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom8", FieldKey = "customercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom9", FieldKey = "customercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom10", FieldKey = "customercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom11", FieldKey = "customercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom12", FieldKey = "customercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom13", FieldKey = "customercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom14", FieldKey = "customercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom15", FieldKey = "customercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "CustomerCustom16", FieldKey = "customercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
|
}
|
|
|
|
|
|
|
|
}//eoc
|
|
}//eons |