556 lines
31 KiB
C#
556 lines
31 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
using AyaNova.Models;
|
|
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class PMItemOutsideServiceDataList : DataListProcessingBase, IDataListInternalCriteria
|
|
{
|
|
public PMItemOutsideServiceDataList(long translationId)
|
|
{
|
|
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"
|
|
});
|
|
|
|
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 = "WorkOrderItemTags",
|
|
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.WorkOrderItemPriority,
|
|
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"
|
|
});
|
|
|
|
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 = "AddressPostal",
|
|
FieldKey = "workorderaddresspostal",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apm.addresspostal"
|
|
});
|
|
|
|
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 |