using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.CommonLogic.PaymentManage; using EMIS.ViewModel.PaymentManage; using EMIS.ViewModel; using EMIS.Web.Controls; using Bowin.Web.Controls.Mvc; namespace EMIS.Web.Controllers.PaymentManage { [Authorization] public class LevelStandardController : Controller { public ILevelStandardServices LevelStandardServices { get; set; } public ActionResult List() { return View(); } public ActionResult Edit(Guid? LevelStandardID) { LevelStandardView levelStandardView = new LevelStandardView(); if (LevelStandardID.HasValue) { levelStandardView = LevelStandardServices.GetLevelStandardView(LevelStandardID); } return View(levelStandardView); } [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var employmentTypeID = pararms.getExtraInt("ddlEmploymentType") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlEmploymentType"); var teacherTypeID = pararms.getExtraInt("ddlTeacherType") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlTeacherType"); var paymentLevel = pararms.getExtraInt("ddlPaymentLevel") == DropdownList.PLEASE_SELECT ? null : pararms.getExtraInt("ddlPaymentLevel"); if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = ""; return base.Json(LevelStandardServices.GetLevelStandardViewList(configuretView, employmentTypeID, teacherTypeID, paymentLevel, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult Edit(LevelStandardView levelStandardView) { try { LevelStandardServices.Save(levelStandardView); return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Delete(string levelStandardIDs) { try { List list = levelStandardIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList(); LevelStandardServices.Delete(list); return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" }); } catch (Exception ex) { return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message }); } } } }