/// <summary> /// 4.0 从试卷删除 /// </summary> public ActionResult DelFromPaper() { int paperId = int.Parse(Request.Params["paperId"]); int pageIndex = int.Parse(Request.Params["pageIndex"]); int questionId = int.Parse(Request.Params["questionId"]); //根据关键字查找到对应的model MODEL.T_PaperQuestion model = OperateContext.Current.BLLSession .IPaperQuestionBLL.GetListBy(p => p.PaperID == paperId && p.QuestionID == questionId) .FirstOrDefault(); //移除对应的model OperateContext.Current.BLLSession.IPaperQuestionBLL.Del(model); return(Redirect("/JoinUs/OrganizePaper/Index?paperId=" + paperId + "&pageIndex=" + pageIndex)); }
/// <summary> /// 3.0 添加到试卷 /// </summary> public ActionResult AddToPaper() { int paperId = int.Parse(Request.Params["paperId"]); int pageIndex = int.Parse(Request.Params["pageIndex"]); int questionId = int.Parse(Request.Params["questionId"]); //判断是否已经添加,没有添加则添加 if (OperateContext.Current.BLLSession .IPaperQuestionBLL.GetListBy(p => p.PaperID == paperId && p.QuestionID == questionId) .FirstOrDefault() == null) { MODEL.T_PaperQuestion model = new MODEL.T_PaperQuestion() { PaperID = paperId, QuestionID = questionId }; OperateContext.Current.BLLSession.IPaperQuestionBLL.Add(model); } return Redirect("/JoinUs/OrganizePaper/Index?paperId=" + paperId + "&pageIndex=" + pageIndex); }
/// <summary> /// 3.0 添加到试卷 /// </summary> public ActionResult AddToPaper() { int paperId = int.Parse(Request.Params["paperId"]); int pageIndex = int.Parse(Request.Params["pageIndex"]); int questionId = int.Parse(Request.Params["questionId"]); //判断是否已经添加,没有添加则添加 if (OperateContext.Current.BLLSession .IPaperQuestionBLL.GetListBy(p => p.PaperID == paperId && p.QuestionID == questionId) .FirstOrDefault() == null) { MODEL.T_PaperQuestion model = new MODEL.T_PaperQuestion() { PaperID = paperId, QuestionID = questionId }; OperateContext.Current.BLLSession.IPaperQuestionBLL.Add(model); } return(Redirect("/JoinUs/OrganizePaper/Index?paperId=" + paperId + "&pageIndex=" + pageIndex)); }