This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using AyaNova.Models;
|
using AyaNova.Models;
|
||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
|
using System.Linq;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ServiceBankDataList : DataListProcessingBase
|
internal class ServiceBankDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public ServiceBankDataList()
|
public ServiceBankDataList()
|
||||||
{
|
{
|
||||||
@@ -166,44 +166,55 @@ namespace AyaNova.DataList
|
|||||||
SqlValueColumnName = "aservicebank.hoursbalance"
|
SqlValueColumnName = "aservicebank.hoursbalance"
|
||||||
});
|
});
|
||||||
|
|
||||||
//META object id column
|
//META
|
||||||
FieldDefinitions.Add(new DataListFieldDefinition
|
FieldDefinitions.Add(new DataListFieldDefinition
|
||||||
{
|
{
|
||||||
FieldKey = "metaservicebankobjectid",
|
FieldKey = "metaobjectid",
|
||||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||||
SqlIdColumnName = "aservicebank.objectid",
|
SqlIdColumnName = "aservicebank.objectid",
|
||||||
SqlValueColumnName = "aservicebank.objectid",
|
SqlValueColumnName = "aservicebank.objectid",
|
||||||
IsMeta = true
|
IsMeta = true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new DataListFieldDefinition
|
||||||
|
{
|
||||||
|
|
||||||
|
FieldKey = "metaobjecttype",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||||
|
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
|
||||||
|
SqlValueColumnName = "aservicebank.objecttype",
|
||||||
|
IsMeta = true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
//TODO: support the clientCriteria
|
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||||
if (vm.objectId && vm.objectId != 0 && vm.objectType) {
|
{
|
||||||
// //DYNAMIC FILTER
|
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||||
// vm.metaView = JSON.stringify([
|
|
||||||
// {
|
|
||||||
// fld: "metaservicebankobjectid",
|
|
||||||
// filter: {
|
|
||||||
// items: [{ op: "=", value: vm.objectId }]
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// fld: "AyaType",
|
|
||||||
// filter: {
|
|
||||||
// items: [{ op: "=", value: vm.objectType }]
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ]);
|
|
||||||
// vm.name = await window.$gz.api.fetchBizObjectName(
|
|
||||||
// vm.objectType,
|
|
||||||
// vm.objectId
|
|
||||||
// );
|
|
||||||
//OBJECTID,AYATYPE
|
|
||||||
vm.clientCriteria = `${vm.objectId},${vm.objectType}`;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
//ClientCriteria is optional for this list
|
||||||
|
//Format for this list is "PARTID,WAREHOUSENAME" where the id is 0 if not filtered or the id to filter
|
||||||
|
//and bizarrely the warehousename is text or empty if not filtered
|
||||||
|
var crit = (clientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||||
|
if (crit.Length > 1)
|
||||||
|
{
|
||||||
|
//OBJECTID criteria
|
||||||
|
if (crit[0] != "0")
|
||||||
|
{
|
||||||
|
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaobjectid" };
|
||||||
|
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||||
|
ret.Add(FilterOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
//AYATYPE criteria
|
||||||
|
if (!string.IsNullOrWhiteSpace(crit[1]))
|
||||||
|
{
|
||||||
|
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metaobjecttype" };
|
||||||
|
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[1], op = DataListFilterComparisonOperator.Equality });
|
||||||
|
ret.Add(FilterOption);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user