123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.SchedulingManage.SchedulingSettings;
- using EMIS.CommonLogic.Cultureplan;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Entities;
- using EMIS.ViewModel.CalendarManage;
- using EMIS.ViewModel.Cultureplan;
- namespace EMIS.Web.Controllers.SchedulingManage.SchedulingSettings
- {
- [Authorization]
- public class CourseScheduleSettingController : Controller
- {
- public ICourseScheduleSettingServices courseScheduleSettingServices { get; set; }
- public ICoursematerialServices coursematerialServices { get; set; }
- //
- // GET: /CourseScheduleSetting/
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 课程可排时间设置列表
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- var courseLevelID = pararms.getExtraInt("DictionaryCourseLevel") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseLevel");
- var courseScienceID = pararms.getExtraInt("DictionaryCourseScience") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseScience");
- return Json(courseScheduleSettingServices.GetCourseScheduleSettingViewGrid(coursematerialID, courseLevelID, courseScienceID, (int)pararms.page, (int)pararms.rows));
- }
- public ActionResult Edit(Guid? coursematerialID)
- {
- CoursematerialView coursematerial = coursematerialServices.GetCoursematerialView(coursematerialID);
- return View(coursematerial);
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit()
- {
- try
- {
- Guid? coursematerialID = new Guid(Request.Form["CoursematerialID"]);
- var arrangementsList = DataGrid.GetTableData<ArrangementView>("dgArrangementsList");
- courseScheduleSettingServices.CourseScheduleSettingAdd(arrangementsList, coursematerialID);
- 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 coursematerialIDs)
- {
- try
- {
- List<Guid?> list = new List<Guid?>();
- for (int i = 0; i < coursematerialIDs.Split(',').Length; i++)
- {
- if (!string.IsNullOrEmpty(coursematerialIDs.Split(',')[i]))
- {
- Guid coursematerialID = new Guid(coursematerialIDs.Split(',')[i]);
- list.Add(coursematerialID);
- }
- }
- courseScheduleSettingServices.CourseScheduleSettingDelete(list);
- return Json("删除成功");
- }
- catch (Exception ex)
- {
- return Json("删除失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// 查看是否设置的排课时间
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ArrangementsList(Guid? coursematerialID)
- {
- return Json(courseScheduleSettingServices.GetArrangementViewGrid(coursematerialID));
- }
- }
- }
|