This commit is contained in:
2022-03-23 00:50:44 +00:00
parent 8e58408113
commit 30c51f258f
7 changed files with 85 additions and 31 deletions

View File

@@ -81,6 +81,7 @@ namespace AyaNova.Api.Controllers
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>("importable", "All AyaNova business object types that are importable"));
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"));
@@ -181,6 +182,36 @@ namespace AyaNova.Api.Controllers
ReturnList.Add(new NameIdItem() { Name = name, Id = (long)t });
}
}
} else if (keyNameInLowerCase == "importable")
{
//importable biz objects for administration -> import selection
var values = Enum.GetValues(typeof(AyaType));
foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(ImportableBizObjectAttribute)))
{
TranslationKeysToFetch.Add(t.ToString());
}
}
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
foreach (AyaType t in values)
{
if (t.HasAttribute(typeof(ImportableBizObjectAttribute)))
{
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
{