ScoreRuleController.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMISOnline.CommonLogic.EducationalServices;
  7. using EMISOnline.Entities;
  8. using EMISOnline.ViewModel;
  9. namespace EMISOnline.Web.Controllers.Manage
  10. {
  11. public class ScoreRuleController : Controller
  12. {
  13. //计分规则
  14. public IScoreRuleServices IScoreRuleServices { get; set; }
  15. public ActionResult List()
  16. {
  17. return View();
  18. }
  19. [HttpPost]
  20. public ActionResult List(int page, int rows)
  21. {
  22. var result = IScoreRuleServices.GetScoreRuleList(page, rows);
  23. return Json(result);
  24. }
  25. public ActionResult Edit(Guid? ScoreRuleID)
  26. {
  27. ER_ScoreRule model = new ER_ScoreRule();
  28. if (ScoreRuleID.HasValue)
  29. {
  30. model = IScoreRuleServices.GetScoreRule(ScoreRuleID.Value);
  31. }
  32. else
  33. {
  34. model.ScoreRuleID = Guid.NewGuid();
  35. }
  36. return View(model);
  37. }
  38. [HttpPost]
  39. public ActionResult Edit(ER_ScoreRule model)
  40. {
  41. try
  42. {
  43. IScoreRuleServices.AddScoreRule(model);
  44. return Json(new ReturnMessage()
  45. {
  46. IsSuccess = true,
  47. Message = "保存成功!"
  48. });
  49. }
  50. catch (Exception ex)
  51. {
  52. return Json(new ReturnMessage()
  53. {
  54. IsSuccess = false,
  55. Message = "保存失败:" + ex.Message
  56. });
  57. }
  58. }
  59. public ActionResult TeacherScoreIndex()
  60. {
  61. return View();
  62. }
  63. public JsonResult TeacherSetStuScoreList()
  64. {
  65. return Json(null,JsonRequestBehavior.AllowGet);
  66. }
  67. }
  68. }