GrademajorController.cs 26 KB

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