This commit is contained in:
@@ -8,7 +8,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
DefaultListAType = AyaType.WorkOrder;
|
||||
SQLFrom = "from aworkorder "
|
||||
// + "left join lateral (select id, workorderstatusid, workorderid from aworkorderstate st where workorderid = aworkorder.id order by st.id DESC limit 1) st on aworkorder.id=st.workorderid "
|
||||
+ "left join aworkorderitem on aworkorder.id=aworkorderitem.workorderid "
|
||||
+ "left join aworkorderstatus on (aworkorder.laststatusid = aworkorderstatus.id) "
|
||||
+ "left join acustomer on (aworkorder.customerid=acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid=aheadoffice.id) "
|
||||
@@ -16,10 +16,28 @@ namespace AyaNova.DataList
|
||||
+ "left join acontract on (aworkorder.contractid=acontract.id)";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() { "WorkOrderSerialNumber", "Customer", "WorkOrderServiceDate", "WorkOrderCloseByDate", "WorkOrderStatus" };
|
||||
DefaultColumns = new List<string>() { "WorkOrderItemSummary", "WorkOrderSerialNumber", "Customer", "WorkOrderServiceDate" };
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "WorkOrderSerialNumber", "-" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
|
||||
|
||||
#region WorkOrderItem fields
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.WorkOrderItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aworkorderitem.id",
|
||||
SqlValueColumnName = "aworkorderitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region WorkOrder Header fields
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSerialNumber",
|
||||
@@ -27,8 +45,7 @@ namespace AyaNova.DataList
|
||||
AType = (int)AyaType.WorkOrder,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "aworkorder.id",
|
||||
SqlValueColumnName = "aworkorder.serial",
|
||||
IsRowId = true
|
||||
SqlValueColumnName = "aworkorder.serial"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
@@ -58,7 +75,7 @@ namespace AyaNova.DataList
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderStatus,
|
||||
SqlIdColumnName = "aworkorder.laststatusid",
|
||||
SqlColorColumnName = "aworkorderstatus.color",
|
||||
SqlColorColumnName = "aworkorderstatus.color",
|
||||
SqlValueColumnName = "aworkorderstatus.name"
|
||||
});
|
||||
|
||||
@@ -265,39 +282,6 @@ namespace AyaNova.DataList
|
||||
SqlValueColumnName = "aworkorder.closebydate"
|
||||
});
|
||||
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// TKey = "XXXX",
|
||||
// FieldKey = "XXXX",
|
||||
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
// SqlValueColumnName = "aworkorder.internalreferencenumber"
|
||||
// });
|
||||
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// FieldKey = "WorkOrderWorkOrderOverseerID",
|
||||
// TKey = "WorkOrderWorkOrderOverseerID",
|
||||
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
// AType = (int)AyaType.User,
|
||||
// SqlIdColumnName = "auser.id",
|
||||
// SqlValueColumnName = "auser.name"
|
||||
// });
|
||||
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// TKey = "WorkOrderDateStarted",
|
||||
// FieldKey = "WorkOrderDateStarted",
|
||||
// UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
// SqlValueColumnName = "aworkorder.datestarted"
|
||||
// });
|
||||
|
||||
// FieldDefinitions.Add(new DataListFieldDefinition
|
||||
// {
|
||||
// TKey = "WorkOrderDateCompleted",
|
||||
// FieldKey = "WorkOrderDateCompleted",
|
||||
// UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
// SqlValueColumnName = "aworkorder.datecompleted"
|
||||
// });
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
@@ -315,6 +299,8 @@ namespace AyaNova.DataList
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
|
||||
#endregion
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user