This commit is contained in:
@@ -17,6 +17,8 @@ namespace AyaNova.DataList
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
|
||||
//workorder item expense
|
||||
+ "left join apmitemexpense on apmitem.id=apmitemexpense.pmitemid "
|
||||
+ "left join auser on (apmitemexpense.userid=auser.id) "
|
||||
|
||||
550
server/AyaNova/DataList/PMItemOutsideServiceDataList.cs
Normal file
550
server/AyaNova/DataList/PMItemOutsideServiceDataList.cs
Normal file
@@ -0,0 +1,550 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemOutsideServiceDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemOutsideServiceDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
|
||||
//workorder item outsideservice
|
||||
+ "left join apmitemoutsideservice on apmitem.id=apmitemoutsideservice.pmitemid "
|
||||
+ "left join aunit on (apmitemoutsideservice.unitid=aunit.id) "
|
||||
+ "left join avendor as vendto on (apmitemoutsideservice.vendorsenttoid=vendto.id) "
|
||||
+ "left join avendor as vendvia on (apmitemoutsideservice.vendorsentviaid=vendvia.id) "
|
||||
+ "left join ataxcode on (apmitemoutsideservice.taxcodeid=ataxcode.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemOutsideServiceUnit",
|
||||
"WorkOrderItemOutsideServiceVendorSentToID",
|
||||
"WorkOrderItemOutsideServiceDateSent",
|
||||
"WorkOrderItemOutsideServiceDateETA",
|
||||
"WorkOrderItemOutsideServiceDateReturned"
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemOutsideServiceDateSent", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
/*
|
||||
██████╗ ██╗ ██╗████████╗███████╗██╗██████╗ ███████╗ ███████╗███████╗██████╗ ██╗ ██╗██╗ ██████╗███████╗
|
||||
██╔═══██╗██║ ██║╚══██╔══╝██╔════╝██║██╔══██╗██╔════╝ ██╔════╝██╔════╝██╔══██╗██║ ██║██║██╔════╝██╔════╝
|
||||
██║ ██║██║ ██║ ██║ ███████╗██║██║ ██║█████╗ ███████╗█████╗ ██████╔╝██║ ██║██║██║ █████╗
|
||||
██║ ██║██║ ██║ ██║ ╚════██║██║██║ ██║██╔══╝ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║██║ ██╔══╝
|
||||
╚██████╔╝╚██████╔╝ ██║ ███████║██║██████╔╝███████╗ ███████║███████╗██║ ██║ ╚████╔╝ ██║╚██████╗███████╗
|
||||
╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝╚═════╝ ╚══════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═════╝╚══════╝
|
||||
*/
|
||||
|
||||
#region PMItemOutsideService fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Unit",
|
||||
FieldKey = "WorkOrderItemOutsideServiceUnit",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemOutsideService,
|
||||
SqlIdColumnName = "apmitemoutsideservice.id",
|
||||
SqlValueColumnName = "aunit.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceVendorSentToID",
|
||||
FieldKey = "WorkOrderItemOutsideServiceVendorSentToID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Vendor,
|
||||
SqlIdColumnName = "apmitemoutsideservice.vendorsenttoid",
|
||||
SqlValueColumnName = "vendto.name"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceVendorSentViaID",
|
||||
FieldKey = "WorkOrderItemOutsideServiceVendorSentViaID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Vendor,
|
||||
SqlIdColumnName = "apmitemoutsideservice.vendorsentviaid",
|
||||
SqlValueColumnName = "vendvia.name"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceRMANumber",
|
||||
FieldKey = "WorkOrderItemOutsideServiceRMANumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitemoutsideservice.rmanumber"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceTrackingNumber",
|
||||
FieldKey = "WorkOrderItemOutsideServiceTrackingNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitemoutsideservice.trackingnumber"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceDateSent",
|
||||
FieldKey = "WorkOrderItemOutsideServiceDateSent",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitemoutsideservice.SentDate"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceDateETA",
|
||||
FieldKey = "WorkOrderItemOutsideServiceDateETA",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitemoutsideservice.etadate"
|
||||
});
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceDateReturned",
|
||||
FieldKey = "WorkOrderItemOutsideServiceDateReturned",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitemoutsideservice.returndate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemOutsideServiceNotes",
|
||||
FieldKey = "WorkOrderItemOutsideServiceNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitemoutsideservice.notes"
|
||||
});
|
||||
|
||||
//Leaving dollar amounts off for now due to roles issue
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// TKey = "WorkOrderItemOutsideServiceRepairCost",
|
||||
// FieldKey = "WorkOrderItemOutsideServiceRepairCost",
|
||||
// UiFieldDataType = (int)UiFieldDataType.Currency,
|
||||
// SqlValueColumnName = "apmitemoutsideservice.repaircost"
|
||||
// });
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tax",
|
||||
FieldKey = "WorkOrderItemOutsideServiceTaxCode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.TaxCode,
|
||||
SqlIdColumnName = "apmitemoutsideservice.taxcodeid",
|
||||
SqlValueColumnName = "ataxcode.name"
|
||||
});
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metawoitemoutsideserviceid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemoutsideservice.id",
|
||||
SqlValueColumnName = "apmitemoutsideservice.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metawoitemoutsideserviceid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
570
server/AyaNova/DataList/PMItemPartDataList.cs
Normal file
570
server/AyaNova/DataList/PMItemPartDataList.cs
Normal file
@@ -0,0 +1,570 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemPartDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemPartDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//workorder item part
|
||||
+ "left join apmitempart on apmitem.id=apmitempart.pmitemid "
|
||||
+ "left join apart on (apmitempart.partid=apart.id) "
|
||||
+ "left join apartwarehouse on (apmitempart.partwarehouseid=apartwarehouse.id) "
|
||||
+ "left join ataxcode on (apmitempart.taxpartsaleid=ataxcode.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemPartPartID",
|
||||
"WorkOrderItemPartQuantity"
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemPartPartID", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
/*
|
||||
██████╗ █████╗ ██████╗ ████████╗███████╗
|
||||
██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔════╝
|
||||
██████╔╝███████║██████╔╝ ██║ ███████╗
|
||||
██╔═══╝ ██╔══██║██╔══██╗ ██║ ╚════██║
|
||||
██║ ██║ ██║██║ ██║ ██║ ███████║
|
||||
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝
|
||||
*/
|
||||
|
||||
#region PMItemPart fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartPartID",
|
||||
FieldKey = "WorkOrderItemPartPartID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemPart,
|
||||
SqlIdColumnName = "apmitempart.id",
|
||||
SqlValueColumnName = "apart.partnumber",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartPartWarehouseID",
|
||||
FieldKey = "WorkOrderItemPartPartWarehouseID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PartWarehouse,
|
||||
SqlIdColumnName = "apmitempart.partwarehouseid",
|
||||
SqlValueColumnName = "apartwarehouse.name"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartQuantity",
|
||||
FieldKey = "WorkOrderItemPartQuantity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apmitempart.quantity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartUPC",
|
||||
FieldKey = "PartUPC",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemPart,
|
||||
SqlIdColumnName = "apmitempart.id",
|
||||
SqlValueColumnName = "apart.upc"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartDescription",
|
||||
FieldKey = "WorkOrderItemPartDescription",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemPart,
|
||||
SqlIdColumnName = "apmitempart.id",
|
||||
SqlValueColumnName = "apmitempart.description"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PurchaseOrderItemSerialNumbers",
|
||||
FieldKey = "PurchaseOrderItemSerialNumbers",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemPart,
|
||||
SqlIdColumnName = "apmitempart.id",
|
||||
SqlValueColumnName = "apmitempart.serials"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartTaxPartSaleID",
|
||||
FieldKey = "WorkOrderItemPartTaxPartSaleID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.TaxCode,
|
||||
SqlIdColumnName = "apmitempart.taxpartsaleid",
|
||||
SqlValueColumnName = "ataxcode.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metawoitempartid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitempart.id",
|
||||
SqlValueColumnName = "apmitempart.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapart",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitempart.partid",
|
||||
SqlValueColumnName = "apmitempart.partid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metawoitempartid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
//This is an optional filter generated at client to restrict to particular item's workorders
|
||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
int nType = 0;
|
||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||
AyaType forType = (AyaType)nType;
|
||||
if (forType != AyaType.Part) return ret;//could be more later
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
if (lId == 0) return ret;
|
||||
|
||||
//Have valid type, have an id, so filter away
|
||||
switch (forType)
|
||||
{
|
||||
case AyaType.Part:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metapart" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
550
server/AyaNova/DataList/PMItemScheduledUserDataList.cs
Normal file
550
server/AyaNova/DataList/PMItemScheduledUserDataList.cs
Normal file
@@ -0,0 +1,550 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemScheduledUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemScheduledUserDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//scheduled users
|
||||
+ "left join apmitemscheduleduser on apmitem.id=apmitemscheduleduser.pmitemid "
|
||||
+ "left join auser on (apmitemscheduleduser.userid=auser.id) "
|
||||
+ "left join aservicerate on (apmitemscheduleduser.servicerateid=aservicerate.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemScheduledUserUserID",
|
||||
"WorkOrderItemScheduledUserStartDate",
|
||||
"WorkOrderItemScheduledUserStopDate",
|
||||
"WorkOrderItemScheduledUserServiceRateID",
|
||||
"WorkOrderItemScheduledUserEstimatedQuantity"
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemScheduledUserStartDate", "-" }, { "WorkOrderItemScheduledUserUserID", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
/*
|
||||
███████╗ ██████╗██╗ ██╗███████╗██████╗ ██╗ ██╗██╗ ███████╗██████╗ ██╗ ██╗███████╗███████╗██████╗ ███████╗
|
||||
██╔════╝██╔════╝██║ ██║██╔════╝██╔══██╗██║ ██║██║ ██╔════╝██╔══██╗ ██║ ██║██╔════╝██╔════╝██╔══██╗██╔════╝
|
||||
███████╗██║ ███████║█████╗ ██║ ██║██║ ██║██║ █████╗ ██║ ██║█████╗██║ ██║███████╗█████╗ ██████╔╝███████╗
|
||||
╚════██║██║ ██╔══██║██╔══╝ ██║ ██║██║ ██║██║ ██╔══╝ ██║ ██║╚════╝██║ ██║╚════██║██╔══╝ ██╔══██╗╚════██║
|
||||
███████║╚██████╗██║ ██║███████╗██████╔╝╚██████╔╝███████╗███████╗██████╔╝ ╚██████╔╝███████║███████╗██║ ██║███████║
|
||||
╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
|
||||
#region WorkOrderItemScheduledUser fields
|
||||
|
||||
//no natural text field for link opener so using every other field besides the linked ones instead
|
||||
//also considered just using the record id itself, still might do that if this is fucky
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemScheduledUserStartDate",
|
||||
FieldKey = "WorkOrderItemScheduledUserStartDate",
|
||||
AType = (int)AyaType.PMItemScheduledUser,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "apmitemscheduleduser.id",
|
||||
SqlValueColumnName = "apmitemscheduleduser.startdate",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemScheduledUserStopDate",
|
||||
FieldKey = "WorkOrderItemScheduledUserStopDate",
|
||||
AType = (int)AyaType.PMItemScheduledUser,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "apmitemscheduleduser.id",
|
||||
SqlValueColumnName = "apmitemscheduleduser.stopdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemScheduledUserUserID",
|
||||
FieldKey = "WorkOrderItemScheduledUserUserID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.User,
|
||||
SqlIdColumnName = "apmitemscheduleduser.userid",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemScheduledUserServiceRateID",
|
||||
FieldKey = "WorkOrderItemScheduledUserServiceRateID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.ServiceRate,
|
||||
SqlIdColumnName = "apmitemscheduleduser.servicerateid",
|
||||
SqlValueColumnName = "aservicerate.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemScheduledUserEstimatedQuantity",
|
||||
FieldKey = "WorkOrderItemScheduledUserEstimatedQuantity",
|
||||
AType = (int)AyaType.PMItemScheduledUser,
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlIdColumnName = "apmitemscheduleduser.id",
|
||||
SqlValueColumnName = "apmitemscheduleduser.estimatedquantity"
|
||||
});
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemscheduserid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemscheduleduser.id",
|
||||
SqlValueColumnName = "apmitemscheduleduser.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metauser",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemscheduleduser.userid",
|
||||
SqlValueColumnName = "apmitemscheduleduser.userid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metapmitemscheduserid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
//This is an optional filter generated at client to restrict to particular item's workorders
|
||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
int nType = 0;
|
||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||
AyaType forType = (AyaType)nType;
|
||||
if (forType != AyaType.User) return ret;//could be more later
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
if (lId == 0) return ret;
|
||||
|
||||
//Have valid type, have an id, so filter away
|
||||
switch (forType)
|
||||
{
|
||||
case AyaType.User:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metauser" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
503
server/AyaNova/DataList/PMItemTaskDataList.cs
Normal file
503
server/AyaNova/DataList/PMItemTaskDataList.cs
Normal file
@@ -0,0 +1,503 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemTaskDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemTaskDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//workorder item task
|
||||
+ "left join apmitemtask on apmitem.id=apmitemtask.pmitemid "
|
||||
+ "left join auser on (apmitemtask.completedbyuserid=auser.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemTaskTaskID",
|
||||
"WorkOrderItemTaskUser",
|
||||
"WorkOrderItemTaskWorkOrderItemTaskCompletionType",
|
||||
"WorkOrderItemTaskCompletedDate",
|
||||
"WorkOrderItemTaskSequence"
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemTaskSequence", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
/*
|
||||
████████╗ █████╗ ███████╗██╗ ██╗
|
||||
╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
|
||||
██║ ███████║███████╗█████╔╝
|
||||
██║ ██╔══██║╚════██║██╔═██╗
|
||||
██║ ██║ ██║███████║██║ ██╗
|
||||
╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
#region WorkOrderItemTask fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTaskTaskID",
|
||||
FieldKey = "WorkOrderItemTaskTaskID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemTask,
|
||||
SqlIdColumnName = "apmitemtask.id",
|
||||
SqlValueColumnName = "apmitemtask.task",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemTaskSequence",
|
||||
AType = (int)AyaType.PMItemTask,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitemtask.id",
|
||||
SqlValueColumnName = "apmitemtask.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTaskWorkOrderItemTaskCompletionType",
|
||||
FieldKey = "WorkOrderItemTaskWorkOrderItemTaskCompletionType",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(WorkorderItemTaskCompletionType).ToString()),
|
||||
SqlValueColumnName = "apmitemtask.status"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTaskUser",
|
||||
FieldKey = "WorkOrderItemTaskUser",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.User,
|
||||
SqlIdColumnName = "apmitemtask.completedbyuserid",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTaskCompletedDate",
|
||||
FieldKey = "WorkOrderItemTaskCompletedDate",
|
||||
AType = (int)AyaType.PMItemTask,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "apmitemtask.id",
|
||||
SqlValueColumnName = "apmitemtask.completeddate"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemtaskid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemtask.id",
|
||||
SqlValueColumnName = "apmitemtask.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metapmitemtaskid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
533
server/AyaNova/DataList/PMItemTravelDataList.cs
Normal file
533
server/AyaNova/DataList/PMItemTravelDataList.cs
Normal file
@@ -0,0 +1,533 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemTravelDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemTravelDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//workorder item travel
|
||||
+ "left join apmitemtravel on apmitem.id=apmitemtravel.pmitemid "
|
||||
+ "left join auser on (apmitemtravel.userid=auser.id) "
|
||||
+ "left join atravelrate on (apmitemtravel.travelrateid=atravelrate.id) "
|
||||
+ "left join ataxcode on (apmitemtravel.taxcodesaleid=ataxcode.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemTravelUserID",
|
||||
"WorkOrderItemTravelRateQuantity",
|
||||
"WorkOrderItemTravelServiceRateID"
|
||||
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemTravelUserID", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
/*
|
||||
████████╗██████╗ █████╗ ██╗ ██╗███████╗██╗
|
||||
╚══██╔══╝██╔══██╗██╔══██╗██║ ██║██╔════╝██║
|
||||
██║ ██████╔╝███████║██║ ██║█████╗ ██║
|
||||
██║ ██╔══██╗██╔══██║╚██╗ ██╔╝██╔══╝ ██║
|
||||
██║ ██║ ██║██║ ██║ ╚████╔╝ ███████╗███████╗
|
||||
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚══════╝
|
||||
*/
|
||||
#region WorkOrderItemTravel fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelUserID",
|
||||
FieldKey = "WorkOrderItemTravelUserID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemTravel,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelRateQuantity",
|
||||
FieldKey = "WorkOrderItemTravelRateQuantity",
|
||||
AType = (int)AyaType.PMItemTravel,
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "apmitemtravel.travelratequantity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelServiceRateID",
|
||||
FieldKey = "WorkOrderItemTravelServiceRateID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.TravelRate,
|
||||
SqlIdColumnName = "apmitemtravel.travelrateid",
|
||||
SqlValueColumnName = "atravelrate.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelStartDate",
|
||||
FieldKey = "WorkOrderItemTravelStartDate",
|
||||
AType = (int)AyaType.PMItemTravel,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "apmitemtravel.travelstartdate",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelStopDate",
|
||||
FieldKey = "WorkOrderItemTravelStopDate",
|
||||
AType = (int)AyaType.PMItemTravel,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "apmitemtravel.travelstopdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelDetails",
|
||||
FieldKey = "WorkOrderItemTravelDetails",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitemtravel.traveldetails"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelNoChargeQuantity",
|
||||
FieldKey = "WorkOrderItemTravelNoChargeQuantity",
|
||||
AType = (int)AyaType.PMItemTravel,
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "apmitemtravel.nochargequantity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTravelTaxRateSaleID",
|
||||
FieldKey = "WorkOrderItemTravelTaxRateSaleID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.TaxCode,
|
||||
SqlIdColumnName = "apmitemtravel.taxcodesaleid",
|
||||
SqlValueColumnName = "ataxcode.name"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemtravelid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemtravel.id",
|
||||
SqlValueColumnName = "apmitemtravel.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metapmitemtravelid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
536
server/AyaNova/DataList/PMItemUnitDataList.cs
Normal file
536
server/AyaNova/DataList/PMItemUnitDataList.cs
Normal file
@@ -0,0 +1,536 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PMItemUnitDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PMItemUnitDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.PM;
|
||||
SQLFrom = "from apm "
|
||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//workorder item unit
|
||||
+ "left join apmitemunit on apmitem.id=apmitemunit.pmitemid "
|
||||
+ "left join aunit on (apmitemunit.unitid=aunit.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"PMSerialNumber",
|
||||
"Customer",
|
||||
"PMNextServiceDate",
|
||||
"PMNextWoGenerateDate",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
//------
|
||||
"WorkOrderItemUnit",
|
||||
"WorkOrderItemUnitNotes"
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PMSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemUnit", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
/*
|
||||
██╗ ██╗███╗ ██╗██╗████████╗
|
||||
██║ ██║████╗ ██║██║╚══██╔══╝
|
||||
██║ ██║██╔██╗ ██║██║ ██║
|
||||
██║ ██║██║╚██╗██║██║ ██║
|
||||
╚██████╔╝██║ ╚████║██║ ██║
|
||||
╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
#region WorkOrderItemUnit fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Unit",
|
||||
FieldKey = "WorkOrderItemUnit",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemUnit,
|
||||
SqlIdColumnName = "apmitemunit.id",
|
||||
SqlValueColumnName = "aunit.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemUnitNotes",
|
||||
FieldKey = "WorkOrderItemUnitNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.PMItemUnit,
|
||||
SqlIdColumnName = "apmitemunit.id",
|
||||
SqlValueColumnName = "apmitemunit.notes"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom1", FieldKey = "workorderitemunitcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom2", FieldKey = "workorderitemunitcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom3", FieldKey = "workorderitemunitcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom4", FieldKey = "workorderitemunitcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom5", FieldKey = "workorderitemunitcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom6", FieldKey = "workorderitemunitcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom7", FieldKey = "workorderitemunitcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom8", FieldKey = "workorderitemunitcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom9", FieldKey = "workorderitemunitcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom10", FieldKey = "workorderitemunitcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom11", FieldKey = "workorderitemunitcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom12", FieldKey = "workorderitemunitcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom13", FieldKey = "workorderitemunitcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom14", FieldKey = "workorderitemunitcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom15", FieldKey = "workorderitemunitcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemUnitCustom16", FieldKey = "workorderitemunitcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitemunit.customfields", TKeySection = "WorkOrderItemUnit" });
|
||||
|
||||
|
||||
//META columns
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemunitid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemunit.id",
|
||||
SqlValueColumnName = "apmitemunit.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaunit",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitemunit.unitid",
|
||||
SqlValueColumnName = "apmitemunit.unitid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region PMItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.PMItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apmitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apmitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "apmitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apmitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apmitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apmitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metapmitemid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "apmitem.id",
|
||||
SqlValueColumnName = "apmitem.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PM
|
||||
*/
|
||||
#region PM Header fields
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMSerialNumber",
|
||||
FieldKey = "PMSerialNumber",
|
||||
AType = (int)AyaType.PM,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "apm.id",
|
||||
SqlValueColumnName = "apm.serial",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMStopGeneratingDate",
|
||||
FieldKey = "PMStopGeneratingDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.stopgeneratingdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "pmactive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextServiceDate",
|
||||
FieldKey = "PMNextServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.nextservicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PMNextWoGenerateDate",
|
||||
FieldKey = "PMNextWoGenerateDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "apm.generatedate"
|
||||
});
|
||||
//----------
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apm.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Project,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.customercontactname"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "apm.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "apm.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "apm.longitude"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apm.customfields" });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metapmitemunitid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
//This is an optional filter generated at client to restrict to particular item's workorders
|
||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
int nType = 0;
|
||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||
AyaType forType = (AyaType)nType;
|
||||
if (forType != AyaType.Unit) return ret;//could be more later
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
if (lId == 0) return ret;
|
||||
|
||||
//Have valid type, have an id, so filter away
|
||||
switch (forType)
|
||||
{
|
||||
case AyaType.Unit:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaunit" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user