|
|
<div class="card">
|
|
|
<form action="@Url.Action(null, null)" method="get" class="form-horizontal">
|
|
|
@Html.Hidden("PageSize")
|
|
|
<div class="card-body">
|
|
|
<div class="row">
|
|
|
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit).Where(o => o.PropertyName != "Capacity" && o.PropertyName != "Count"))
|
|
|
{
|
|
|
if (prop.PropertyName == "Query" || prop.PropertyName == "Schema" || prop.PropertyName == "ViewData")
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
<div>@prop.PropertyName</div>
|
|
|
if (prop.HideSurroundingHtml)
|
|
|
{
|
|
|
@Html.Hidden(prop.PropertyName)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
var uihit = prop.TemplateHint ?? prop.DataTypeName;
|
|
|
var isRequired = prop.IsRequired && prop.ModelType != typeof(bool);
|
|
|
var htmlClass = "col-sm-3 col-form-label";
|
|
|
htmlClass += isRequired ? " required" : "";
|
|
|
<div class="col-md-3">
|
|
|
<div class="form-group row">
|
|
|
@if (prop.ModelType == typeof(bool))
|
|
|
{
|
|
|
<div class="col-sm-3"></div>
|
|
|
<div class="col-sm-9">
|
|
|
<div class="checkboxfix">
|
|
|
@Html.CheckBox(prop.PropertyName) <span>@prop.GetDisplayName()</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@Html.Label(prop.PropertyName, prop.GetDisplayName() + ":", new { @class = htmlClass })
|
|
|
<div class="col-sm-9">
|
|
|
@if (!string.IsNullOrEmpty(uihit) && !(uihit == "EmailAddress" || uihit == "PhoneNumber"))
|
|
|
{
|
|
|
@Html.Editor(prop.PropertyName, prop.DataTypeName ?? prop.TemplateHint, prop.AdditionalValues)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@Html.TextBox(prop.PropertyName, null, new { @class = "form-control" })
|
|
|
}
|
|
|
</div>
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|
|
|
}
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col-md-3">
|
|
|
<div class="form-group row">
|
|
|
<label class="col-sm-3 col-form-label"></label>
|
|
|
<div class="col-sm-9">
|
|
|
<button class="btn btn-primary" type="submit">
|
|
|
查询
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div> |