123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- 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<LevelSettingSubjectView>("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<Guid>();
- return Json(levelSettingSubjectServices.GetExaminationSubjectDicSelect(examinationProjectID, (int)pararms.page, (int)pararms.rows));
- }
- }
- }
|