using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.ViewModel.PaymentManage; using EMIS.CommonLogic.PaymentManage; using EMIS.ViewModel; using EMIS.Web.Controls; using Bowin.Web.Controls.Mvc; namespace EMIS.Web.Controllers.PaymentManage { [Authorization] public class LearningformRateController : Controller { public ILearningformRateServices LearningformRateServices { get; set; } public ActionResult List() { return View(); } public ActionResult Edit(Guid? LearningformRateID) { LearningformRateView learningformRateView = new LearningformRateView(); if (LearningformRateID.HasValue) { learningformRateView = LearningformRateServices.GetLearningformRateView(LearningformRateID); } else { learningformRateView.Rate = 1; } return View(learningformRateView); } [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(LearningformRateServices.GetLearningformRateViewList(configuretView, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult Edit(LearningformRateView learningformRateView) { try { LearningformRateServices.Save(learningformRateView); return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Delete(string learningformRateIDs) { try { List list = learningformRateIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList(); LearningformRateServices.Delete(list); return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" }); } catch (Exception ex) { return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message }); } } } }