ProjectScoreController.cs 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.ScoreManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.ViewModel.ScoreManage;
  11. namespace EMIS.Web.Controllers.ScoreManage
  12. {
  13. [Authorization]
  14. public class ProjectScoreController : Controller
  15. {
  16. public IProjectScoreServices ProjectScoreServices { get; set; }
  17. public ActionResult List()
  18. {
  19. return View();
  20. }
  21. public ActionResult Detail(Guid projectScoreID)
  22. {
  23. return View();
  24. }
  25. public ActionResult Generate()
  26. {
  27. return View(new ProjectScoreGenerateCondition());
  28. }
  29. [HttpPost]
  30. public ActionResult List(QueryParamsModel pararms)
  31. {
  32. ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  33. var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
  34. var examinationTypeID = pararms.getExtraGuid("ddlExaminationType");
  35. var examinationProjectID = pararms.getExtraGuid("cgbExaminationProject");
  36. var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
  37. var collegeID = pararms.getExtraGuid("ddlCollege");
  38. var yearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
  39. var standardID = pararms.getExtraInt("cgbStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cgbStandard");
  40. var classmajorID = pararms.getExtraGuid("cgbClassmajor");
  41. var hasTrain = pararms.getExtraInt("ddlIsTrain") == DropdownList.SELECT_ALL ? null : (bool?)(pararms.getExtraInt("ddlIsTrain") == (int)CF_GeneralPurpose.IsYes);
  42. return base.Json(ProjectScoreServices.GetProjectScoreViewGrid(conditionView, schoolyearID, examinationTypeID, examinationProjectID, schoolAreaID, collegeID,
  43. yearID, standardID, classmajorID, hasTrain, (int)pararms.page, (int)pararms.rows));
  44. }
  45. [HttpPost]
  46. public ActionResult DetailList(QueryParamsModel pararms, Guid projectScoreID)
  47. {
  48. ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  49. return base.Json(ProjectScoreServices.GetProjectScoreDetailViewGrid(conditionView, projectScoreID, (int)pararms.page, (int)pararms.rows));
  50. }
  51. [HttpPost]
  52. public ActionResult Generate(ProjectScoreGenerateCondition conditions)
  53. {
  54. try
  55. {
  56. if (!conditions.SchoolyearID.HasValue)
  57. {
  58. return Json(new ReturnMessage()
  59. {
  60. IsSuccess = false,
  61. Message = "请输入学年学期。"
  62. });
  63. }
  64. ProjectScoreServices.GenerateProjectScore(conditions.SchoolyearID.Value, conditions.ExaminationBatchID, conditions.ExaminationTypeID, conditions.ExaminationProjectID);
  65. return Json(new ReturnMessage()
  66. {
  67. IsSuccess = true,
  68. Message = "成绩认定完成。"
  69. });
  70. }
  71. catch (Exception ex)
  72. {
  73. return Json(new ReturnMessage()
  74. {
  75. IsSuccess = false,
  76. Message = "成绩认定失败:" + ex.Message
  77. });
  78. }
  79. }
  80. }
  81. }