This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartInventoryTransactionsDataList : AyaDataList
|
||||
internal class PartInventoryTransactionsDataList : DataListBase, IDataListInternalCriteria
|
||||
{
|
||||
public PartInventoryTransactionsDataList()
|
||||
{
|
||||
@@ -57,9 +60,9 @@ namespace AyaNova.DataList
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "PartInventoryTransactionEntryDate", "-" } };
|
||||
|
||||
|
||||
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartInventoryTransactionSource",
|
||||
FieldKey = "PartInventoryTransactionSource",
|
||||
@@ -69,7 +72,7 @@ namespace AyaNova.DataList
|
||||
SqlAyTypeColumnName = "apartinventory.sourcetype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartPartNumber",
|
||||
FieldKey = "PartPartNumber",
|
||||
@@ -79,7 +82,7 @@ namespace AyaNova.DataList
|
||||
SqlValueColumnName = "apart.partnumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartWarehouseName",
|
||||
FieldKey = "PartWarehouseName",
|
||||
@@ -89,7 +92,7 @@ namespace AyaNova.DataList
|
||||
SqlValueColumnName = "apartwarehouse.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartInventoryTransactionDescription",
|
||||
FieldKey = "PartInventoryTransactionDescription",
|
||||
@@ -100,7 +103,7 @@ namespace AyaNova.DataList
|
||||
IsRowId = true//should open to eventlog since no edit
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartInventoryTransactionEntryDate",
|
||||
FieldKey = "PartInventoryTransactionEntryDate",
|
||||
@@ -108,7 +111,7 @@ namespace AyaNova.DataList
|
||||
SqlValueColumnName = "apartinventory.entrydate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartInventoryTransactionQuantity",
|
||||
FieldKey = "PartInventoryTransactionQuantity",
|
||||
@@ -116,7 +119,7 @@ namespace AyaNova.DataList
|
||||
SqlValueColumnName = "apartinventory.quantity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "PartInventoryBalance",
|
||||
FieldKey = "PartInventoryBalance",
|
||||
@@ -126,6 +129,35 @@ namespace AyaNova.DataList
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
//ClientCriteria is optional for this list
|
||||
//Format for this list is "PARTID,WAREHOUSEID" where the id is 0 if not filtered or the id to filter
|
||||
var crit = (dataListBase.ClientCriteria ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||
if (crit.Length > 1)
|
||||
{
|
||||
//Part criteria
|
||||
if (crit[0] != "0")
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "PartPartNumber" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[0], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
|
||||
//Warehouse criteria
|
||||
if (crit[1] != "0")
|
||||
{
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "PartWarehouseName" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = crit[1], op = DataListFilterComparisonOperator.Equality });
|
||||
ret.Add(FilterOption);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user