123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.ExaminationManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.ExaminationManage
- {
- [Authorization]
- public class ExaminationTeacherController : Controller
- {
- public IExaminationTeacherServices ExaminationTeacherServices { get; set; }
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- return base.Json(ExaminationTeacherServices.GetStaffViewList(configuretView, campusID, collegeID, departmentID, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- var dt = ExaminationTeacherServices.GetStaffViewList(configuretView, campusID, collegeID, departmentID).Select(x => new
- {
- x.StaffCode,
- x.Name,
- x.CampusName,
- x.CollegeName,
- x.DepartmentName,
- x.BirthDate,
- x.SexName,
- x.UsedName,
- x.NationName,
- x.Place,
- //x.EducationCodeName,
- x.Telephone,
- x.OfficeTelephone,
- x.Mobile,
- x.Email,
- x.QQ,
- x.Nationality,
- x.HealthStateName,
- x.HousePhone,
- x.Address,
- x.ZIPCode,
- x.HomeAddress,
- x.NowAddress,
- x.Residence,
- x.Speciality,
- x.WeChatNum,
- x.ReligionName,
- x.TeacherTypeName,
- x.IncumbencyStateName,
- x.CertificatesTypeName,
- x.CertificatesNum,
- x.SituationName,
- x.LiteracyLevelName,
- //x.DegreeStateName,
- x.LearnPositionName,
- x.TitleName,
- x.WorkDate,
- x.ComeSchoolDate,
- //x.TeachingDate,
- x.Profile,
- x.Remark
- }).ToTable();
- string[] liststring = { "教职工号", "姓名", RSL.Get("Campus"), RSL.Get("College"), "所在教研室", "出生日期", "性别",
- "曾用名", "民族", "籍贯", "学历", "家庭电话", "办公室电话", "移动电话", "电子邮箱", "QQ", "国籍",
- "健康状况", "住宅电话", "通信地址", "邮政编码", "家庭住址", "现住地址", "户口所在地", "特长", "微信号", "宗教信仰",
- "教师类别", "在职状态", "证件类型", "证件号码", "任课状况", "文化程度", "学位状况", "授予学位", "职称", "参加工作年月",
- "来校日期", "从教年月", "简介", "备注" };
- neh.Export(dt, liststring, "监考员信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/ExaminationTeacher/List").AddMenuParameter()
- });
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Add(string userIDs)
- {
- try
- {
- var userIDList = userIDs.Split(',').Select(x => (Guid?)new Guid(x)).ToList();
- ExaminationTeacherServices.Add(userIDList);
- return base.Json("添加成功");
- }
- catch (Exception ex)
- {
- return base.Json("添加失败,原因:" + ex.Message + "!");
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string userIDs)
- {
- try
- {
- var userIDList = userIDs.Split(',').Select(x => (Guid?)new Guid(x)).ToList();
- ExaminationTeacherServices.Delete(userIDList);
- return base.Json("删除成功");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message + "!");
- }
- }
- public ActionResult ExaminationTeacherSelect(Guid ExaminationPlanID)
- {
- return View();
- }
- public ActionResult ExaminationTeacherSelectGdss(Guid schoolyearID, Guid classroomID, DateTime examinationDate,
- TimeSpan startTime, TimeSpan endTime)
- {
- return View();
- }
- public ActionResult ExaminationAddTeacherSelect()
- {
- return View();
- }
- [HttpPost]
- public ActionResult AvailableList(QueryParamsModel pararms, Guid examinationPlanID, Guid classroomID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- return base.Json(ExaminationTeacherServices.GetAvailableStaffViewList(configuretView, examinationPlanID, classroomID, campusID, collegeID, departmentID, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult AvailableListGdss(QueryParamsModel pararms, Guid schoolyearID, DateTime examinationDate,
- TimeSpan startTime, TimeSpan endTime, Guid classroomID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- return base.Json(ExaminationTeacherServices.GetAvailableStaffViewGdssList(configuretView, schoolyearID,
- examinationDate, startTime, endTime, classroomID, campusID, collegeID, departmentID, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult AddAvailableList(QueryParamsModel pararms, Guid classroomID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var campusID = pararms.getExtraGuid("CampusDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- return base.Json(ExaminationTeacherServices.GetAddAvailableStaffViewList(configuretView, classroomID, campusID, collegeID, departmentID, (int)pararms.page, (int)pararms.rows));
- }
- }
- }
|