You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
930 B
20 lines
930 B
@using System.Reflection
|
|
@using Microsoft.AspNetCore.Mvc.Controllers
|
|
@using Infrastructure.Web.Mvc
|
|
@{
|
|
var scope = (Url.ActionContext.ActionDescriptor as ControllerActionDescriptor).ControllerTypeInfo.GetCustomAttribute<ControllerScopeAttribute>()?.Scope;
|
|
var props = ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.HideSurroundingHtml && !pm.IsComplexType && !pm.IsCollectionType);
|
|
}
|
|
@{
|
|
foreach (var prop in props)
|
|
{
|
|
if (scope != null && scope == ControllerScopeType.Organ && prop.PropertyName == "OrganId")
|
|
{
|
|
continue;
|
|
}
|
|
var templateName = prop.DataTypeName ?? prop.TemplateHint ?? (prop.ModelType == typeof(string) ? typeof(string).Name : null);
|
|
<td style="white-space: nowrap;text-overflow:ellipsis;overflow: hidden;max-width:10em;" data-ext="@templateName">
|
|
@Html.Display(prop.PropertyName, templateName)
|
|
</td>
|
|
}
|
|
} |