FacultymajorController.cs 25 KB

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