This commit is contained in:
@@ -23,6 +23,19 @@ namespace AyaNova.Biz
|
|||||||
return this;
|
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
|
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
|
//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)
|
#if (DEBUG)
|
||||||
TrackRequestedKey(param);
|
TrackRequestedKey(param);
|
||||||
@@ -173,7 +173,7 @@ namespace AyaNova.Biz
|
|||||||
if (!LocaleExistsStatic(localeId, ct))
|
if (!LocaleExistsStatic(localeId, ct))
|
||||||
localeId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
|
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);
|
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
|
internal class WidgetBiz : BizObject, IJobObject, IFilterableObject
|
||||||
{
|
{
|
||||||
private FilterOptions filterOptions = null;
|
|
||||||
public FilterOptions FilterOptions
|
public FilterOptions FilterOptions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (filterOptions == null)
|
FilterOptions f = new FilterOptions("Widget");
|
||||||
{
|
f.
|
||||||
filterOptions = new FilterOptions("Widget");
|
AddField("Name", "WidgetName", AyDataType.Text).
|
||||||
filterOptions.
|
AddField("Serial", "WidgetSerial", AyDataType.Text).
|
||||||
AddField("Name", "WidgetName", AyDataType.Text).
|
AddField("DollarAmount", "WidgetDollarAmount", AyDataType.Decimal).
|
||||||
AddField("Serial", "WidgetSerial", AyDataType.Text).
|
AddField("Active", "WidgetActive", AyDataType.Bool).
|
||||||
AddField("DollarAmount", "WidgetDollarAmount", AyDataType.Decimal).
|
AddField("StartDate", "WidgetStartDate", AyDataType.Date).
|
||||||
AddField("Active", "WidgetActive", AyDataType.Bool).
|
AddField("EndDate", "WidgetEndDate", AyDataType.Date);
|
||||||
AddField("StartDate", "WidgetStartDate", AyDataType.Date).
|
f.Localize(UserLocaleId);
|
||||||
AddField("EndDate", "WidgetEndDate", AyDataType.Date);
|
return f;
|
||||||
|
|
||||||
}
|
|
||||||
return filterOptions;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user