ClassmajorController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using Bowin.Common.Data;
  8. using Bowin.Common.Exceptions;
  9. using Bowin.Common.Utility;
  10. using Bowin.Web.Controls.Mvc;
  11. using EMIS.Utility;
  12. using EMIS.Web.Controls;
  13. using EMIS.ViewModel;
  14. using EMIS.ViewModel.UniversityManage.SpecialtyClassManage;
  15. using EMIS.CommonLogic.UniversityManage.SpecialtyClassManage;
  16. namespace EMIS.Web.Controllers.UniversityManage.SpecialtyClassManage
  17. {
  18. [Authorization]
  19. public class ClassmajorController : Controller
  20. {
  21. public IClassmajorServices ClassmajorServices { get; set; }
  22. /// <summary>
  23. /// 班级信息页面
  24. /// </summary>
  25. /// <returns></returns>
  26. public ActionResult List()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 班级信息页面列表查询
  32. /// </summary>
  33. /// <param name="pararms"></param>
  34. /// <returns></returns>
  35. [HttpPost]
  36. public ActionResult List(QueryParamsModel pararms)
  37. {
  38. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  39. var campusID = pararms.getExtraGuid("CampusDropdown");
  40. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  41. var gradeID = pararms.getExtraInt("DictionaryGrade") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGrade");
  42. var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
  43. var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
  44. var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
  45. var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
  46. var grademajorID = pararms.getExtraGuid("GrademajorComboGrid");
  47. var semesterID = pararms.getExtraInt("DictionarySemester") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionarySemester");
  48. //在校状态
  49. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  50. return base.Json(ClassmajorServices.GetClassmajorViewGrid(configuretView, campusID, collegeID, gradeID, standardID, educationID,
  51. learningformID, learnSystem, grademajorID, semesterID, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
  52. }
  53. /// <summary>
  54. /// 查询对应的班级信息List(在校)
  55. /// </summary>
  56. /// <param name="pararms"></param>
  57. /// <returns></returns>
  58. [HttpPost]
  59. public ActionResult ListForInschool(QueryParamsModel pararms)
  60. {
  61. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  62. var campusID = pararms.getExtraGuid("CampusDropdown");
  63. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  64. var gradeID = pararms.getExtraInt("DictionaryGrade") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGrade");
  65. var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
  66. var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
  67. var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
  68. var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
  69. var grademajorID = pararms.getExtraGuid("GrademajorComboGrid");
  70. return base.Json(ClassmajorServices.GetClassmajorViewForInschoolGrid(configuretView, campusID, collegeID, gradeID, standardID, educationID,
  71. learningformID, learnSystem, grademajorID, (int)pararms.page, (int)pararms.rows));
  72. }
  73. /// <summary>
  74. /// 查询对应的班级信息List(带毕业学期)
  75. /// </summary>
  76. /// <param name="pararms"></param>
  77. /// <returns></returns>
  78. [HttpPost]
  79. public ActionResult ListForGraduate(QueryParamsModel pararms)
  80. {
  81. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  82. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  83. var gradeID = pararms.getExtraInt("DictionaryGrade") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGrade");
  84. var standardID = pararms.getExtraInt("DictionaryStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStandard");
  85. var educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
  86. var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
  87. var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
  88. var graduateSchoolyearID = pararms.getExtraGuid("GraduateSchoolyearDropdown");
  89. return base.Json(ClassmajorServices.GetClassmajorViewForGraduateGrid(configuretView, collegeID, standardID, gradeID, educationID,
  90. learningformID, learnSystem, graduateSchoolyearID, (int)pararms.page, (int)pararms.rows));
  91. }
  92. /// <summary>
  93. /// 查询对应的班级信息List
  94. /// </summary>
  95. /// <param name="bindType"></param>
  96. /// <param name="campusID"></param>
  97. /// <param name="collegeID"></param>
  98. /// <param name="educationID"></param>
  99. /// <param name="gradeID"></param>
  100. /// <param name="standardID"></param>
  101. /// <param name="learningformID"></param>
  102. /// <returns></returns>
  103. [HttpPost]
  104. public ActionResult BindDropdownList(DropdownListBindType? bindType, Guid? campusID, Guid? collegeID, int? educationID, int? gradeID, int? standardID, int? learningformID)
  105. {
  106. List<DropdownListItem> list = this.ClassmajorServices.GetClassmajorViewList(new ConfiguretView(), campusID, collegeID, gradeID, standardID, educationID, learningformID, null, null, null, null)
  107. .Select(x => new DropdownListItem
  108. {
  109. Text = x.Name,
  110. Value = x.ClassmajorID
  111. }).ToList();
  112. DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
  113. DropdownList.FormatDropdownItemList(dbt, list);
  114. return base.Json(list);
  115. }
  116. /// <summary>
  117. /// 查询对应的班级信息List
  118. /// </summary>
  119. /// <param name="bindType"></param>
  120. /// <param name="grademajorID"></param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. public ActionResult BindDropdownListByGrademajorID(DropdownListBindType? bindType, Guid? grademajorID)
  124. {
  125. List<DropdownListItem> list = this.ClassmajorServices.GetClassmajorByGrademajorIDList(grademajorID)
  126. .Select(x => new DropdownListItem
  127. {
  128. Text = x.Name,
  129. Value = x.ClassmajorID
  130. }).ToList();
  131. DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
  132. DropdownList.FormatDropdownItemList(dbt, list);
  133. return base.Json(list);
  134. }
  135. /// <summary>
  136. /// 查询对应的班级信息List
  137. /// </summary>
  138. /// <param name="bindType"></param>
  139. /// <param name="collegeID"></param>
  140. /// <param name="gradeID"></param>
  141. /// <param name="standardID"></param>
  142. /// <returns></returns>
  143. [HttpPost]
  144. public ActionResult BindDropdownListByYearOrStandard(DropdownListBindType? bindType, Guid? collegeID, int? gradeID, int? standardID)
  145. {
  146. List<DropdownListItem> list = this.ClassmajorServices.GetClassmajorList(collegeID, gradeID, standardID)
  147. .Select(x => new DropdownListItem
  148. {
  149. Text = x.Name,
  150. Value = x.ClassmajorID
  151. }).ToList();
  152. DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
  153. DropdownList.FormatDropdownItemList(dbt, list);
  154. return base.Json(list);
  155. }
  156. /// <summary>
  157. /// 复制新增
  158. /// </summary>
  159. /// <param name="classmajorID"></param>
  160. /// <returns></returns>
  161. public ActionResult CopyAdd(Guid classmajorID)
  162. {
  163. ClassmajorView classmajorView = new ClassmajorView();
  164. classmajorView = ClassmajorServices.GetClassmajorView(classmajorID);
  165. return View("Edit", classmajorView);
  166. }
  167. /// <summary>
  168. /// 复制新增
  169. /// </summary>
  170. /// <param name="classmajorView"></param>
  171. /// <returns></returns>
  172. [HttpPost]
  173. public ActionResult CopyAdd(ClassmajorView classmajorView)
  174. {
  175. classmajorView.ClassmajorID = Guid.Empty;
  176. return this.Edit(classmajorView);
  177. }
  178. /// <summary>
  179. /// 编辑(新增、修改,业务主键:班级编号或班级名称唯一)
  180. /// </summary>
  181. /// <param name="classmajorID"></param>
  182. /// <returns></returns>
  183. [HttpGet]
  184. public ActionResult Edit(Guid? classmajorID)
  185. {
  186. ClassmajorView classmajorView = new ClassmajorView();
  187. if (classmajorID.HasValue && classmajorID != Guid.Empty)
  188. {
  189. classmajorView = ClassmajorServices.GetClassmajorView(classmajorID);
  190. }
  191. else
  192. {
  193. classmajorView.ClassNum = 1;
  194. }
  195. return View(classmajorView);
  196. }
  197. /// <summary>
  198. /// 编辑(新增、修改,业务主键:班级编号或班级名称唯一)
  199. /// </summary>
  200. /// <param name="classmajorView"></param>
  201. /// <returns></returns>
  202. [HttpPost]
  203. public ActionResult Edit(ClassmajorView classmajorView)
  204. {
  205. try
  206. {
  207. ClassmajorServices.ClassmajorEdit(classmajorView);
  208. return Json(new ReturnMessage()
  209. {
  210. IsSuccess = true,
  211. Message = "保存成功。"
  212. });
  213. }
  214. catch (Exception ex)
  215. {
  216. return Json(new ReturnMessage()
  217. {
  218. IsSuccess = false,
  219. Message = "保存失败,原因:" + ex.Message
  220. });
  221. }
  222. }
  223. /// <summary>
  224. /// 班级复制(批量添加)
  225. /// </summary>
  226. /// <returns></returns>
  227. public ActionResult BatchAdd()
  228. {
  229. return View();
  230. }
  231. /// <summary>
  232. /// 班级复制(批量添加)
  233. /// </summary>
  234. /// <param name="classmajorView"></param>
  235. /// <returns></returns>
  236. [HttpPost]
  237. public ActionResult BatchAdd(ClassmajorView classmajorView)
  238. {
  239. try
  240. {
  241. var addReturn = ClassmajorServices.ClassmajorBatchAdd(classmajorView);
  242. return Json(new ReturnMessage()
  243. {
  244. IsSuccess = true,
  245. Message = "添加成功:" + addReturn
  246. });
  247. }
  248. catch (Exception ex)
  249. {
  250. return Json(new ReturnMessage()
  251. {
  252. IsSuccess = false,
  253. Message = "添加失败,原因:" + ex.Message
  254. });
  255. }
  256. }
  257. /// <summary>
  258. /// 删除
  259. /// </summary>
  260. /// <param name="classmajorIDs"></param>
  261. /// <returns></returns>
  262. [HttpPost]
  263. public ActionResult Delete(string classmajorIDs)
  264. {
  265. try
  266. {
  267. List<Guid?> list = classmajorIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  268. ClassmajorServices.ClassmajorDelete(list);
  269. return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
  270. }
  271. catch (Exception ex)
  272. {
  273. string mge = ex.Message;
  274. System.Data.SqlClient.SqlException num = ExceptionHelper.GetSqlException(ex);
  275. if (num != null)
  276. {
  277. if (num.Number == 547)
  278. {
  279. mge = "请先删除所有关联的数据,如:新生名单、学生信息、教学任务、期末设定等。";
  280. }
  281. }
  282. return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败,原因:" + mge });
  283. }
  284. }
  285. /// <summary>
  286. /// Excel导入
  287. /// </summary>
  288. /// <param name="errorFile"></param>
  289. /// <param name="operationTips"></param>
  290. /// <returns></returns>
  291. [HttpGet]
  292. public ActionResult Import(string errorFile, string operationTips)
  293. {
  294. ViewBag.ErrorFile = errorFile;
  295. if (string.IsNullOrEmpty(operationTips))
  296. {
  297. operationTips = "点击查看失败原因...";
  298. }
  299. ViewBag.operationTips = operationTips;
  300. return View();
  301. }
  302. /// <summary>
  303. /// Excel导入
  304. /// </summary>
  305. /// <param name="file"></param>
  306. /// <returns></returns>
  307. [HttpPost]
  308. public ActionResult Import(HttpPostedFileBase file)
  309. {
  310. try
  311. {
  312. if (!NpoiExcelHelper.GetIsCompatible(file.FileName))
  313. {
  314. throw new Exception("格式错误,只允许导入xls或xlsx格式的Excel文件。");
  315. }
  316. Dictionary<string, string> cellheader = new Dictionary<string, string>
  317. {
  318. { "No", "班级编号" },
  319. { "Name", "班级名称" },
  320. { "Abbreviation", "简称" },
  321. { "EnglishName", "英文名称" },
  322. { "GrademajorCode", "年级专业编号" },
  323. { "ClassNumStr", "班序" },
  324. { "UserName", "班主任" },
  325. { "AssistantUserName", "辅导员" },
  326. { "Fixedclassroom", "固定教室" },
  327. { "Remark", "备注" },
  328. { "ErrorMessage", "未导入原因" }
  329. };
  330. StringBuilder errorMsg = new StringBuilder();
  331. string sourceWebPath = FileUploadHelper.UploadFile(file);
  332. var sourcePhysicalPath = Server.MapPath(sourceWebPath);
  333. List<ClassmajorView> errList = new List<ClassmajorView>();
  334. List<ClassmajorView> dataList = new List<ClassmajorView>();
  335. int? inCount = 0; //导入个数
  336. int? upCount = 0; //更新个数
  337. int? errCount = 0; //失败个数
  338. //导入
  339. ClassmajorServices.ClassmajorImport(cellheader, out inCount, out upCount, out errList, out errCount, sourcePhysicalPath);
  340. System.IO.File.Delete(sourcePhysicalPath);//删除本地缓存文件
  341. if (errList.Count() > 0)
  342. {
  343. //获取错误数据文件路径
  344. string errorWebPath = string.Format("{0}", NpoiExcelHelper.EntityListToExcel2003(cellheader, errList, "班级信息导入失败文件", sourcePhysicalPath));
  345. ViewBag.ErrorFile = errorWebPath;
  346. string Errinfo = string.Format("提示:{0}条班级信息导入成功,{1}条班级信息更新成功,{2}条班级信息导入失败,点击查看。", inCount, upCount, errCount);
  347. ViewBag.operationTips = Errinfo;
  348. return RedirectToAction("MsgShow", "Common", new
  349. {
  350. WindowID = "none",
  351. msg = Errinfo,
  352. url = Url.Action("Import").AddMenuParameter() + "&errorFile=" + errorWebPath + "&operationTips=" + Errinfo + "&WindowID=" + Request["WindowID"]
  353. });
  354. }
  355. else
  356. {
  357. string successInfo = string.Format("提示:{0}条班级信息导入成功,{1}条班级信息更新成功。", inCount, upCount);
  358. return RedirectToAction("MsgShow", "Common", new
  359. {
  360. WindowID = Request["WindowID"],
  361. msg = successInfo,
  362. url = Url.Action("List").AddMenuParameter()
  363. });
  364. }
  365. }
  366. catch (Exception ex)
  367. {
  368. return RedirectToAction("MsgShow", "Common", new
  369. {
  370. WindowID = "none",
  371. msg = "导入失败,原因:" + ex.Message,
  372. url = Url.Action("Import").AddMenuParameter() + "&WindowID=" + Request["WindowID"]
  373. });
  374. }
  375. }
  376. /// <summary>
  377. /// 查询班级信息学生名单
  378. /// </summary>
  379. /// <returns></returns>
  380. public ActionResult ClassStudentListView()
  381. {
  382. return View();
  383. }
  384. /// <summary>
  385. /// 查询班级信息学生名单
  386. /// </summary>
  387. /// <param name="pararms"></param>
  388. /// <returns></returns>
  389. [HttpPost]
  390. public ActionResult ClassStudentListView(QueryParamsModel pararms)
  391. {
  392. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  393. var classmajorID = Request["classmajorID"].ParseStrTo<Guid>();
  394. //int? inSchoolStatus = Request["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionaryInschoolStatus"].ParseStrTo<int>();
  395. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  396. return Json(ClassmajorServices.GetStudentBaseViewGrid(configuretView, classmajorID, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
  397. }
  398. /// <summary>
  399. /// 班级学生明细Excel导出
  400. /// </summary>
  401. /// <param name="pararms"></param>
  402. /// <returns></returns>
  403. [HttpPost]
  404. public ActionResult Excel_ClassStudent()
  405. {
  406. NpoiExcelHelper neh = new NpoiExcelHelper();
  407. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  408. var classmajorID = Request["classmajorID"].ParseStrTo<Guid>();
  409. int? inSchoolStatus = Request["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request["DictionaryInschoolStatus"].ParseStrTo<int>();
  410. var dt = ClassmajorServices.GetStudentBaseViewList(configuretView, classmajorID, inSchoolStatus)
  411. .Select(x => new
  412. {
  413. x.LoginID,
  414. x.UserName,
  415. x.SexName,
  416. x.InSchoolStatusName,
  417. x.StudentStatusName,
  418. x.ClassmajorNo,
  419. x.ClassmajorName,
  420. x.GradeID,
  421. x.GrademajorCode,
  422. x.GrademajorName,
  423. x.FacultymajorCode,
  424. x.FacultymajorName
  425. }).ToTable();
  426. string[] liststring = {
  427. "学号", "姓名", "性别", "在校状态", "学籍状态", "班级编号", "班级名称", "年级","年级专业编号", "年级专业名称",
  428. "院系专业编号", "院系专业名称"
  429. };
  430. var title = "班级学生信息";
  431. if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.No)
  432. {
  433. title = "班级学生信息(非在校)";
  434. }
  435. if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.Yes)
  436. {
  437. title = "班级学生信息(在校)";
  438. }
  439. neh.Export(dt, liststring, title + DateTime.Now.ToString("yyyyMMdd"));
  440. return Json(new ReturnMessage()
  441. {
  442. IsSuccess = true,
  443. Message = "导出成功。"
  444. });
  445. }
  446. /// <summary>
  447. /// Excel导出
  448. /// </summary>
  449. /// <param name="pararms"></param>
  450. /// <returns></returns>
  451. [HttpPost]
  452. public ActionResult Excel()
  453. {
  454. NpoiExcelHelper neh = new NpoiExcelHelper();
  455. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  456. var campusID = Request.Form["CampusDropdown"].ParseStrTo<Guid>();
  457. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  458. var gradeID = Request.Form["DictionaryGrade"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGrade"].ParseStrTo<int>();
  459. var standardID = Request.Form["DictionaryStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStandard"].ParseStrTo<int>();
  460. var educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
  461. var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
  462. var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
  463. var grademajorID = Request.Form["GrademajorComboGrid"].ParseStrTo<Guid>();
  464. var semesterID = Request.Form["DictionarySemester"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionarySemester"].ParseStrTo<int>();
  465. //在校状态
  466. var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
  467. var dt = ClassmajorServices.GetClassmajorViewList(configuretView, campusID, collegeID, gradeID, standardID, educationID, learningformID, learnSystem, grademajorID, semesterID, inSchoolStatus)
  468. .Select(x => new
  469. {
  470. x.No,
  471. x.Name,
  472. x.Abbreviation,
  473. x.EnglishName,
  474. x.GrademajorCode,
  475. x.GrademajorName,
  476. x.ClassNum,
  477. x.GradeID,
  478. x.StandardCode,
  479. x.StandardID,
  480. x.StandardName,
  481. x.EducationName,
  482. x.LearningformName,
  483. LearnSystem = x.LearnSystem.HasValue ? x.LearnSystem.Value.ToString("#.#") : null,
  484. x.SemesterName,
  485. x.GraduateSchoolyearCode,
  486. x.CollegeCode,
  487. x.CollegeName,
  488. StandardNameCollegeName = x.StandardName + "(" + x.CollegeName + ")",
  489. x.UserName,
  490. x.AssistantUserName,
  491. x.Fixedclassroom,
  492. x.StudentCount,
  493. x.Remark
  494. }).ToTable();
  495. string[] liststring = {
  496. "班级编号", "班级名称", "简称", "英文名称", "年级专业编号", "年级专业名称", "班序", "年级", "专业代码", "专业ID(Value)",
  497. "专业名称", RSL.Get("EducationID"), "学习形式", "学制", "入学学期", "毕业学期", RSL.Get("CollegeCode"), RSL.Get("College"),
  498. "专业名称(" + RSL.Get("College") + ")", "班主任", "辅助员", "固定教室", "人数", "备注"
  499. };
  500. var title = "班级信息";
  501. if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.No)
  502. {
  503. title = "班级信息(非在校)";
  504. }
  505. if (inSchoolStatus == (int)CF_INOrOutSchoolStatus.Yes)
  506. {
  507. title = "班级信息(在校)";
  508. }
  509. neh.Export(dt, liststring, title + DateTime.Now.ToString("yyyyMMdd"));
  510. return Json(new ReturnMessage()
  511. {
  512. IsSuccess = true,
  513. Message = "导出成功。"
  514. });
  515. }
  516. }
  517. }