From 1133119c23c10096c2dd2fa92ecdc8e0e0b17693 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 28 Jan 2021 15:50:06 +0000 Subject: [PATCH] --- .../AyaNova/DataList/PartInventoryDataList.cs | 35 ++++++++++++++++++- server/AyaNova/biz/CustomerNoteBiz.cs | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/server/AyaNova/DataList/PartInventoryDataList.cs b/server/AyaNova/DataList/PartInventoryDataList.cs index 646a2758..4dbc98b2 100644 --- a/server/AyaNova/DataList/PartInventoryDataList.cs +++ b/server/AyaNova/DataList/PartInventoryDataList.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; using AyaNova.Biz; +using AyaNova.Models; + namespace AyaNova.DataList { - internal class PartInventoryDataList : AyaDataList + internal class PartInventoryDataList : AyaDataList, IAyaDataListServerCriteria { public PartInventoryDataList() { @@ -112,7 +114,38 @@ namespace AyaNova.DataList }); } + //"clientCriteria":"p:102074,w:*" + public List DataListServerCriteria(long currentUserId, AuthorizationRoles userRoles, DataListBase dataListBase) + { + List ret = new List(); + //ClientCriteria MUST be CustomerId + if (string.IsNullOrWhiteSpace(dataListBase.ClientCriteria)) + throw new System.ArgumentNullException("CustomerNoteDataList - ClientCriteria is empty, should be Customer ID"); + DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metacustomer" }; + FilterOption.Items.Add(new DataListColumnFilter() { value = dataListBase.ClientCriteria, op = DataListFilterComparisonOperator.Equality }); + + ret.Add(FilterOption); + return ret; + } + + /* + metaFilter.push({ + // fld: "PartPartNumber", + // filter: { + // items: [{ op: "=", value: vm.$route.params.filter.PartPartNumber }] + // } + // }); + // } + + // if (vm.$route.params.filter.PartWarehouseName != null) { + // metaFilter.push({ + // fld: "PartWarehouseName", + // filter: { + // items: [ + // { op: "=", value: vm.$route.params.filter.PartWarehouseName } + // ] + */ }//eoc }//eons \ No newline at end of file diff --git a/server/AyaNova/biz/CustomerNoteBiz.cs b/server/AyaNova/biz/CustomerNoteBiz.cs index 66b56231..714b0a85 100644 --- a/server/AyaNova/biz/CustomerNoteBiz.cs +++ b/server/AyaNova/biz/CustomerNoteBiz.cs @@ -74,7 +74,7 @@ namespace AyaNova.Biz // internal async Task PutAsync(CustomerNote putObject) { - CustomerNote dbObject = await ct.CustomerNote.SingleOrDefaultAsync(m => m.Id == putObject.Id); + CustomerNote dbObject = await GetAsync(putObject.Id,false); if (dbObject == null) { AddError(ApiErrorCode.NOT_FOUND, "id");