public void SetPaperPublic() { string _paperid = Parameters["ppaperid"]; OEExamPaperBiz biz = new OEExamPaperBiz(); NameValueCollection par = new NameValueCollection(); par.Add("FPaperStatus", "1"); NameValueCollection where = new NameValueCollection(); where.Add("FPaperId", _paperid); ErrorEntity ErrInfo = new ErrorEntity(); biz.Update(par, where, out ErrInfo); Response.Write(ErrInfo.ToJson()); }
public void SavePage1() { string _paperid = Parameters["ppaperid"]; string _pagename = Parameters["ppagename"]; string _contentclassid = Parameters["pcontentclassid"]; string _total = Parameters["ptotal"]; string _examtype = Parameters["pexamtype"]; string _extractway = Parameters["pextractway"]; string _chooseitemway = Parameters["pchooseitemway"]; string _examtime = Parameters["pexamtime"]; string _papercontent = Parameters["ppapercontent"]; string _examagain = Parameters["pexamagain"]; string _passscore = Parameters["ppassscore"]; OEExamPaper item = new OEExamPaper(); item.FChooseItemWay = _chooseitemway; item.FContentClassId = string.IsNullOrEmpty(_contentclassid) ? 0 : Convert.ToInt64(_contentclassid); item.FExamAgain = _examagain; item.FExamTime = string.IsNullOrEmpty(_examtime) ? 0 : Convert.ToInt32(_examtime); item.FExamType = _examtype; item.FPaperContent = _papercontent; item.FPaperExtractWay = _extractway; item.FPaperId = string.IsNullOrEmpty(_paperid) ? 0 : Convert.ToInt64(_paperid); item.FPaperName = _pagename; item.FPaperTotal = string.IsNullOrEmpty(_total) ? 0 : Convert.ToDecimal(_total); item.FPassScore = string.IsNullOrEmpty(_passscore) ? 0 : Convert.ToDecimal(_passscore); item.AUserId = Convert.ToInt64(userid); OEExamPaperBiz biz = new OEExamPaperBiz(); ErrorEntity ErrInfo = new ErrorEntity(); if (item.FPaperId == 0) { item.FPaperStatus = "2"; Int64 result = biz.Insert(item, out ErrInfo); if (ErrInfo.ErrorCode == RespCode.Success) { ErrInfo.ErrorMessage = result.ToString(); } } else { item.FPaperTime = DateTime.Today; biz.Update(item, out ErrInfo); if (ErrInfo.ErrorCode == RespCode.Success) { ErrInfo.ErrorMessage = item.FPaperId.ToString(); } } Response.Write(ErrInfo.ToJson()); }