@using System.Reflection @using Microsoft.AspNetCore.Mvc.Controllers @using Infrastructure.Web.Mvc @{ var scope = (Url.ActionContext.ActionDescriptor as ControllerActionDescriptor).ControllerTypeInfo.GetCustomAttribute()?.Scope; }
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.HideSurroundingHtml)) { var metadata = prop as Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata; if (scope != null && scope == ControllerScopeType.Organ && prop.PropertyName == "OrganId") { Html.Hidden(prop.PropertyName); continue; } var uihit = prop.DataTypeName ?? prop.TemplateHint;
@Html.Label(prop.PropertyName, prop.GetDisplayName() + ":", new { @class = "col-sm-2 col-form-label",style= "text-align: right;overflow:hidden;" })
@Html.Display(prop.PropertyName, uihit)
}