Former-commit-id: a59e6fb04e295d35da34610b1b0061557cc5ce46 Former-commit-id: 3ae6b6aea661d6935df1e8d1d6f3429beafc08541.0
parent
2a2d119a09
commit
879ebe4340
@ -1,7 +1,12 @@
|
||||
@{
|
||||
HtmlTitle = "新建" + ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
var display= ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
HtmlTitle = "新建" + display;
|
||||
var controller = this.ViewContext.RouteData.Values["controller"].ToString();
|
||||
}
|
||||
@Html.EditorForModel()
|
||||
@section scripts{
|
||||
@(await Html.PartialAsync("_Script"))
|
||||
}
|
||||
@section bread{
|
||||
<li class="breadcrumb-item"><a href="@Url.Action("Index")">@(display)管理</a></li>
|
||||
}
|
@ -1,4 +1,9 @@
|
||||
@{
|
||||
HtmlTitle = "查看" + ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
var display = ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
HtmlTitle = "编辑" + display;
|
||||
var controller = this.ViewContext.RouteData.Values["controller"].ToString();
|
||||
}
|
||||
@Html.DisplayForModel()
|
||||
@section bread{
|
||||
<li class="breadcrumb-item"><a href="@Url.Action("Index")">@(display)管理</a></li>
|
||||
}
|
@ -1 +1,11 @@
|
||||
@Html.CheckBox("", new { disabled = "disabled", style = "width:20px;height:20px;margin:2px 0;" })
|
||||
@{
|
||||
var model = Model as bool?;
|
||||
if (model.HasValue && model.Value)
|
||||
{
|
||||
<i class="icon ion-checkmark" style="color:green;"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="icon ion-close" style="color:red;"></i>
|
||||
}
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
@{
|
||||
HtmlTitle = "编辑" + ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
var display = ViewContext.ViewData.ModelMetadata.ModelType.GetDisplayName();
|
||||
HtmlTitle = "编辑" + display;
|
||||
var controller = this.ViewContext.RouteData.Values["controller"].ToString();
|
||||
}
|
||||
@Html.EditorForModel()
|
||||
@section scripts{
|
||||
@(await Html.PartialAsync("_Script"))
|
||||
}
|
||||
@section bread{
|
||||
<li class="breadcrumb-item"><a href="@Url.Action("Index")">@(display)管理</a></li>
|
||||
}
|
@ -1 +1,3 @@
|
||||
@Html.CheckBox("", new { style = "width:20px;height:20px;margin:2px 0;" })
|
||||
<div class="form-control" style="border-color:transparent;">
|
||||
@Html.CheckBox("", new { style = "width:20px;height:20px;margin:2px 0;" })
|
||||
</div>
|
||||
|
@ -1,22 +1,20 @@
|
||||
@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);
|
||||
}
|
||||
@{
|
||||
var scope = ViewBag.ControllerScope as string;
|
||||
var props = ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.HideSurroundingHtml && !pm.IsComplexType && !pm.IsCollectionType && pm.PropertyName != "Id").ToList();
|
||||
foreach (var prop in props)
|
||||
{
|
||||
if(scope=="Organ"&&prop.PropertyName=="OrganId")
|
||||
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="max-width:10em;" data-ext="@templateName">
|
||||
@if (prop.UnderlyingOrModelType == typeof(bool))
|
||||
{
|
||||
@Html.CheckBox(prop.PropertyName, new { disabled = "disabled", style = "width:20px;height:20px;margin:2px 0;" })
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Display(prop.PropertyName, templateName)
|
||||
}
|
||||
</td>
|
||||
}
|
||||
}
|
Loading…
Reference in new issue