change picklist preselect from a single long to a array of long

This commit is contained in:
2021-01-13 17:26:51 +00:00
parent 369b8f3af8
commit 061b05035b

View File

@@ -97,10 +97,11 @@ namespace AyaNova.PickList
//if there is an override to see inactive too then we just don't set the filter on active
if (!IncludeInactive)
{
if (preId != 0)
if (preIds.Length>0)
{
//pre-selected need to always appear regardless of active status
ActiveWhereFragment = $"({rowIdColumn.SqlIdColumnName} = {preId}) or ({activeColumn.SqlValueColumnName} = true)";
//ActiveWhereFragment = $"({rowIdColumn.SqlIdColumnName} = {preId}) or ({activeColumn.SqlValueColumnName} = true)";
ActiveWhereFragment = $"({rowIdColumn.SqlIdColumnName} in ({string.Join(",", preIds)})) or ({activeColumn.SqlValueColumnName} = true)";
}
else
{
@@ -241,7 +242,7 @@ namespace AyaNova.PickList
//WHERE
//there is a condition where there is no where (inactive=true and no query of any kind)
if (preId > 0 || lWhere.Count > 0 || HasTagSpecificQuery || HasVariantWhereFragment || IncludeInactive == false)
if (preIds.Length > 0 || lWhere.Count > 0 || HasTagSpecificQuery || HasVariantWhereFragment || IncludeInactive == false)
{
sb.Append(" where ");
@@ -262,7 +263,7 @@ namespace AyaNova.PickList
sb.Append(" and ");
}
if (preId > 0)
if (preIds.Length > 0)
{
sb.Append(PredefinedOnlyWhereFragment);
sb.Append(" and ");