HighbaseInschoolOtherStatusController.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. using Bowin.Web.Controls.Mvc;
  9. namespace EMIS.Web.Controllers.StudentManage.HighBaseTable
  10. {
  11. [Authorization]
  12. public class HighbaseInschoolOtherStatusController : Controller
  13. {
  14. public IInschoolOtherStatusServices InschoolOtherStatusServices { get; set; }
  15. public ActionResult List()
  16. {
  17. return View();
  18. }
  19. [HttpPost]
  20. public ActionResult Update()
  21. {
  22. try
  23. {
  24. InschoolOtherStatusServices.Update(DateTime.Now.Year);
  25. return Json(new ReturnMessage()
  26. {
  27. IsSuccess = true,
  28. Message = "更新成功!"
  29. });
  30. }
  31. catch (Exception ex)
  32. {
  33. return Json(new ReturnMessage()
  34. {
  35. IsSuccess = false,
  36. Message = "更新失败,原因:" + ex.Message + "!"
  37. });
  38. }
  39. }
  40. [HttpPost]
  41. public ActionResult SchoolYearDropDown(DropdownListBindType? bindType)
  42. {
  43. List<DropdownListItem> list = InschoolOtherStatusServices.SchoolYearDropDownList()
  44. .Select(x => new DropdownListItem { Text = x, Value = x })
  45. .OrderByDescending(x => x.Value).ToList();
  46. DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
  47. DropdownList.FormatDropdownItemList(dbt, list);
  48. return base.Json(list);
  49. }
  50. }
  51. }