This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
|
||||
namespace AyaNova.PickList
|
||||
@@ -19,20 +20,19 @@ namespace AyaNova.PickList
|
||||
return null;
|
||||
}
|
||||
|
||||
//List all the datalist types available
|
||||
internal static List<string> GetListOfAllPickListKeyNames()
|
||||
{
|
||||
//https://stackoverflow.com/a/42574373/8939
|
||||
//List all the PickList-able object types available
|
||||
internal static List<NameIdItem> GetListOfAllPickListKeyNames()
|
||||
{
|
||||
|
||||
List<string> ret = new List<string>();
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
|
||||
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
|
||||
List<NameIdItem> ret = new List<NameIdItem>();
|
||||
var values = System.Enum.GetValues(typeof(AyaType));
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IAyaPickList)))
|
||||
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
|
||||
{
|
||||
ret.Add(ti.Name);
|
||||
ret.Add(new NameIdItem() { Name = t.ToString(), Id = (long)t });
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user