123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.CalendarManage;
- using EMIS.CommonLogic.SchedulingManage.SchedulingSettings;
- using EMIS.CommonLogic.UniversityManage.ClassroomManage;
- namespace EMIS.Web.Controllers.SchedulingManage.SchedulingSettings
- {
- [Authorization]
- public class ClassroomScheduleSettingController : Controller
- {
- public IClassroomScheduleSettingServices classroomScheduleSettingServices { get; set; }
- public IClassroomServices classroomServices { 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)
- {
- var classroomID = pararms.getExtraGuid("ClassroomComboGrid");
- var collegeID = pararms.getExtraGuid("CollegeComboGrid");
- var classroomTypeID = pararms.getExtraInt("DictionaryClassroomType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryClassroomType");
- return Json(classroomScheduleSettingServices.GetClassroomScheduleSettingViewGrid(classroomID, collegeID, classroomTypeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 设置
- /// </summary>
- /// <param name="classroomID"></param>
- /// <returns></returns>
- public ActionResult Edit(Guid? classroomID)
- {
- CF_Classroom classroom = classroomServices.GetClassroomInfo(classroomID);
- return View(classroom);
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit()
- {
- try
- {
- Guid? classroomID = new Guid(Request.Form["ClassroomID"]);
- var arrangementsList = DataGrid.GetTableData<ArrangementView>("dgArrangementsList");
- classroomScheduleSettingServices.ClassroomScheduleSettingAdd(arrangementsList, classroomID);
- 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 classroomIDs)
- {
- try
- {
- List<Guid?> list = new List<Guid?>();
- for (int i = 0; i < classroomIDs.Split(',').Length; i++)
- {
- if (!string.IsNullOrEmpty(classroomIDs.Split(',')[i]))
- {
- Guid classroomID = new Guid(classroomIDs.Split(',')[i]);
- list.Add(classroomID);
- }
- }
- classroomScheduleSettingServices.ClassroomScheduleSettingDelete(list);
- return Json("删除成功");
- }
- catch (Exception ex)
- {
- return Json("删除失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// 查看是否设置的排课时间
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ArrangementsList(Guid? classroomID)
- {
- return Json(classroomScheduleSettingServices.GetArrangementViewGrid(classroomID));
- }
- }
- }
|