123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.MinorManage.MinorSetting;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.ViewModel.MinorManage.MinorSetting;
- namespace EMIS.Web.Controllers.MinorManage.MinorSetting
- {
- [Authorization]
- public class MinorControlController : Controller
- {
- //
- // GET: /MinorControl/
- public IMinorControlServices minorControlServices { get; set; }
- /// <summary>
- /// 辅修控制列表查询
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 重修控制列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- Guid? schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- Guid? collegeID = pararms.getExtraGuid("CollegeComboGrid");
- int? gradeID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- return base.Json(minorControlServices.GetMinorControlViewList(configuretView, schoolyearID, gradeID, collegeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduationApplyID"></param>
- /// <returns></returns>
- public ActionResult CopyAdd(Guid minorControlID)
- {
- MinorControlView minorControlView = new MinorControlView();
- minorControlView = minorControlServices.GetMinorControlView(minorControlID);
- return View("Edit", minorControlView);
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduationApplyView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyAdd(MinorControlView minorControlView)
- {
- minorControlView.MinorControlID = Guid.Empty;
- return this.Edit(minorControlView);
- }
- public ActionResult Edit(Guid? minorControlID)
- {
- MinorControlView minorControlView = new MinorControlView();
- if (minorControlID.HasValue)
- {
- minorControlView = minorControlServices.GetMinorControlView(minorControlID);
- }
- return View(minorControlView);
- }
- /// <summary>
- /// 编辑(新增、修改)
- /// </summary>
- /// <param name="graduationApplyView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(MinorControlView minorControlView)
- {
- try
- {
- minorControlServices.MinorControlEdit(minorControlView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="graduationApplyIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string minorControlIDs)
- {
- try
- {
- List<Guid?> list = minorControlIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- minorControlServices.MinorControlDelete(list);
- return base.Json("删除成功。");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message);
- }
- }
- }
- }
|