ResitExaminationController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using EMIS.Web.Controls;
  8. using EMIS.CommonLogic.ScoreManage;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.ViewModel.ScoreManage;
  11. using EMIS.ViewModel.Students;
  12. using Bowin.Common.Exceptions;
  13. using Bowin.Common.Utility;
  14. using EMIS.CommonLogic.CalendarManage;
  15. using Bowin.Common.Data;
  16. using EMIS.CommonLogic.Students;
  17. using EMIS.Utility;
  18. namespace EMIS.Web.Controllers.ScoreManage
  19. {
  20. [Authorization]
  21. public class ResitExaminationController : Controller
  22. {
  23. public Lazy<IFinalExaminationServices> finalExaminationServices { get; set; }
  24. public Lazy<IStudentsServices> StudentfileServices { get; set; }
  25. public Lazy<ISchoolYearServices> SchoolYearServices { get; set; }
  26. /// <summary>
  27. /// 补考设定页面
  28. /// </summary>
  29. /// <returns></returns>
  30. public ActionResult List()
  31. {
  32. var schoolYear = SchoolYearServices.Value.GetSchoolYearIsCurrent(true);
  33. ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
  34. return View();
  35. }
  36. /// <summary>
  37. /// 补考设定列表查询
  38. /// </summary>
  39. /// <param name="pararms"></param>
  40. /// <returns></returns>
  41. [HttpPost]
  42. public ActionResult List(QueryParamsModel pararms)
  43. {
  44. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  45. var collegeID = pararms.getExtraGuid("CollegeComboGrid");
  46. var departmentID = pararms.getExtraGuid("DepartmentComboGrid");
  47. var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
  48. var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCourseType");
  49. var examsCategoryID = pararms.getExtraInt("DictionaryExamsCategory") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryExamsCategory");
  50. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
  51. var approvalStatus = pararms.getExtraInt("DictionaryScoreState") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryScoreState");
  52. var gradeYearID = pararms.getExtraInt("DictionaryGrade") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGrade");
  53. return Json(finalExaminationServices.Value.GetFinalExaminationViewGrid(configuretView, collegeID, departmentID, schoolyearID, coursematerialID, courseTypeID, examsCategoryID,
  54. (int)EMIS.ViewModel.CF_ExaminationType.ResitExamination, approvalStatus, gradeYearID, (int)pararms.page, (int)pararms.rows));
  55. }
  56. /// <summary>
  57. /// 编辑
  58. /// </summary>
  59. /// <param name="finalExaminationID"></param>
  60. /// <returns></returns>
  61. public ActionResult Edit(Guid? finalExamination, string aType)
  62. {
  63. FinalExaminationView finalExaminationView = new FinalExaminationView();
  64. var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
  65. var schoolYear = SchoolYearServices.Value.GetSchoolYearIsCurrent(true);
  66. if (finalExamination.HasValue)
  67. {
  68. finalExaminationView = finalExaminationServices.Value.GetFinalExaminationView(finalExamination);
  69. }
  70. else
  71. {
  72. finalExaminationView.CollegeID = curUser.CollegeID;
  73. finalExaminationView.SchoolyearID = schoolYear.SchoolyearID;
  74. finalExaminationView.GradeYearID = schoolYear.Years;
  75. finalExaminationView.ExamsCategoryID = (int)CF_ExamsCategory.Resit;
  76. finalExaminationView.ExaminationModeID = (int)CF_ExaminationMode.WrittenExam;
  77. finalExaminationView.ResultTypeID = (int)CF_ResultType.Percentage;
  78. finalExaminationView.TotalHours = 0;
  79. }
  80. if (aType == "add")
  81. {
  82. finalExaminationView.FinalExaminationID = null;
  83. }
  84. return View(finalExaminationView);
  85. }
  86. /// <summary>
  87. /// 新增/编辑
  88. /// </summary>
  89. /// <param name="finalExaminationView"></param>
  90. /// <returns></returns>
  91. [HttpPost]
  92. public ActionResult Edit(FinalExaminationView finalExaminationView)
  93. {
  94. try
  95. {
  96. finalExaminationView.ExaminationType = (int)EMIS.ViewModel.CF_ExaminationType.ResitExamination;
  97. var studentList = DataGrid.GetTableData<BaseStudentView>("dgStudentList");
  98. var ClassmajorID = finalExaminationView.ClassID;
  99. List<Guid?> ClassmajorIDList = new List<Guid?>();
  100. if (ClassmajorID != null)
  101. {
  102. ClassmajorIDList = ClassmajorID.SplitIDString();
  103. }
  104. finalExaminationServices.Value.FinalExaminationAdd(finalExaminationView, ClassmajorIDList);
  105. return Json(new ReturnMessage()
  106. {
  107. IsSuccess = true,
  108. Message = "保存成功。"
  109. });
  110. }
  111. catch (Exception ex)
  112. {
  113. return Json(new ReturnMessage()
  114. {
  115. IsSuccess = false,
  116. Message = "保存失败:" + ex.Message
  117. });
  118. }
  119. }
  120. /// <summary>
  121. /// 增加学生
  122. /// </summary>
  123. /// <param name="finalExaminationID"></param>
  124. /// <returns></returns>
  125. public ActionResult StudentEdit(Guid? finalExamination)
  126. {
  127. FinalExaminationView finalExaminationView = new FinalExaminationView();
  128. var schoolYear = SchoolYearServices.Value.GetSchoolYearIsCurrent(true);
  129. if (finalExamination.HasValue)
  130. {
  131. finalExaminationView = finalExaminationServices.Value.GetFinalExaminationView(finalExamination);
  132. }
  133. else
  134. {
  135. finalExaminationView.SchoolyearID = schoolYear.SchoolyearID;
  136. finalExaminationView.GradeYearID = schoolYear.Years;
  137. finalExaminationView.ExamsCategoryID = (int)CF_ExamsCategory.FinalExam;
  138. finalExaminationView.ExaminationModeID = (int)CF_ExaminationMode.WrittenExam;
  139. }
  140. return View(finalExaminationView);
  141. }
  142. /// <summary>
  143. /// 增加学生
  144. /// </summary>
  145. /// <param name="finalExaminationView"></param>
  146. /// <returns></returns>
  147. [HttpPost]
  148. public ActionResult StudentEdit(FinalExaminationView finalExaminationView)
  149. {
  150. try
  151. {
  152. finalExaminationView.ExaminationType = (int)EMIS.ViewModel.CF_ExaminationType.FinalExamination;
  153. var studentList = DataGrid.GetTableData<BaseStudentView>("dgStudentList");
  154. finalExaminationServices.Value.FinalExaminationStudentAdd(finalExaminationView.FinalExaminationID, studentList);
  155. return Json(new ReturnMessage()
  156. {
  157. IsSuccess = true,
  158. Message = "保存成功。"
  159. });
  160. }
  161. catch (Exception ex)
  162. {
  163. return Json(new ReturnMessage()
  164. {
  165. IsSuccess = false,
  166. Message = "保存失败:" + ex.Message
  167. });
  168. }
  169. }
  170. /// <summary>
  171. /// 添加学生
  172. /// </summary>
  173. /// <param name="finalExaminationID"></param>
  174. /// <returns></returns>
  175. public ActionResult StudentAdd(Guid? finalExamination, Guid? UserID)
  176. {
  177. FinalExaminationView finalExaminationView = new FinalExaminationView();
  178. finalExaminationView = finalExaminationServices.Value.GetFinalExaminationView(finalExamination);
  179. finalExaminationView.isAutoAdd = true;
  180. if (UserID != Guid.Empty && UserID != null)
  181. {
  182. var student = StudentfileServices.Value.GetStudentfileView((Guid)UserID);
  183. var StarttermID = finalExaminationServices.Value.GetFinalExaminationStudentForStudentAdd(finalExamination, UserID);
  184. var f = finalExaminationServices.Value.GetStarttermID(finalExamination, UserID);
  185. finalExaminationView.UserID = UserID;
  186. finalExaminationView.UserName = student.UserName;
  187. finalExaminationView.StarttermID = StarttermID.StarttermID;
  188. //如果是修改变成false
  189. finalExaminationView.isAutoAdd = false;
  190. }
  191. return View(finalExaminationView);
  192. }
  193. /// <summary>
  194. /// 添加学生
  195. /// </summary>
  196. /// <param name="finalExaminationID"></param>
  197. /// <returns></returns>
  198. [HttpPost]
  199. public ActionResult StudentAdd(FinalExaminationView finalExaminationView)
  200. {
  201. try
  202. {
  203. finalExaminationServices.Value.StudentAdd(finalExaminationView);
  204. return Json(new ReturnMessage()
  205. {
  206. IsSuccess = true,
  207. Message = "保存成功。"
  208. });
  209. }
  210. catch (Exception ex)
  211. {
  212. return Json(new ReturnMessage()
  213. {
  214. IsSuccess = false,
  215. Message = "保存失败:" + ex.Message
  216. });
  217. }
  218. }
  219. /// <summary>
  220. /// 删除
  221. /// </summary>
  222. /// <param name="finalExaminationIDs"></param>
  223. /// <returns></returns>
  224. [HttpPost]
  225. public ActionResult Delete(string finalExaminationIDs)
  226. {
  227. try
  228. {
  229. List<Guid?> list = new List<Guid?>();
  230. for (int i = 0; i < finalExaminationIDs.Split(',').Length; i++)
  231. {
  232. if (!string.IsNullOrEmpty(finalExaminationIDs.Split(',')[i]))
  233. {
  234. Guid FinalExaminationID = new Guid(finalExaminationIDs.Split(',')[i]);
  235. list.Add(FinalExaminationID);
  236. }
  237. }
  238. finalExaminationServices.Value.FinalExaminationDelete(list);
  239. return this.Json("删除成功!");
  240. }
  241. catch (Exception ex)
  242. {
  243. string mge = ex.Message;
  244. System.Data.SqlClient.SqlException num = ExceptionHelper.GetSqlException(ex);
  245. if (num != null)
  246. {
  247. if (num.Number == 547)
  248. mge = "请先删除所有关联的数据!";
  249. }
  250. return this.Json("删除失败,原因:" + mge);
  251. }
  252. }
  253. /// <summary>
  254. /// 删除学生
  255. /// </summary>
  256. /// <param name="finalExaminationIDs"></param>
  257. /// <returns></returns>
  258. [HttpPost]
  259. public ActionResult StudentDelete(Guid finalExaminationID, string UserIDs)
  260. {
  261. try
  262. {
  263. List<Guid?> list = new List<Guid?>();
  264. for (int i = 0; i < UserIDs.Split(',').Length; i++)
  265. {
  266. if (!string.IsNullOrEmpty(UserIDs.Split(',')[i]))
  267. {
  268. Guid FinalExaminationID = new Guid(UserIDs.Split(',')[i]);
  269. list.Add(FinalExaminationID);
  270. }
  271. }
  272. finalExaminationServices.Value.FinalExaminationStudentDelete(finalExaminationID, list);
  273. return this.Json("删除成功!");
  274. }
  275. catch (Exception ex)
  276. {
  277. string mge = ex.Message;
  278. System.Data.SqlClient.SqlException num = ExceptionHelper.GetSqlException(ex);
  279. if (num != null)
  280. {
  281. if (num.Number == 547)
  282. mge = "请先删除所有关联的数据!";
  283. }
  284. return this.Json("删除失败,原因:" + mge);
  285. }
  286. }
  287. /// <summary>
  288. ///
  289. /// </summary>
  290. /// <param name="schoolYearID"></param>
  291. /// <returns></returns>
  292. public ActionResult GenerateFinalExaminationEdit(Guid? schoolYearID)
  293. {
  294. var schoolYear = SchoolYearServices.Value.GetSchoolYearViewBeforeCurrent();
  295. ViewBag.SchoolYearID = schoolYear == null ? DropdownList.PLEASE_SELECT.ToString() : schoolYear.SchoolYearID.ToString();
  296. return View();
  297. }
  298. /// <summary>
  299. /// 期末补考生成,按兵良要求,加上院系所、年级、专业下拉条件 增加班级条件
  300. /// </summary>
  301. /// <returns></returns>
  302. [HttpPost]
  303. public ActionResult GenerateFinalExaminationEdit()
  304. {
  305. try
  306. {
  307. var schoolYearID = Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  308. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  309. var gradeID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
  310. var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
  311. var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
  312. finalExaminationServices.Value.GenerateResitExamination(schoolYearID, collegeID, gradeID, standardID, classmajorID);
  313. return Json(new ReturnMessage()
  314. {
  315. IsSuccess = true,
  316. Message = "生成成功。"
  317. });
  318. }
  319. catch (Exception ex)
  320. {
  321. return Json(new ReturnMessage()
  322. {
  323. IsSuccess = false,
  324. Message = "生成失败:" + ex.Message
  325. });
  326. }
  327. }
  328. /// <summary>
  329. ///
  330. /// </summary>
  331. /// <param name="schoolYearID"></param>
  332. /// <returns></returns>
  333. public ActionResult GenerateResitExaminationEdit(Guid? schoolYearID)
  334. {
  335. var schoolYear = SchoolYearServices.Value.GetSchoolYearIsCurrent(true);
  336. ViewBag.SchoolYearID = schoolYear == null ? DropdownList.PLEASE_SELECT.ToString() : schoolYear.SchoolyearID.ToString();
  337. return View();
  338. }
  339. /// <summary>
  340. /// 毕业补考生成
  341. /// </summary>
  342. /// <returns></returns>
  343. [HttpPost]
  344. public ActionResult GenerateResitExaminationEdit()
  345. {
  346. try
  347. {
  348. //var year = Request.Form["ddlYear"].ParseStrTo<int>();
  349. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  350. var year = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
  351. var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
  352. var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
  353. var learnSystem = Request.Form["DictionaryLearnSystem"].ParseStrTo<decimal>();
  354. finalExaminationServices.Value.GenerateGraduationExam(year, collegeID, standardID, classmajorID, learnSystem);
  355. return Json(new ReturnMessage()
  356. {
  357. IsSuccess = true,
  358. Message = "生成成功。"
  359. });
  360. }
  361. catch (Exception ex)
  362. {
  363. return Json(new ReturnMessage()
  364. {
  365. IsSuccess = false,
  366. Message = "生成失败:" + ex.Message
  367. });
  368. }
  369. }
  370. /// <summary>
  371. /// 学生成绩录入名单
  372. /// </summary>
  373. /// <returns></returns>
  374. public ActionResult StudentList(Guid? finalExaminationID)
  375. {
  376. ViewBag.FinalExaminationID = finalExaminationID;
  377. return View();
  378. }
  379. /// <summary>
  380. /// 补考设定学生成绩录入名单
  381. /// </summary>
  382. /// <param name="pararms"></param>
  383. /// <returns></returns>
  384. [HttpPost]
  385. public ActionResult ResitExaminationStudentList()
  386. {
  387. var finalExaminationID = Request["finalExaminationID"].ParseStrTo<Guid>();
  388. return Json(finalExaminationServices.Value.GetFinalExaminationStudent(finalExaminationID));
  389. }
  390. ///// <summary>
  391. ///// 添加学生
  392. ///// </summary>
  393. ///// <param name="finalExaminationID"></param>
  394. ///// <param name="userIDs"></param>
  395. ///// <returns></returns>
  396. //[HttpPost]
  397. //public ActionResult ResitExaminationStudentAdd(Guid? finalExaminationID, string userIDs)
  398. //{
  399. // try
  400. // {
  401. // List<Guid> list = new List<Guid>();
  402. // for (int i = 0; i < userIDs.Split(',').Length; i++)
  403. // {
  404. // if (!string.IsNullOrEmpty(userIDs.Split(',')[i]))
  405. // {
  406. // Guid userID = new Guid(userIDs.Split(',')[i]);
  407. // list.Add(userID);
  408. // }
  409. // }
  410. // finalExaminationServices.Value.FinalExaminationStudentAdd(finalExaminationID, list);
  411. // return Json("成功");
  412. // }
  413. // catch (Exception ex)
  414. // {
  415. // return Json("增加学生失败,原因:" + ex.Message);
  416. // }
  417. //}
  418. /// <summary>
  419. /// 导出Excel
  420. /// </summary>
  421. /// <returns></returns>
  422. [HttpPost]
  423. public ActionResult Excel()
  424. {
  425. NpoiExcelHelper neh = new NpoiExcelHelper();
  426. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  427. var FinalExaminationID = Request.Form["FinalExaminationID"];
  428. var collegeID = Request.Form["CollegeComboGrid"].ParseStrTo<Guid>();
  429. var departmentID = Request.Form["DepartmentComboGrid"].ParseStrTo<Guid>();
  430. var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
  431. var courseTypeID = Request.Form["DictionaryCourseType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCourseType"].ParseStrTo<int>();
  432. var examsCategoryID = Request.Form["DictionaryExamsCategory"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryExamsCategory"].ParseStrTo<int>();
  433. var schoolyearID = Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  434. var approvalStatus = Request.Form["DictionaryScoreState"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryScoreState"].ParseStrTo<int>();
  435. var gradeYearID = Request.Form["DictionaryGrade"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGrade"].ParseStrTo<int>();
  436. List<Guid?> FinalExaminationIDList = new List<Guid?>();
  437. if (FinalExaminationID != "")
  438. {
  439. FinalExaminationIDList = FinalExaminationID.SplitIDString();
  440. }
  441. else
  442. {
  443. FinalExaminationIDList = null;
  444. }
  445. var dt = finalExaminationServices.Value.GetFinalExaminationViewList_Excel(configuretView, collegeID, departmentID, schoolyearID, coursematerialID, courseTypeID, examsCategoryID,
  446. (int)EMIS.ViewModel.CF_ExaminationType.ResitExamination, approvalStatus, gradeYearID, FinalExaminationIDList).Select(x => new
  447. {
  448. x.SchoolyearCode,
  449. x.GradeYearID,
  450. x.ClassName,
  451. x.CourseCode,
  452. x.CourseName,
  453. x.CourseTypeName,
  454. x.Credit,
  455. x.ExamsCategoryName,
  456. x.CreatorUserNo,
  457. x.CreatorUserName,
  458. x.EntryDeadlineTime,
  459. x.StudentCount,
  460. x.SAPunlogStudentCount,
  461. x.ApprovalStatusName
  462. }).ToTable();
  463. string[] liststring = { "学年学期", "年级", "录入班级名称", "课程代码", "课程名称","课程类型","学分", "考试性质","录入人编号", "录入人姓名",
  464. "录入截止日期","学生数","未录入人数","状态" };
  465. neh.Export(dt, liststring, "补考设定信息");
  466. return RedirectToAction("MsgShow", "Common", new
  467. {
  468. msg = "导出成功!",
  469. url = Url.Action("List").AddMenuParameter()
  470. });
  471. }
  472. /// <summary>
  473. /// 导出Excel
  474. /// </summary>
  475. /// <returns></returns>
  476. [HttpPost]
  477. public ActionResult StudentDetails_Excel()
  478. {
  479. NpoiExcelHelper neh = new NpoiExcelHelper();
  480. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  481. var FinalExaminationID = Request.Form["FinalExaminationID"];
  482. var collegeID = Request.Form["CollegeComboGrid"].ParseStrTo<Guid>();
  483. var departmentID = Request.Form["DepartmentComboGrid"].ParseStrTo<Guid>();
  484. var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
  485. var courseTypeID = Request.Form["DictionaryCourseType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCourseType"].ParseStrTo<int>();
  486. var examsCategoryID = Request.Form["DictionaryExamsCategory"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryExamsCategory"].ParseStrTo<int>();
  487. var schoolyearID = Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  488. var approvalStatus = Request.Form["DictionaryScoreState"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryScoreState"].ParseStrTo<int>();
  489. var gradeYearID = Request.Form["DictionaryGrade"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGrade"].ParseStrTo<int>();
  490. List<Guid?> FinalExaminationIDList = new List<Guid?>();
  491. if (FinalExaminationID != "")
  492. {
  493. FinalExaminationIDList = FinalExaminationID.SplitIDString();
  494. }
  495. else
  496. {
  497. FinalExaminationIDList = null;
  498. }
  499. var dt = finalExaminationServices.Value.GetFinalExaminationStudentDetailsList(configuretView, collegeID, departmentID, schoolyearID, coursematerialID, courseTypeID, examsCategoryID,
  500. (int)EMIS.ViewModel.CF_ExaminationType.ResitExamination, approvalStatus, gradeYearID, FinalExaminationIDList).Select(x => new
  501. {
  502. x.SchoolyearCode,
  503. x.ClassName,
  504. x.CourseCode,
  505. x.CourseName,
  506. x.CourseTypeName,
  507. x.Credit,
  508. x.ExamsCategoryName,
  509. x.LoginID,
  510. x.UserName,
  511. x.CollegeName,
  512. x.Year,
  513. x.StandardName,
  514. x.ClassmajorName,
  515. }).ToTable();
  516. string[] liststring = { "学年学期","录入班级", "课程代码", "课程名称", "课程类型","学分","考试性质", "学号","姓名",RSL.Get("College"),
  517. "年级","专业名称","班级名称" };
  518. neh.Export(dt, liststring, "成绩录入学生名单" + DateTime.Now.ToString("yyyyMMdd"));
  519. return RedirectToAction("MsgShow", "Common", new
  520. {
  521. msg = "导出成功!",
  522. url = Url.Action("List").AddMenuParameter()
  523. });
  524. }
  525. /// <summary>
  526. /// 查找默认开课学期
  527. /// </summary>
  528. /// <param name="finalExaminationIDs"></param>
  529. /// <returns></returns>
  530. [HttpPost]
  531. public ActionResult GetStarttermID(Guid? finalExaminationID, Guid? UserID)
  532. {
  533. var value = finalExaminationServices.Value.GetStarttermID(finalExaminationID, UserID);
  534. return Json(value);
  535. }
  536. /// <summary>
  537. /// 查找默认开课学期
  538. /// </summary>
  539. /// <param name="finalExaminationIDs"></param>
  540. /// <returns></returns>
  541. [HttpPost]
  542. public ActionResult Verification(Guid? finalExaminationID, Guid? UserID)
  543. {
  544. var Student = finalExaminationServices.Value.GetFinalExaminationStudentForStudentAdd(finalExaminationID, UserID);
  545. if (Student == null)
  546. {
  547. return base.Json("不存在");
  548. }
  549. else
  550. {
  551. return base.Json("存在");
  552. }
  553. }
  554. }
  555. }