case 4208
This commit is contained in:
@@ -10,19 +10,19 @@ namespace AyaNova.DataList
|
||||
public PMItemUnitDataList(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) "
|
||||
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) "
|
||||
;
|
||||
//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;
|
||||
@@ -111,6 +111,15 @@ namespace AyaNova.DataList
|
||||
SqlIdColumnName = "apmitemunit.unitid",
|
||||
SqlValueColumnName = "apmitemunit.unitid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaunitmodel",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "aunit.unitmodelid",
|
||||
SqlValueColumnName = "aunit.unitmodelid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
@@ -505,11 +514,11 @@ namespace AyaNova.DataList
|
||||
//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
|
||||
if (forType != AyaType.Unit && forType != AyaType.UnitModel) return ret;
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
@@ -525,6 +534,13 @@ namespace AyaNova.DataList
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
case AyaType.UnitModel:
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaunitmodel" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user