using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.ViewModel; using EMIS.Web.Controls; using EMIS.CommonLogic.ExamManage; using EMIS.ViewModel.ExamManage; using Bowin.Web.Controls.Mvc; using Bowin.Common.Utility; namespace EMIS.Web.Controllers.ScoreManage { [Authorization] public class LevelSettingController : Controller { public ILevelSettingSubjectServices levelSettingSubjectServices { get; set; } // public ActionResult List() { return View(); } [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var examinationSubjectID = pararms.getExtraGuid("ExaminationSubjectDropdown"); var examinationTypeID = pararms.getExtraGuid("ExaminationTypeDropdown"); return Json(levelSettingSubjectServices.GetLevelSettingViewGrid(configuretView, examinationTypeID, examinationSubjectID, (int)pararms.page, (int)pararms.rows)); } public ActionResult Edit(Guid? LevelSettingID) { ViewBag.Url = Request.Url.Host; LevelSettingView levelSettingView = new LevelSettingView(); if (LevelSettingID != null && LevelSettingID != Guid.Empty) { levelSettingView = levelSettingSubjectServices.GetLevelSettingView(LevelSettingID); } ViewBag.ID = LevelSettingID; return View(levelSettingView); } [HttpPost] public ActionResult Edit(LevelSettingView levelSettingView) { try { var LevelSettingSubject = DataGrid.GetTableData("dgLevelSettingSubjectList"); levelSettingSubjectServices.Edit(levelSettingView, LevelSettingSubject); return Json(new ReturnMessage() { IsSuccess = true, Message = "保存成功!" }); } catch (Exception ex) { return Json(new ReturnMessage() { IsSuccess = false, Message = "保存失败:" + ex.Message }); } } [HttpPost] public ActionResult Delete(string levelSettingIDs) { try { var levelSettingIDList = levelSettingIDs.Split(',').Select(x => (Guid?)new Guid(x)).ToList(); levelSettingSubjectServices.Delete(levelSettingIDList); return base.Json("删除成功"); } catch (Exception ex) { return base.Json("删除失败,原因:" + ex.Message + "!"); } } public ActionResult ExaminationSubjectSelect(Guid? examinationProjectID) { ViewBag.ExaminationProjectID = examinationProjectID; return View(); } [HttpPost] public ActionResult GetLevelSettingSubjectList(QueryParamsModel pararms, Guid? levelSettingID) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var levelSettingSubjectView = levelSettingSubjectServices.GetLevelSettingSubjectViewGridByID(levelSettingID, (int)pararms.page, (int)pararms.rows); return Json(levelSettingSubjectView); } [HttpPost] public ActionResult GetExaminationSubjectSelect(QueryParamsModel pararms, Guid? examinationProjectID) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); //var examinationProjectID = pararms.getExtraGuid("examinationProjectID"); //var examinationProjectID = Request.Form["examinationProjectID"].ParseStrTo(); return Json(levelSettingSubjectServices.GetExaminationSubjectDicSelect(examinationProjectID, (int)pararms.page, (int)pararms.rows)); } } }