|
|
|
@ -13,18 +13,33 @@
|
|
|
|
|
{
|
|
|
|
|
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
|
|
|
|
|
<div class="form-group row">
|
|
|
|
|
<label class="col-sm-3 col-form-label" for="@prop.PropertyName" data-ui="@uihit">@prop.GetDisplayName():</label>
|
|
|
|
|
<label class="col-sm-3 col-form-label" for="@prop.PropertyName" data-ui="@uihit @prop.UnderlyingOrModelType">@prop.GetDisplayName():</label>
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
@if (prop.ModelType == typeof(string)){
|
|
|
|
|
@if (prop.ModelType == typeof(string) ||
|
|
|
|
|
prop.UnderlyingOrModelType == typeof(Int32) ||
|
|
|
|
|
prop.UnderlyingOrModelType == typeof(Int64)||
|
|
|
|
|
prop.UnderlyingOrModelType == typeof(System.Single)||
|
|
|
|
|
prop.UnderlyingOrModelType == typeof(System.Double)||
|
|
|
|
|
prop.UnderlyingOrModelType == typeof(System.Decimal))
|
|
|
|
|
{
|
|
|
|
|
@Html.TextBox(prop.PropertyName, null, new { name=name,@class = inputClass })
|
|
|
|
|
}
|
|
|
|
|
else if(prop.UnderlyingOrModelType == typeof(bool))
|
|
|
|
|
else if(prop.IsNullableValueType&&prop.UnderlyingOrModelType == typeof(bool))
|
|
|
|
|
{
|
|
|
|
|
var items=new List<SelectListItem>(){new SelectListItem{ Value="true",Text="是"},new SelectListItem{Value="false",Text="否"}};
|
|
|
|
|
var list = new SelectList(items, "Value", "Text");
|
|
|
|
|
@Html.DropDownList(prop.PropertyName, list,"请选择", new { @class = inputClass })
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else if(prop.IsNullableValueType&&prop.IsEnum)
|
|
|
|
|
{
|
|
|
|
|
var items=Enum.GetValues(prop.UnderlyingOrModelType).Cast<Enum>()
|
|
|
|
|
.Select(o => new SelectListItem { Value = o.GetValue().ToString(), Text = o.GetDisplayName() })
|
|
|
|
|
.ToList();
|
|
|
|
|
var list = new SelectList(items, "Value", "Text");
|
|
|
|
|
@Html.DropDownList(prop.PropertyName, list,"请选择", new { @class = inputClass })
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@Html.Editor(prop.PropertyName, prop.DataTypeName ?? prop.TemplateHint, prop.AdditionalValues)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|