case 4208
This commit is contained in:
@@ -10,19 +10,19 @@ namespace AyaNova.DataList
|
|||||||
public PMItemUnitDataList(long translationId)
|
public PMItemUnitDataList(long translationId)
|
||||||
{
|
{
|
||||||
DefaultListAType = AyaType.PM;
|
DefaultListAType = AyaType.PM;
|
||||||
SQLFrom = "from apm "
|
SQLFrom = "from apm "
|
||||||
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
+ "left join acustomer on (apm.customerid = acustomer.id) "
|
||||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||||
+ "left join aproject on (apm.projectid = aproject.id) "
|
+ "left join aproject on (apm.projectid = aproject.id) "
|
||||||
+ "left join acontract on (apm.contractid = acontract.id)"
|
+ "left join acontract on (apm.contractid = acontract.id)"
|
||||||
+ "left join apmitem on apm.id=apmitem.pmid "
|
+ "left join apmitem on apm.id=apmitem.pmid "
|
||||||
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
+ "left join aworkorderitemstatus on (apmitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||||
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
+ "left join aworkorderitempriority on (apmitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||||
|
|
||||||
//workorder item unit
|
//workorder item unit
|
||||||
+ "left join apmitemunit on apmitem.id=apmitemunit.pmitemid "
|
+ "left join apmitemunit on apmitem.id=apmitemunit.pmitemid "
|
||||||
+ "left join aunit on (apmitemunit.unitid=aunit.id) "
|
+ "left join aunit on (apmitemunit.unitid=aunit.id) "
|
||||||
;
|
;
|
||||||
|
|
||||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
@@ -111,6 +111,15 @@ namespace AyaNova.DataList
|
|||||||
SqlIdColumnName = "apmitemunit.unitid",
|
SqlIdColumnName = "apmitemunit.unitid",
|
||||||
SqlValueColumnName = "apmitemunit.unitid",
|
SqlValueColumnName = "apmitemunit.unitid",
|
||||||
IsMeta = true
|
IsMeta = true
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new DataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "metaunitmodel",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||||
|
SqlIdColumnName = "aunit.unitmodelid",
|
||||||
|
SqlValueColumnName = "aunit.unitmodelid",
|
||||||
|
IsMeta = true
|
||||||
});
|
});
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -505,11 +514,11 @@ namespace AyaNova.DataList
|
|||||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||||
if (crit.Length > 1)
|
if (crit.Length > 1)
|
||||||
{
|
{
|
||||||
int nType = 0;
|
int nType = 0;
|
||||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||||
AyaType forType = (AyaType)nType;
|
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;
|
long lId = 0;
|
||||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||||
@@ -525,6 +534,13 @@ namespace AyaNova.DataList
|
|||||||
ret.Add(FilterOption);
|
ret.Add(FilterOption);
|
||||||
}
|
}
|
||||||
break;
|
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)
|
public QuoteItemUnitDataList(long translationId)
|
||||||
{
|
{
|
||||||
DefaultListAType = AyaType.Quote;
|
DefaultListAType = AyaType.Quote;
|
||||||
SQLFrom = "from aquote "
|
SQLFrom = "from aquote "
|
||||||
+ "left join aquotestatus on (aquote.laststatusid = aquotestatus.id) "
|
+ "left join aquotestatus on (aquote.laststatusid = aquotestatus.id) "
|
||||||
+ "left join acustomer on (aquote.customerid = acustomer.id) "
|
+ "left join acustomer on (aquote.customerid = acustomer.id) "
|
||||||
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
|
||||||
+ "left join aproject on (aquote.projectid = aproject.id) "
|
+ "left join aproject on (aquote.projectid = aproject.id) "
|
||||||
+ "left join auser as aprepuser on (aquote.preparedbyid = aprepuser.id) "
|
+ "left join auser as aprepuser on (aquote.preparedbyid = aprepuser.id) "
|
||||||
+ "left join acontract on (aquote.contractid = acontract.id)"
|
+ "left join acontract on (aquote.contractid = acontract.id)"
|
||||||
+ "left join aquoteitem on aquote.id=aquoteitem.quoteid "
|
+ "left join aquoteitem on aquote.id=aquoteitem.quoteid "
|
||||||
+ "left join aworkorderitemstatus on (aquoteitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
+ "left join aworkorderitemstatus on (aquoteitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||||
+ "left join aworkorderitempriority on (aquoteitem.workorderitempriorityid = aworkorderitempriority.id) "
|
+ "left join aworkorderitempriority on (aquoteitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||||
|
|
||||||
|
|
||||||
//workorder item unit
|
//workorder item unit
|
||||||
+ "left join aquoteitemunit on aquoteitem.id=aquoteitemunit.quoteitemid "
|
+ "left join aquoteitemunit on aquoteitem.id=aquoteitemunit.quoteitemid "
|
||||||
+ "left join aunit on (aquoteitemunit.unitid=aunit.id) "
|
+ "left join aunit on (aquoteitemunit.unitid=aunit.id) "
|
||||||
;
|
;
|
||||||
|
|
||||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
@@ -114,6 +114,16 @@ namespace AyaNova.DataList
|
|||||||
IsMeta = true
|
IsMeta = true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new DataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "metaunitmodel",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||||
|
SqlIdColumnName = "aunit.unitmodelid",
|
||||||
|
SqlValueColumnName = "aunit.unitmodelid",
|
||||||
|
IsMeta = true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@@ -528,11 +538,11 @@ namespace AyaNova.DataList
|
|||||||
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||||
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||||
if (crit.Length > 1)
|
if (crit.Length > 1)
|
||||||
{
|
{
|
||||||
int nType = 0;
|
int nType = 0;
|
||||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||||
AyaType forType = (AyaType)nType;
|
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;
|
long lId = 0;
|
||||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||||
@@ -548,6 +558,14 @@ namespace AyaNova.DataList
|
|||||||
ret.Add(FilterOption);
|
ret.Add(FilterOption);
|
||||||
}
|
}
|
||||||
break;
|
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
|
IsMeta = true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new DataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "metaunitmodel",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||||
|
SqlIdColumnName = "aunit.unitmodelid",
|
||||||
|
SqlValueColumnName = "aunit.unitmodelid",
|
||||||
|
IsMeta = true
|
||||||
|
});
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@@ -535,7 +544,7 @@ namespace AyaNova.DataList
|
|||||||
int nType = 0;
|
int nType = 0;
|
||||||
if (!int.TryParse(crit[1], out nType)) return ret;
|
if (!int.TryParse(crit[1], out nType)) return ret;
|
||||||
AyaType forType = (AyaType)nType;
|
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;
|
long lId = 0;
|
||||||
if (!long.TryParse(crit[0], out lId)) return ret;
|
if (!long.TryParse(crit[0], out lId)) return ret;
|
||||||
@@ -551,6 +560,13 @@ namespace AyaNova.DataList
|
|||||||
ret.Add(FilterOption);
|
ret.Add(FilterOption);
|
||||||
}
|
}
|
||||||
break;
|
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