This commit is contained in:
2021-09-03 15:15:09 +00:00
parent d501ff4729
commit b486c00138
3 changed files with 105 additions and 56 deletions

View File

@@ -79,6 +79,7 @@ namespace AyaNova.Api.Controllers
ret.Add(new KeyValuePair<string, string>("coreall", "All Core AyaNova business object types"));
ret.Add(new KeyValuePair<string, string>("coreview", "All Core AyaNova business object types current user is allowed to view"));
ret.Add(new KeyValuePair<string, string>("coreedit", "All Core AyaNova business object types current user is allowed to edit"));
ret.Add(new KeyValuePair<string, string>("reportable", "All AyaNova business object types that are reportable"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UiFieldDataType).ToString()), "Types of data used in AyaNova for display and formatting UI purposes"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(NotifyEventType).ToString()), "Notification event types"));
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(NotifyDeliveryMethod).ToString()), "Notification delivery methods"));
@@ -149,6 +150,37 @@ namespace AyaNova.Api.Controllers
}
}
}
else if (keyNameInLowerCase == "reportable")
{
//reportable biz objects for report designer selection
var values = Enum.GetValues(typeof(AyaType));
foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(ReportableBizObject)))
{
TranslationKeysToFetch.Add(t.ToString());
}
}
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(ReportableBizObject)))
{
var tName = t.ToString();
string name = string.Empty;
if (LT.ContainsKey(tName))
{
name = LT[tName];
}
else
{
name = tName;
}
ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t });
}
}
}
else if (keyNameInLowerCase == "coreview")//all core objects user can read
{
@@ -231,7 +263,7 @@ namespace AyaNova.Api.Controllers
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaType).ToString()).ToLowerInvariant())
{
//this is intended primarily for developers, not for UI facing so no need to localize or pretty it up
//bullshit, it's just extra work not translated and developers only need the number, not the enumeration name which is for here only
//bs, it's just extra work not translated and developers only need the number, not the enumeration name which is for here only
var values = Enum.GetValues(typeof(AyaType));