public static R MyQuestion(MyQuestion myQuestion) { var m = new R(); try { SqlParameter[] param = { new SqlParameter("@MID",myQuestion.MID), new SqlParameter("@QID",myQuestion.QID), new SqlParameter("@Answer",myQuestion.Answer), new SqlParameter("@Score",myQuestion.Score), new SqlParameter("@Flag",myQuestion.Flag) }; var r = SqlHelper.ExecuteNonQuery(C.conn, CommandType.StoredProcedure, "Update_MyQuestion", param); m.Code = 0; // m.Value = Convert.ToInt32(param[0].Value); } catch (Exception ex) { m.Code = 300; m.Message = ex.Message; log.Fatal(ex.Message); log.FatalException(ex.Message, ex); } return m; }
public ActionResult Paper(int id, int MID, FormCollection form) { DAL.Task.ResetPaper(MID, 0); foreach (var f in form.AllKeys) { var myQuestion = new MyQuestion(); myQuestion.MID = MID; myQuestion.QID = Convert.ToInt32(f); myQuestion.Answer = Request.Form[f]; myQuestion.Flag = 0; DAL.Update.MyQuestion(myQuestion); } DAL.Task.EvalutePaper(MID, id); Response.Redirect(string.Format(C.APP + "/H5/PaperReport?id={0}&MID={1}", id, MID)); return Content(string.Empty); }
public ActionResult Paper(int id, FormCollection form) { if (!U.IsActive(id)) { GoMessage(string.Format("您尚未开通{0}年度的课程", id)); } DAL.Task.ResetPaper(Client.MID, 0); foreach (var f in form.AllKeys) { var myQuestion = new MyQuestion(); myQuestion.MID = Client.MID; myQuestion.QID = Convert.ToInt32(f); myQuestion.Answer = Request.Form[f]; myQuestion.Flag = 0; DAL.Update.MyQuestion(myQuestion); } DAL.Task.EvalutePaper(Client.MID, id); Response.Redirect(string.Format(C.APP + "/Account/PaperReport/{0}", id)); return Content(string.Empty); }
public ActionResult Paper(FormCollection form) { DAL.Task.ResetPaper(Client.MID, 0); foreach (var f in form.AllKeys) { var myQuestion = new MyQuestion(); myQuestion.MID = Client.MID; myQuestion.QID = Convert.ToInt32(f); myQuestion.Answer = Request.Form[f]; myQuestion.Flag = 0; DAL.Update.MyQuestion(myQuestion); } DAL.Task.EvalutePaper(Client.MID); Response.Redirect(C.APP + "/Account/PaperReport"); return Content(string.Empty); }