This commit is contained in:
@@ -261,6 +261,9 @@ namespace AyaNova.Biz
|
||||
var filterItem = v[i];
|
||||
if (filterItem["fld"] == null)
|
||||
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"fld\" property ");
|
||||
else{
|
||||
//todo: find the filteroptions object adn confirm this is a valid value for fld
|
||||
}
|
||||
if (filterItem["op"] == null)
|
||||
AddError(ValidationErrorType.RequiredPropertyEmpty, "Filter", $"Filter array item {i}, object is missing required \"op\" property ");
|
||||
else
|
||||
|
||||
@@ -19,12 +19,12 @@ namespace AyaNova.Biz
|
||||
|
||||
public FilterOptions AddField(string FieldName, string LocaleKey, string DataType)
|
||||
{
|
||||
Flds.Add(new FilterField() { Fld = FieldName, Lt = LocaleKey, Type = DataType });
|
||||
Flds.Add(new FilterField(FieldName, LocaleKey, DataType));
|
||||
return this;
|
||||
}
|
||||
|
||||
internal void Localize(long userLocaleId)
|
||||
{
|
||||
{
|
||||
List<string> keysRequired = new List<string>();
|
||||
foreach (FilterField f in Flds)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace AyaNova.Biz
|
||||
var trans = LocaleBiz.GetSubsetStatic(keysRequired, userLocaleId).Result;
|
||||
foreach (FilterField f in Flds)
|
||||
{
|
||||
f.Lt=trans[f.Lt];
|
||||
f.Lt = trans[f.Lt];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,5 +43,12 @@ namespace AyaNova.Biz
|
||||
public string Fld { get; set; }
|
||||
public string Lt { get; set; }
|
||||
public string Type { get; set; }
|
||||
public FilterField(string fld, string lt, string type)
|
||||
{
|
||||
Fld = fld;
|
||||
Lt = lt;
|
||||
Type = type;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,11 @@ namespace AyaNova.Biz
|
||||
//FILTEROPTIONS COLLECTION
|
||||
FilterOptions FilterOptions { get; }
|
||||
|
||||
List<FilterField> FilterFields {get;}
|
||||
|
||||
//VALIDATE FILTER?
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using AyaNova.Util;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
@@ -33,6 +33,11 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
public static List<FilterField> FilterFields(){
|
||||
List<FilterField> fields=new List<FilterField>();
|
||||
fields.Add(new FilterField())
|
||||
}
|
||||
|
||||
internal WidgetBiz(AyContext dbcontext, long currentUserId, long userLocaleId, AuthorizationRoles UserRoles)
|
||||
{
|
||||
ct = dbcontext;
|
||||
|
||||
Reference in New Issue
Block a user