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; namespace EMIS.Web.Controllers.PaymentManage { [Authorization] public class PracticeRateController : Controller { public IPracticeRateServices PracticeRateServices { get; set; } public ActionResult List() { return View(); } public ActionResult Edit(Guid? PracticeRateID) { PracticeRateView practiceRateView = new PracticeRateView(); if (PracticeRateID.HasValue) { practiceRateView = PracticeRateServices.GetPracticeRateView(PracticeRateID); } return View(practiceRateView); } [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(PracticeRateServices.GetPracticeRateViewList(configuretView, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult Edit(PracticeRateView practiceRateView) { try { PracticeRateServices.Save(practiceRateView); return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Delete(string practiceRateIDs) { try { List list = practiceRateIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList(); PracticeRateServices.Delete(list); return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" }); } catch (Exception ex) { return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message }); } } } }