1. /Views/LocalParam/Index.cshtml中
开头引用模板
@model UIH.PACS.Server.Web.Models.BaseParamsVM
带参数的表单使用htmlHelp类实现
@using (Html.BeginForm("Edit", "LocalParam", FormMethod.Post))
{
<div class="grayBG EditInfoSetting LayoutMunSet" name="mainsetting">
@Html.ValidationSummary(true)
<h3>
本机参数设置</h3>
<div class="editor-label">
@Html.LabelFor(model => model.BaseParams.OurAETitle) :
@Html.EditorFor(model => model.BaseParams.OurAETitle)
<text style="color: red">*</text>
@Html.ValidationMessageFor(model => model.BaseParams.OurAETitle)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.BaseParams.Timeout) :
@Html.EditorFor(model => model.BaseParams.Timeout)
@Html.ValidationMessageFor(model => model.BaseParams.Timeout)
</div>
<h3>
转发设置
</h3>
<div class="editor-label" ignore>
<label class="MG42">@Html.CheckBoxFor(model => model.BaseParams.IsEnableFtpTransfer)</label>
@Html.LabelFor(model => model.BaseParams.IsEnableFtpTransfer)
</div>
<div class="editor-label" ignore style="display: none">
<label class="MG42">@Html.CheckBoxFor(model => model.BaseParams.IsAutoRoutedMpps)</label>
@Html.LabelFor(model => model.BaseParams.IsAutoRoutedMpps)
</div>
@Html.HiddenFor(model => model.BaseParams.MailServerType)
@Html.HiddenFor(model => model.BaseParams.SenderMailAddress)
@Html.HiddenFor(model => model.BaseParams.SenderMailPassword)
@Html.HiddenFor(model => model.BaseParams.RecieverMailAddress)
@Html.HiddenFor(model => model.BaseParams.LogMailTitle)
@Html.HiddenFor(model => model.BaseParams.PACSType, new { @id = "oldPacsType" })
</div>
<div class="grayBG EditInfoSetting LayoutMunSet" style="display: none" name="extsetting">
@Html.Partial("_ExtendSet")
</div>
··········
·········
}
2. 指向模板中 /Models/BaseParamsVM.cs
namespace UIH.PACS.Server.Web.Models
{
[Serializable]
public class BaseParamsVM
{
/// <summary>
/// 基础参数配置
/// </summary>
//在LocalParams中设置基本参数
public LocalParams BaseParams { get; set; }
/// <summary>
/// 转发策略
/// </summary>
public IPagedList<ROUTE_CONTROL> RouteControlList { get; set; }
public string CompressAlgorithm { get; set; }
public string RouteCompressAlgorithm { get; set; }
public string ConsoleLogLevel { get; set; }
public string DatabaseLogLevel { get; set; }
public string FileLogLevel { get; set; }
public string MailLogLevel { get; set; }
public string WindowsLogLevel { get; set; }
public string PACSMode { get; set; }
public string PACSType { get; set; }
public int StorageMode { get; set; }
}
public class RouteIndexParameters
{
public int RoutePage { set; get; }
public int RoutePageCount { set; get; }
}
public class RouteData
{
public string srcAE { set; get; }
public string destinationAE { set; get; }
public string routeImmediately { set; get; }
public string routeTime { set; get; }
public string oldSrcAE { set; get; }
public string oldDestinationAE { set; get; }
public string ID { set; get; }
public string routeType { set; get; }
public string duration { set; get; }
}
}
其中的基本参数由 /Models/LocalParams.cs 设置
3. form表单submit之后,后台的controller就开始进行表单验证等工作,完毕后使用json的方式将数据返回前台
/Controller/LocalParamController.cs
return Json(bool, function());