1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.SupervisionManage;
- using EMIS.ViewModel.SupervisionManage;
- using EMIS.Web.Controls;
- namespace EMIS.Web.Controllers.SupervisionManage
- {
- [Authorization]
- public class SupervisionUserController : Controller
- {
- public ISupervisionUserServices supervisionUserServices { get; set; }
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- return base.Json(supervisionUserServices.GetSupervisionUserGrid(configuretView, collegeID, (int)pararms.page, (int)pararms.rows));
- }
- [HttpGet]
- public ActionResult Edit(Guid? supervisionUserID)
- {
- ProjectRecordTeacherView projectRecordTeacherView = new ProjectRecordTeacherView();
- if (supervisionUserID.HasValue && supervisionUserID != Guid.Empty)
- {
- projectRecordTeacherView = supervisionUserServices.GetProjectRecordTeacherView(supervisionUserID);
- }
- return View(projectRecordTeacherView);
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="graduationConditionView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(ProjectRecordTeacherView projectRecordTeacherView)
- {
- try
- {
- supervisionUserServices.Save(projectRecordTeacherView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message + "。"
- });
- }
- }
- [HttpPost]
- public ActionResult Delete(string supervisionUserIDs)
- {
- try
- {
- var supervisionUserIDList = supervisionUserIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- supervisionUserServices.Delete(supervisionUserIDList);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + ex.Message });
- }
- }
- }
- }
|