|
|
@model EditTeacherModel
|
|
|
@using System.Reflection
|
|
|
@using Microsoft.AspNetCore.Mvc.Controllers
|
|
|
@using Infrastructure.Web.Mvc
|
|
|
@{
|
|
|
var url = HtmlAction ?? (ViewData.Keys.Any(o => o.ToLower() == "returnurl") ? Url.Action(null, null, new { ReturnUrl = ViewData["ReturnUrl"] }) : Url.Action(null, null));
|
|
|
var scope = (Url.ActionContext.ActionDescriptor as ControllerActionDescriptor).ControllerTypeInfo.GetCustomAttribute<ControllerScopeAttribute>()?.Scope;
|
|
|
var props = ViewData.ModelMetadata.Properties;
|
|
|
}
|
|
|
<div class="card">
|
|
|
<form action="@url" method="post" class="form-horizontal">
|
|
|
<div class="card-body">
|
|
|
<div class="row">
|
|
|
@foreach (var prop in props)
|
|
|
{
|
|
|
var metadata = prop as Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata;
|
|
|
var isHidden = metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(HiddenInputAttribute));
|
|
|
if (prop.PropertyName.EndsWith("Checked"))
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
if (isHidden)
|
|
|
{
|
|
|
@Html.Hidden(prop.PropertyName)
|
|
|
continue;
|
|
|
}
|
|
|
var uihit = prop.DataTypeName ?? prop.TemplateHint;
|
|
|
<div class="col-sm-6">
|
|
|
<div class="form-group row" title="@uihit">
|
|
|
@Html.Label(prop.PropertyName, prop.GetDisplayName() + ":", new { @class = "col-sm-4 col-form-label" })
|
|
|
<div class="col-sm-8">
|
|
|
<div class="form-control" style="border-color:transparent;height:auto;padding-left:0;">
|
|
|
@Html.Hidden(prop.PropertyName)
|
|
|
@Html.Display(prop.PropertyName, uihit)
|
|
|
@{
|
|
|
var checkedProp = props.FirstOrDefault(o => o.PropertyName == prop.PropertyName + "Checked");
|
|
|
@if (checkedProp != null)
|
|
|
{
|
|
|
@Html.CheckBox(checkedProp.PropertyName, new { @class = "is-checked", title = "审核" })
|
|
|
}
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="card-footer">
|
|
|
<div class="form-group row">
|
|
|
<label class="col-sm-2 control-label"></label>
|
|
|
<div class="col-sm-6">
|
|
|
@if (Model != null)
|
|
|
{
|
|
|
if (User.IsInRole("局管理员") && Model.CheckStatus == "待局级审核")
|
|
|
{
|
|
|
<button id="super1" type="button" class="btn btn-primary">审核通过</button>
|
|
|
<button id="super2" type="button" class="btn btn-primary">审核失败</button>
|
|
|
}
|
|
|
else if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
|
|
|
{
|
|
|
<button id="admin1" type="button" class="btn btn-primary">审核通过</button>
|
|
|
<button id="admin2" type="button" class="btn btn-primary">审核失败</button>
|
|
|
}
|
|
|
if (User.IsInRole("局管理员") && Model.CheckStatus == "局级审核成功")
|
|
|
{
|
|
|
<button id="super3" type="button" class="btn btn-primary">重置</button>
|
|
|
}
|
|
|
if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
|
|
|
{
|
|
|
<button id="admin3" type="button" class="btn btn-primary">重置</button>
|
|
|
}
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
@section scripts{
|
|
|
@(await Html.PartialAsync("_Script"))
|
|
|
<script>
|
|
|
$('#super1').click(function () {
|
|
|
$('#CheckStatus').val('局级审核成功');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
$('#super2').click(function () {
|
|
|
$('#CheckStatus').val('局级审核失败');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
$('#super3').click(function () {
|
|
|
$('#CheckStatus').val('未提交');
|
|
|
$('#RequestEditStatus').val('未申请');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
|
|
|
$('#admin1').click(function () {
|
|
|
$('#CheckStatus').val('待局级审核');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
$('#admin2').click(function () {
|
|
|
$('#CheckStatus').val('校级审核失败');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
$('#admin3').click(function () {
|
|
|
$('#CheckStatus').val('未提交');
|
|
|
$('#RequestEditStatus').val('未申请');
|
|
|
$(this).parents('form').submit();
|
|
|
});
|
|
|
</script>
|
|
|
}
|