FacultymajorStudentCountController.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.Students.HighBaseTable;
  7. using EMIS.ViewModel;
  8. namespace EMIS.Web.Controllers.StudentManage.HighBaseTable
  9. {
  10. [Authorization]
  11. public class FacultymajorStudentCountController : Controller
  12. {
  13. public IFacultymajorStudentCountServices FacultymajorStudentCountServices { get; set; }
  14. public ActionResult Index()
  15. {
  16. return View();
  17. }
  18. [HttpPost]
  19. public ActionResult Generate(int year)
  20. {
  21. try
  22. {
  23. FacultymajorStudentCountServices.GenerateReport(DateTime.Today.Year);
  24. return Json(new ReturnMessage()
  25. {
  26. IsSuccess = true,
  27. Message = "更新成功。"
  28. });
  29. }
  30. catch (Exception ex)
  31. {
  32. return Json(new ReturnMessage()
  33. {
  34. IsSuccess = false,
  35. Message = "更新失败,原因:" + ex.Message
  36. });
  37. }
  38. }
  39. }
  40. }