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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,22 +10,22 @@ namespace AyaNova.DataList
|
||||
public QuoteItemUnitDataList(long translationId)
|
||||
{
|
||||
DefaultListAType = AyaType.Quote;
|
||||
SQLFrom = "from aquote "
|
||||
+ "left join aquotestatus on (aquote.laststatusid = aquotestatus.id) "
|
||||
+ "left join acustomer on (aquote.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (aquote.projectid = aproject.id) "
|
||||
+ "left join auser as aprepuser on (aquote.preparedbyid = aprepuser.id) "
|
||||
+ "left join acontract on (aquote.contractid = acontract.id)"
|
||||
+ "left join aquoteitem on aquote.id=aquoteitem.quoteid "
|
||||
+ "left join aworkorderitemstatus on (aquoteitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (aquoteitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
SQLFrom = "from aquote "
|
||||
+ "left join aquotestatus on (aquote.laststatusid = aquotestatus.id) "
|
||||
+ "left join acustomer on (aquote.customerid = acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||
+ "left join aproject on (aquote.projectid = aproject.id) "
|
||||
+ "left join auser as aprepuser on (aquote.preparedbyid = aprepuser.id) "
|
||||
+ "left join acontract on (aquote.contractid = acontract.id)"
|
||||
+ "left join aquoteitem on aquote.id=aquoteitem.quoteid "
|
||||
+ "left join aworkorderitemstatus on (aquoteitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (aquoteitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
|
||||
//workorder item unit
|
||||
+ "left join aquoteitemunit on aquoteitem.id=aquoteitemunit.quoteitemid "
|
||||
+ "left join aunit on (aquoteitemunit.unitid=aunit.id) "
|
||||
;
|
||||
//workorder item unit
|
||||
+ "left join aquoteitemunit on aquoteitem.id=aquoteitemunit.quoteitemid "
|
||||
+ "left join aunit on (aquoteitemunit.unitid=aunit.id) "
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
@@ -114,6 +114,16 @@ namespace AyaNova.DataList
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaunitmodel",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "aunit.unitmodelid",
|
||||
SqlValueColumnName = "aunit.unitmodelid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -528,11 +538,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;
|
||||
@@ -548,6 +558,14 @@ 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;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,15 @@ namespace AyaNova.DataList
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metaunitmodel",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "aunit.unitmodelid",
|
||||
SqlValueColumnName = "aunit.unitmodelid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -535,7 +544,7 @@ namespace AyaNova.DataList
|
||||
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;//could be more later
|
||||
|
||||
long lId = 0;
|
||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||
@@ -551,6 +560,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