This commit is contained in:
@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
internal class LoanUnitPickList : AyaPickList
|
||||
internal class LoanUnitPickList : AyaPickList, IAyaPickListVariant
|
||||
{
|
||||
public LoanUnitPickList()
|
||||
{
|
||||
@@ -71,9 +71,23 @@ namespace AyaNova.PickList
|
||||
|
||||
public string GetVariantCriteria(string variant)
|
||||
{
|
||||
// :variant="availableonly" Only items that are not on a workorderitemloan
|
||||
if (string.IsNullOrWhiteSpace(variant) || variant != "availableonly") return string.Empty;
|
||||
return "aloanunit.workorderitemloanid is null";
|
||||
// :variant="availableonly:[preselectedid]" Only items that are not on a workorderitemloan
|
||||
if (string.IsNullOrWhiteSpace(variant)) return string.Empty;
|
||||
|
||||
if (!variant.Contains(":"))
|
||||
throw new System.ArgumentOutOfRangeException($"LoanUnitPickList variant specified \"{variant}\" not valid, missing preselect id");
|
||||
|
||||
var v = variant.Split(":");
|
||||
long loanUnitId = 0;
|
||||
if (!string.IsNullOrWhiteSpace(v[1]))
|
||||
{
|
||||
long.TryParse(v[1], out loanUnitId);
|
||||
}
|
||||
|
||||
if (loanUnitId != 0)
|
||||
return $"workorderitemloanid is null or id={loanUnitId}";
|
||||
else
|
||||
return "workorderitemloanid is null";
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user