1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMISOnline.CommonLogic.ExamServices;
- using EMISOnline.ViewModel.ExamView;
- using EMISOnline.ViewModel;
- namespace EMISOnline.Web.Controllers.Manage
- {
- [Authorization]
- public class ExamSettingController : Controller
- {
- public IExamSettingServices IExamSettingService { get; set; }
- //
- // GET: /ExamSetting/
- public ActionResult ExamList()
- {
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(string testname, int page, int rows)
- {
- var result = IExamSettingService.GetOnlinetestList(testname,page, rows);
- return Json(result);
- }
- public ActionResult ExamAdd(decimal? test_id)
- {
- OnlineTestView view = new OnlineTestView();
- if (test_id.HasValue)
- {
- view = IExamSettingService.GetOnlineTestByID(test_id.Value);
- }
- return View(view);
- }
- [HttpPost]
- public ActionResult ExamAdd(OnlineTestView OnlineTestView)
- {
- try
- {
- var user = ((EMISOnline.Utility.FormValidate.CustomPrincipal)HttpContext.User);
- IExamSettingService.ExamSettingSave(OnlineTestView, user.LoginID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!",
- RedictUrl = Url.Content("~/ExamSetting/ExamList")
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult GetPaperList(string PaperName, int page, int rows)
- {
- var result = IExamSettingService.GetPaperList(PaperName, page-1, rows);
- return Json(result);
- }
- }
- }
|