This commit is contained in:
@@ -23,6 +23,19 @@ namespace AyaNova.Biz
|
||||
return this;
|
||||
}
|
||||
|
||||
internal void Localize(long userLocaleId)
|
||||
{
|
||||
List<string> keysRequired = new List<string>();
|
||||
foreach (FilterField f in Flds)
|
||||
{
|
||||
keysRequired.Add(f.Lt);
|
||||
}
|
||||
var trans = LocaleBiz.GetSubsetStatic(keysRequired, userLocaleId).Result;
|
||||
foreach (FilterField f in Flds)
|
||||
{
|
||||
f.Lt=trans[f.Lt];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FilterField
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
//Get the keys for a list of keys provided, static format for calling from other internal classes
|
||||
internal static async Task<List<KeyValuePair<string, string>>> GetSubsetStatic(List<string> param, long localeId)
|
||||
internal static async Task<Dictionary<string,string>> GetSubsetStatic(List<string> param, long localeId)
|
||||
{
|
||||
#if (DEBUG)
|
||||
TrackRequestedKey(param);
|
||||
@@ -173,7 +173,7 @@ namespace AyaNova.Biz
|
||||
if (!LocaleExistsStatic(localeId, ct))
|
||||
localeId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
|
||||
var ret = await ct.LocaleItem.Where(x => x.LocaleId == localeId && param.Contains(x.Key)).ToDictionaryAsync(x => x.Key, x => x.Display);
|
||||
return ret.ToList();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,24 +16,20 @@ namespace AyaNova.Biz
|
||||
|
||||
internal class WidgetBiz : BizObject, IJobObject, IFilterableObject
|
||||
{
|
||||
private FilterOptions filterOptions = null;
|
||||
public FilterOptions FilterOptions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (filterOptions == null)
|
||||
{
|
||||
filterOptions = new FilterOptions("Widget");
|
||||
filterOptions.
|
||||
AddField("Name", "WidgetName", AyDataType.Text).
|
||||
AddField("Serial", "WidgetSerial", AyDataType.Text).
|
||||
AddField("DollarAmount", "WidgetDollarAmount", AyDataType.Decimal).
|
||||
AddField("Active", "WidgetActive", AyDataType.Bool).
|
||||
AddField("StartDate", "WidgetStartDate", AyDataType.Date).
|
||||
AddField("EndDate", "WidgetEndDate", AyDataType.Date);
|
||||
|
||||
}
|
||||
return filterOptions;
|
||||
FilterOptions f = new FilterOptions("Widget");
|
||||
f.
|
||||
AddField("Name", "WidgetName", AyDataType.Text).
|
||||
AddField("Serial", "WidgetSerial", AyDataType.Text).
|
||||
AddField("DollarAmount", "WidgetDollarAmount", AyDataType.Decimal).
|
||||
AddField("Active", "WidgetActive", AyDataType.Bool).
|
||||
AddField("StartDate", "WidgetStartDate", AyDataType.Date).
|
||||
AddField("EndDate", "WidgetEndDate", AyDataType.Date);
|
||||
f.Localize(UserLocaleId);
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user