1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.RetakeManage;
- using EMIS.ViewModel.RetakeManage;
- namespace EMIS.Web.Controllers.RetakeManage
- {
- [Authorization]
- public class RetakeConditionController : Controller
- {
- public IRetakeConditionServices RetakeConditionServices { get; set; }
- /// <summary>
- /// 条件限定页面
- /// </summary>
- /// <returns></returns>
- public ActionResult Index()
- {
- RetakeConditionPageView model = new RetakeConditionPageView();
- //查询重修条件信息View
- var nopassConditionView = RetakeConditionServices.GetRetakeConditionView(ER_RetakeConditionType.NotPassCount);
- //查询重修条件参数最小不及格门数
- var minNoPassCount = RetakeConditionServices.GetParameter<int>(ER_RetakeParameterType.MinNoPassCount);
- //查询重修条件参数最大不及格门数
- var maxNoPassCount = RetakeConditionServices.GetParameter<int>(ER_RetakeParameterType.MaxNoPassCount);
- if (nopassConditionView != null)
- {
- model.NoPassConditionTitle = nopassConditionView.Title;
- }
- else
- {
- model.NoPassConditionTitle = "不及格门数";
- }
- model.MinNoPassCount = minNoPassCount ?? 1;
- model.MaxNoPassCount = maxNoPassCount ?? 100;
- return View(model);
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="conditionPageView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Index(RetakeConditionPageView conditionPageView)
- {
- try
- {
- RetakeConditionServices.SetParameter(ER_RetakeParameterType.MinNoPassCount, conditionPageView.MinNoPassCount);
- RetakeConditionServices.SetParameter(ER_RetakeParameterType.MaxNoPassCount, conditionPageView.MaxNoPassCount);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败:" + ex.Message
- });
- }
- }
- }
- }
|