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 StudentCountRateController : Controller { public IStudentCountRateServices StudentCountRateServices { get; set; } public ActionResult List() { var commonStudentCountRate = StudentCountRateServices.GetCommonStudentCountRateView(); return View(commonStudentCountRate); } public ActionResult Edit(Guid? StudentCountRateID) { StudentCountRateView studentCountRateView = new StudentCountRateView(); if (StudentCountRateID.HasValue) { studentCountRateView = StudentCountRateServices.GetStudentCountRateView(StudentCountRateID); } return View(studentCountRateView); } [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = ""; return base.Json(StudentCountRateServices.GetStudentCountRateViewList(configuretView, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult CommonSave(StudentCountRateView studentCountRateView) { try { if (studentCountRateView != null) { StudentCountRateServices.Save(studentCountRateView); } return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Edit(StudentCountRateView studentCountRateView) { try { StudentCountRateServices.Save(studentCountRateView); return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Delete(string studentCountRateIDs) { try { List list = studentCountRateIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList(); StudentCountRateServices.Delete(list); return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" }); } catch (Exception ex) { return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message }); } } } }