|
@@ -81,31 +81,31 @@ namespace PRSServer
|
|
|
if (showType == EntityTableColumns.LOOKUP) return LookupFactory.DefineColumns(typeof(T)).ColumnNames().ToList<string>();
|
|
|
var columns = new List<string>();
|
|
|
|
|
|
- var properties = CoreUtils.PropertyInfoList(
|
|
|
- typeof(T),
|
|
|
- x => x.GetCustomAttribute<DoNotPersist>() == null &&
|
|
|
- x.GetCustomAttribute<DoNotSerialize>() == null &&
|
|
|
- x.PropertyType != typeof(UserProperties), true);
|
|
|
+ var properties = DatabaseSchema.Properties(typeof(T))
|
|
|
+ .Where(x => x.IsSerializable && x.IsPersistable);
|
|
|
switch (showType)
|
|
|
{
|
|
|
case EntityTableColumns.VISIBLE:
|
|
|
foreach (var property in properties)
|
|
|
{
|
|
|
- var editor = property.Value.GetEditor();
|
|
|
- if (editor != null && editor.Visible != Visible.Hidden) columns.Add(property.Key);
|
|
|
+ var editor = property.Editor;
|
|
|
+ if (editor != null && editor.Visible != Visible.Hidden)
|
|
|
+ columns.Add(property.Name);
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
case EntityTableColumns.REQUIRED:
|
|
|
foreach (var property in properties)
|
|
|
{
|
|
|
- var editor = property.Value.GetEditor();
|
|
|
- if (editor != null && editor.Visible == Visible.Default) columns.Add(property.Key);
|
|
|
+ var editor = property.Editor;
|
|
|
+ if (editor != null && editor.Visible == Visible.Default)
|
|
|
+ columns.Add(property.Name);
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
case EntityTableColumns.ALL:
|
|
|
- foreach (var property in properties.Keys) columns.Add(property);
|
|
|
+ foreach (var property in properties)
|
|
|
+ columns.Add(property.Name);
|
|
|
break;
|
|
|
}
|
|
|
|