SupervisionCollegeController.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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.SupervisionManage;
  7. using Bowin.Web.Controls.Mvc;
  8. namespace EMIS.Web.Controllers.SupervisionManage
  9. {
  10. [Authorization]
  11. public class SupervisionCollegeController : Controller
  12. {
  13. public ISupervisionCollegeServices SupervisionCollegeServices { get; set; }
  14. [HttpPost]
  15. public ActionResult Dropdown(DropdownListBindType? bindType)
  16. {
  17. var supervisionCollegeList = SupervisionCollegeServices.GetSupervisionCollegeViewList()
  18. .Select(x => new DropdownListItem
  19. {
  20. Text = x.Name,
  21. Value = x.SupervisionCollegeID
  22. }).ToList();
  23. DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
  24. DropdownList.FormatDropdownItemList(dbt, supervisionCollegeList);
  25. return base.Json(supervisionCollegeList);
  26. }
  27. }
  28. }