This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace AyaNova.PickList
|
namespace AyaNova.PickList
|
||||||
{
|
{
|
||||||
internal class CustomerPickList : AyaPickList
|
internal class CustomerPickList : AyaPickList, IAyaPickListVariant
|
||||||
{
|
{
|
||||||
public CustomerPickList()
|
public CustomerPickList()
|
||||||
{
|
{
|
||||||
@@ -43,14 +45,44 @@ namespace AyaNova.PickList
|
|||||||
IsRowId = true
|
IsRowId = true
|
||||||
});
|
});
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "Tags",
|
TKey = "Tags",
|
||||||
FieldKey = "customertags",
|
FieldKey = "customertags",
|
||||||
ColumnDataType = UiFieldDataType.Tags,
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
SqlValueColumnName = "acustomer.tags"
|
SqlValueColumnName = "acustomer.tags"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
public string GetVariantCriteria(string variant)
|
||||||
|
{
|
||||||
|
//Currently the only variant is a object type and id to indicate headoffice
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//ClientCriteria format for this list is "OBJECTID,AYATYPE"
|
||||||
|
var crit = (variant ?? "").Split(',').Select(z => z.Trim()).ToArray();
|
||||||
|
if (crit.Length > 1)
|
||||||
|
{
|
||||||
|
int nType = 0;
|
||||||
|
if (!int.TryParse(crit[1], out nType)) return string.Empty;
|
||||||
|
AyaType forType = (AyaType)nType;
|
||||||
|
if (forType != AyaType.HeadOffice) return string.Empty;
|
||||||
|
|
||||||
|
long lId = 0;
|
||||||
|
if (!long.TryParse(crit[0], out lId)) return string.Empty;
|
||||||
|
if (lId == 0) return string.Empty;
|
||||||
|
|
||||||
|
//Have valid type, have an id, so filter away
|
||||||
|
switch (forType)
|
||||||
|
{
|
||||||
|
case AyaType.HeadOffice:
|
||||||
|
{
|
||||||
|
return $"aunit.customerid = {lId}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user