This commit is contained in:
@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
internal class UnitPickList : AyaPickList
|
||||
internal class UnitPickList : AyaPickList, IAyaPickListVariant
|
||||
{
|
||||
public UnitPickList()
|
||||
{
|
||||
@@ -132,5 +132,25 @@ namespace AyaNova.PickList
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public string GetVariantCriteria(string variant)
|
||||
{
|
||||
//this variant is a name, value combination to restrict to a customer owner
|
||||
//e.g. "customerid:33"
|
||||
if (string.IsNullOrWhiteSpace(variant))
|
||||
return string.Empty;
|
||||
|
||||
if (!variant.Contains(":"))
|
||||
throw new System.ArgumentOutOfRangeException("UnitPickList variant required to be format 'customerid:idvalue' if specified");
|
||||
|
||||
var v = variant.Split(":");
|
||||
switch (v[0])
|
||||
{
|
||||
case "customerid":
|
||||
return $"aunit.customerid = {v[1]}";
|
||||
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user