123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.SchedulingManage.SchedulingSettings;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.UniversityManage.SpecialtyClassManage;
- using EMIS.Entities;
- using EMIS.ViewModel.CalendarManage;
- using Bowin.Web.Controls.Mvc;
- namespace EMIS.Web.Controllers.SchedulingManage.SchedulingSettings
- {
- [Authorization]
- public class ClassmajorScheduleSettingController : Controller
- {
- public IClassmajorScheduleSettingServices classmajorScheduleSettingServices { get; set; }
- public IClassmajorServices classmajorServices { get; set; }
- //
- // GET: /ClassmajorScheduleSetting/
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
-
- var collegeID = pararms.getExtraGuid("CollegeComboGrid");
- var StandardID = pararms.getExtraInt("DictionaryStandard");
- var gradeYearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var classmajorID = pararms.getExtraGuid("ClassmajorComboGrid");
- return Json(classmajorScheduleSettingServices.GetClassmajorScheduleSettingViewGrid(classmajorID, StandardID, collegeID, gradeYearID, (int)pararms.page, (int)pararms.rows));
- }
- public ActionResult Edit(Guid? classmajorID)
- {
- CF_Classmajor classmajor = classmajorServices.GetClassmajorInfo(classmajorID);
- return View(classmajor);
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit()
- {
- try
- {
- Guid? classmajorID = new Guid(Request.Form["ClassmajorID"]);
- var arrangementsList = DataGrid.GetTableData<ArrangementView>("dgArrangementsList");
- classmajorScheduleSettingServices.ClassmajorScheduleSettingAdd(arrangementsList, classmajorID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存失败,原因:" + ex.Message + "!"
- });
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string classmajorIDs)
- {
- try
- {
- List<Guid?> list = new List<Guid?>();
- for (int i = 0; i < classmajorIDs.Split(',').Length; i++)
- {
- if (!string.IsNullOrEmpty(classmajorIDs.Split(',')[i]))
- {
- Guid classmajorID = new Guid(classmajorIDs.Split(',')[i]);
- list.Add(classmajorID);
- }
- }
- classmajorScheduleSettingServices.ClassmajorScheduleSettingDelete(list);
- return Json("删除成功");
- }
- catch (Exception ex)
- {
- return Json("删除失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// 查看是否设置的排课时间
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ArrangementsList(Guid? classmajorID)
- {
- return Json(classmajorScheduleSettingServices.GetArrangementViewGrid(classmajorID));
- }
- }
- }
|