private string GetFillPaperString(string strId) { string strPaperString = ""; PaperItemBLL paperItemBLL = new PaperItemBLL(); PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> paperSubjects = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strId)); if (paperSubjects != null) { for (int i = 0; i < paperSubjects.Count; i++) { PaperSubject paperSubject = paperSubjects[i]; IList <PaperItem> paperItems = paperItemBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); strPaperString += " <table width='100%' border='0' cellpadding='0' cellspacing='0'>"; strPaperString += " <tr><td style='font-size:21px'>"; strPaperString += " " + GetNo(i) + "、" + paperSubject.SubjectName; strPaperString += " (共" + paperItems.Count + "题,共" + paperItems.Count * paperSubject.UnitScore + "分)</td></tr>"; if (paperItems != null) { for (int j = 0; j < paperItems.Count; j++) { PaperItem paperItem = paperItems[j]; int k = j + 1; string strij = i.ToString() + j.ToString(); strPaperString += "<tr><td > " + k + "." + paperItem.Content + " (" + paperItem.Score + "分)</td></tr >"; if (paperSubject.ItemTypeId == 2) //多选 { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); strPaperString += "<tr><td > " + strN + "." + strAnswer[n] + "</td></tr>"; } } else //单选 { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); strPaperString += "<tr><td > " + strN + "." + strAnswer[n] + "</td></tr>"; } } } } strPaperString += "</table>"; } } return(strPaperString); }
protected void FillPage(int nId) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(nId); if (paper != null) { txtCategoryName.Text = paper.CategoryName; ddlMode.SelectedValue = paper.CreateMode.ToString(); PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> psList = paperSubjectBLL.GetPaperSubjectByPaperId(paper.PaperId); if (psList.Count > 0) { ddlMode.Enabled = false; ddlStrategyMode.Enabled = false; } else { ddlMode.Enabled = true; ddlStrategyMode.Enabled = true; } txtPaperName.Text = paper.PaperName; hfCategoryId.Value = paper.CategoryId.ToString(); txtDescription.Text = paper.Description; txtMemo.Text = paper.Memo; if (ddlMode.SelectedValue == "3") { ddlStrategyMode.Visible = true; LabelMode.Visible = true; } } if (ViewState["mode"].ToString() == "ReadOnly") { txtPaperName.Enabled = false; txtDescription.Enabled = false; txtMemo.Enabled = false; } }
protected void FillPaper() { // QueryString id stands for EXAM_RESULT_ID string strId = Request.QueryString.Get("id"); // Not pass id if (string.IsNullOrEmpty(strId)) { SessionSet.PageMessage = "参数错误!"; return; } PaperItemBLL kBLL = new PaperItemBLL(); PaperSubjectBLL kBSLL = new PaperSubjectBLL(); TaskResultBLL taskResultBLL = new TaskResultBLL(); TaskResultAnswerBLL taskResultAnswerBLL = new TaskResultAnswerBLL(); RailExam.Model.TaskResult taskResult = taskResultBLL.GetTaskResult(int.Parse(strId)); // Not found if (taskResult == null) { SessionSet.PageMessage = "数据错误!"; return; } IList <PaperSubject> PaperSubjects = kBSLL.GetPaperSubjectByPaperId(taskResult.PaperId); PaperSubject paperSubject = null; IList <PaperItem> PaperItems = null; IList <TaskResultAnswer> taskResultAnswers = taskResultAnswerBLL.GetTaskResultAnswers(taskResult.TaskResultId); if (PaperSubjects != null) { for (int i = 0; i < PaperSubjects.Count; i++) { paperSubject = PaperSubjects[i]; PaperItems = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); Response.Write("<table style='width:100%;'>"); Response.Write( " <tr class=\"tableFont\" > <td colspan='3' align='left' style='background-color:#54FF9F' >"); Response.Write(" " + CommonTool.GetChineseNumber(i + 1) + ""); Response.Write(". " + paperSubject.SubjectName + ""); Response.Write(" (共" + paperSubject.ItemCount + "题,共" + paperSubject.ItemCount * paperSubject.UnitScore + "分)</td></tr >"); if (PaperItems != null) { for (int j = 0; j < PaperItems.Count; j++) { PaperItem paperItem = PaperItems[j]; int k = j + 1; Response.Write("<tr class=\"tableFont\" > <td colspan='3' style='text-align:left; background-color:gainsboro;'> " + k + ". " + paperItem.Content + " (" + paperSubject.UnitScore + "分)</td></tr >"); // 组织用户答案 TaskResultAnswer theTaskResultAnswer = null; string[] strUserAnswers = new string[0]; string strUserAnswer = string.Empty; foreach (TaskResultAnswer resultAnswer in taskResultAnswers) { if (resultAnswer.PaperItemId == paperItem.PaperItemId) { theTaskResultAnswer = resultAnswer; break; } } // 若子表无记录,结束页面输出 if (theTaskResultAnswer == null) { SessionSet.PageMessage = "数据错误!"; return; } // 否则组织考生答案 if (theTaskResultAnswer.Answer != null) { strUserAnswers = theTaskResultAnswer.Answer.Split(new char[] { '|' }); } for (int n = 0; n < strUserAnswers.Length; n++) { if (n == 0) { strUserAnswer += CommonTool.GetSelectLetter(int.Parse(strUserAnswers[n]) + 1); } else { strUserAnswer += "," + CommonTool.GetSelectLetter(int.Parse(strUserAnswers[n]) + 1); } } //多选 if (paperSubject.ItemTypeId == 2) { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write(" <tr class=\"tableFont\" ><td colspan='3' align='left'> " + "<input type='checkbox' id='Answer" + strij + "' name='Answer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + CommonTool.GetSelectLetter(n + 1) + "." + strAnswer[n] + "</td></tr >"); } } else { //单选 string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write("<tr class=\"tableFont\" > <td colspan='3' align='left'> " + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + CommonTool.GetSelectLetter(n + 1) + "." + strAnswer[n] + "</td></tr >"); } } // 组织正确答案 string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' }); string strRightAnswer = ""; for (int n = 0; n < strRightAnswers.Length; n++) { if (n == 0) { strRightAnswer += CommonTool.GetSelectLetter(n + 1); } else { strRightAnswer += "," + CommonTool.GetSelectLetter(n + 1); } } Response.Write(" <tr class=\"tableFont\"><td colspan='3' style='color:green; text-align:left; '> ★标准答案:" + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId + "'>" + strRightAnswer + "</span></td></tr>"); Response.Write(" <tr class=\"tableFont\"><td colspan='3' style='color:blue; text-align:left; '> ★考生答案:" + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId + "'>" + strUserAnswer + "</span></td></tr>"); Response.Write(" <tr class=\"tableFont\" score='" + paperItem.Score + "'><td style='color:purple; text-align:left; width:20%; '>★评分结果:" //+ "<input type='radio' id='rbnCorrect" + "-" + paperItem.PaperItemId //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId //+ "' " + (strRightAnswer.Equals(strUserAnswer) ? "checked" : "") //+ "><font color='green'>对</font></input>" //+ "<input type='radio' id='rbnIncorrect" + "-" + paperItem.PaperItemId //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId //+ "' " + (strRightAnswer.Equals(strUserAnswer) ? "" : "checked") //+ "><font color='red'>错</font></input>" //+ "<input type='radio' id='rbnPartlyCorrect" + "-" + paperItem.PaperItemId //+ "' name='rbnJudge" + "-" + paperItem.PaperItemId + "'>半对</input>" + GetJudgeInputs(paperItem.PaperItemId, theTaskResultAnswer.JudgeStatusId) + " " + "得分 " + theTaskResultAnswer.JudgeScore.ToString() + " " + "评语 " + theTaskResultAnswer.JudgeRemark + "" + "</td></tr>"); } } Response.Write(" </table> "); } } else { SessionSet.PageMessage = "数据错误!"; return; } }
protected void FillPaper() { string strId = Request.QueryString.Get("id"); if (string.IsNullOrEmpty(strId)) { SessionSet.PageMessage = "缺少参数!"; return; } PaperItemBLL kBLL = new PaperItemBLL(); // PaperSubjectBLL psBLL = new PaperSubjectBLL(); PaperSubjectBLL kBSLL = new PaperSubjectBLL(); IList <PaperSubject> PaperSubjects = kBSLL.GetPaperSubjectByPaperId(int.Parse(strId)); if (PaperSubjects != null) { for (int i = 0; i < PaperSubjects.Count; i++) { PaperSubject paperSubject = PaperSubjects[i]; IList <PaperItem> PaperItems = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); Response.Write("<table width='95%' class='contentTable'>"); Response.Write(" <tr> <td align='left' style='background-color:#54FF9F' >"); Response.Write(" " + GetNo(i) + ""); Response.Write("、" + paperSubject.SubjectName + ""); Response.Write(" (共" + paperSubject.ItemCount + "题,共" + paperSubject.TotalScore + "分)</td></tr >"); if (PaperItems != null) { for (int j = 0; j < PaperItems.Count; j++) { PaperItem paperItem = PaperItems[j]; int k = j + 1; Response.Write("<tr > <td align='left'> " + k + ". " + paperItem.Content + " (" + paperItem.Score + "分)</td></tr >"); //多选 if (paperSubject.ItemTypeId == 2) { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write( " <tr ><td align='left'> <input type='checkbox' id='Answer" + strij + "' name='Answer" + strName + "'> " + strN + "." + strAnswer[n] + "</td></tr >"); } } else { //单选 string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write( "<tr > <td align='left'> <input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName + "'> " + strN + "." + strAnswer[n] + "</td></tr >"); } } //string[] strRightAnswer = paperItem.StandardAnswer.Split(new char[] { '|' }); //string strNew = ""; //for (int n = 0; n < strRightAnswer.Length; n++) //{ // string strN = intToString(int.Parse(strRightAnswer[n])+1); // if (n == 0) // { // strNew += strN; // } // else // { // strNew += "," + strN; // } //} //Response.Write(" <tr ><td style='background-color:#7EC0EE' align='left'>★标准答案: " + strNew + "</td></tr >"); } } Response.Write(" </table> "); } Response.Write(" <table><tr><td align='center'><a onclick='SaveRecord()' href='#'><b>提交练习</b></a> "); Response.Write(" <a onclick='Save()' href='#'><b>关闭</b></a> </td></tr></table>"); } else { SessionSet.PageMessage = "未找到记录!"; } }
protected void FillPaper() { // QueryString id stands for EXAM_RESULT_ID string strId = Request.QueryString.Get("id"); // Not pass id if (string.IsNullOrEmpty(strId)) { return; } PaperItemBLL kBLL = new PaperItemBLL(); PaperSubjectBLL kBSLL = new PaperSubjectBLL(); ExamResultBLL examResultBLL = new ExamResultBLL(); ExamResultAnswerBLL examResultAnswerBLL = new ExamResultAnswerBLL(); RailExam.Model.ExamResult examResult = examResultBLL.GetExamResult(int.Parse(strId)); // Not found if (examResult == null) { return; } IList <PaperSubject> PaperSubjects = kBSLL.GetPaperSubjectByPaperId(examResult.PaperId); PaperSubject paperSubject = null; IList <PaperItem> PaperItems = null; IList <ExamResultAnswer> examResultAnswers = examResultAnswerBLL.GetExamResultAnswers(examResult.ExamResultId); if (PaperSubjects != null) { for (int i = 0; i < PaperSubjects.Count; i++) { paperSubject = PaperSubjects[i]; PaperItems = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); Response.Write("<table width='100%'>"); Response.Write(" <tr > <td class='ExamBigTitle' >"); Response.Write(" " + GetNo(i) + ""); Response.Write(". " + paperSubject.SubjectName + ""); Response.Write(" (共" + paperSubject.ItemCount + "题,共" + paperSubject.TotalScore + "分)</td></tr >"); // 用于前台JS判断是否完成全部试题 hfPaperItemsCount.Value = paperSubject.ItemCount.ToString(); if (PaperItems != null) { for (int j = 0; j < PaperItems.Count; j++) { PaperItem paperItem = PaperItems[j]; int k = j + 1; Response.Write("<tr > <td class='ExamResultItem'> " + k + ". " + paperItem.Content + " (" + paperItem.Score + "分)</td></tr >"); // 组织用户答案 ExamResultAnswer theExamResultAnswer = null; string[] strUserAnswers = new string[0]; string strUserAnswer = string.Empty; foreach (ExamResultAnswer resultAnswer in examResultAnswers) { if (resultAnswer.PaperItemId == paperItem.PaperItemId) { theExamResultAnswer = resultAnswer; break; } } // 若子表无记录,结束页面输出 if (theExamResultAnswer == null) { SessionSet.PageMessage = "数据错误!"; return; } // 否则组织考生答案 if (theExamResultAnswer.Answer != null) { strUserAnswers = theExamResultAnswer.Answer.Split(new char[] { '|' }); } for (int n = 0; n < strUserAnswers.Length; n++) { string strN = intToString(int.Parse(strUserAnswers[n]) + 1); if (n == 0) { strUserAnswer += strN; } else { strUserAnswer += "," + strN; } } //多选 if (paperSubject.ItemTypeId == 2) { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write(" <tr ><td class='ExamItemAnswer'> " + "<input type='checkbox' id='Answer" + strij + "' name='Answer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >"); } } else { //单选 string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write("<tr > <td class='ExamItemAnswer'> " + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >"); } } // 组织正确答案 string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' }); string strRightAnswer = ""; for (int n = 0; n < strRightAnswers.Length; n++) { string strN = intToString(int.Parse(strRightAnswers[n]) + 1); if (n == 0) { strRightAnswer += strN; } else { strRightAnswer += "," + strN; } } Response.Write(" <tr><td class='ExamAnswer'> ★标准答案:" + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId + "'>" + strRightAnswer + "</span> 考生答案:" + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId + "'>" + strUserAnswer + "</span></td></tr>"); Response.Write(" <tr score='" + paperItem.Score + "'><td class='ExamJudge'>★评分结果:" + GetJudgeInputs(paperItem.PaperItemId, theExamResultAnswer.JudgeStatusId) + " " + "得分<input type='text' id='txtScore" + "-" + paperItem.PaperItemId + "' name='txtScore" + "-" + paperItem.PaperItemId + "' value='" + theExamResultAnswer.JudgeScore.ToString(".00") + "' size='8'></input> " + "评语<input type='text' id='txtMemo" + "-" + paperItem.PaperItemId + "' name='txtMemo" + "-" + paperItem.PaperItemId + "' size='40' value='" + theExamResultAnswer.JudgeRemark + "'></input>" + "</td></tr>"); } } Response.Write(" </table> "); } } }
protected void FillPaper() { string strId = Request.QueryString.Get("id"); PaperItemBLL paperItemBLL = new PaperItemBLL(); PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> paperSubjects = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strId)); if (paperSubjects != null) { for (int i = 0; i < paperSubjects.Count; i++) { PaperSubject paperSubject = paperSubjects[i]; IList <PaperItem> paperItems = paperItemBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); Response.Write(" <table width='95%' >"); Response.Write(" <tr><td id='PaperBigTitle' >"); Response.Write(" " + GetNo(i) + "、" + paperSubject.SubjectName + ""); Response.Write(" (共" + paperItems.Count + "题,共" + paperItems.Count * paperSubject.UnitScore + "分)</td></tr>"); if (paperItems != null) { for (int j = 0; j < paperItems.Count; j++) { PaperItem paperItem = paperItems[j]; int k = j + 1; string strij = i.ToString() + j.ToString(); Response.Write("<tr><td id='PaperItem'> " + k + ". " + paperItem.Content + " (" + paperSubject.UnitScore + "分)</td></tr >"); if (paperSubject.ItemTypeId == 2) //多选 { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); Response.Write("<tr><td id='PaperItemAnswer'> <input type='checkbox' id='Answer" + strij + "' name='Answer" + strij + "'> " + strN + "." + strAnswer[n] + "</td></tr>"); } } else //单选 { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); Response.Write("<tr><td id='PaperItemAnswer'> <input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strij + "'> " + strN + "." + strAnswer[n] + "</td></tr>"); } } string[] strRightAnswer = paperItem.StandardAnswer.Split(new char[] { '|' }); string strNew = string.Empty; for (int n = 0; n < strRightAnswer.Length; n++) { string strN = intToString(int.Parse(strRightAnswer[n]) + 1); if (n == 0) { strNew += strN; } else { strNew += "," + strN; } } Response.Write("<tr><td id='PaperAnswer'> ★标准答案: " + strNew + "</td></tr>"); } } Response.Write("<tr><td> </td></tr></table>"); } } }
protected string GetFillExamPaperString(string strId, string orgid) { string strPaperString = ""; PaperItemBLL kBLL = new PaperItemBLL(); PaperSubjectBLL kBSLL = new PaperSubjectBLL(); ExamResultBLL examResultBLL = new ExamResultBLL(); ExamResultAnswerBLL examResultAnswerBLL = new ExamResultAnswerBLL(); RailExam.Model.ExamResult examResult = new RailExam.Model.ExamResult(); if (ViewState["NowOrgID"].ToString() == orgid) { examResult = examResultBLL.GetExamResult(Convert.ToInt32(strId)); } else { examResult = examResultBLL.GetExamResultByOrgID(Convert.ToInt32(strId), Convert.ToInt32(orgid)); } IList <PaperSubject> PaperSubjects = new List <PaperSubject>(); if (ViewState["NowOrgID"].ToString() == orgid) { PaperSubjects = kBSLL.GetPaperSubjectByPaperId(examResult.PaperId); } else { PaperSubjects = kBSLL.GetPaperSubjectByPaperIdByOrgID(examResult.PaperId, Convert.ToInt32(orgid)); } RailExam.Model.PaperSubject paperSubject = null; IList <RailExam.Model.PaperItem> PaperItems = null; IList <ExamResultAnswer> examResultAnswers = new List <ExamResultAnswer>(); if (ViewState["NowOrgID"].ToString() == orgid) { examResultAnswers = examResultAnswerBLL.GetExamResultAnswers(examResult.ExamResultIDStation); } else { examResultAnswers = examResultAnswerBLL.GetExamResultAnswersByOrgID(examResult.ExamResultIDStation, Convert.ToInt32(orgid)); } for (int i = 0; i < PaperSubjects.Count; i++) { paperSubject = PaperSubjects[i]; if (ViewState["NowOrgID"].ToString() == orgid) { PaperItems = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); } else { PaperItems = kBLL.GetItemsByPaperSubjectIdByOrgID(paperSubject.PaperSubjectId, Convert.ToInt32(orgid)); } strPaperString += " <table width='100%' border='0' cellpadding='0' cellspacing='0'>"; strPaperString += " <tr><td style='font-size:14pt'>"; strPaperString += " " + GetNo(i) + ""; strPaperString += ". " + paperSubject.SubjectName + ""; strPaperString += " (共" + paperSubject.ItemCount + "题,共" + paperSubject.ItemCount * paperSubject.UnitScore + "分)</td></tr >"; if (PaperItems != null) { for (int j = 0; j < PaperItems.Count; j++) { RailExam.Model.PaperItem paperItem = PaperItems[j]; int k = j + 1; strPaperString += "<tr > <td style='font-size:10.5pt'> " + k + ". " + paperItem.Content + " (" + paperSubject.UnitScore + "分)</td></tr >"; // 组织用户答案 RailExam.Model.ExamResultAnswer theExamResultAnswer = null; string[] strUserAnswers = new string[0]; string strUserAnswer = string.Empty; foreach (RailExam.Model.ExamResultAnswer resultAnswer in examResultAnswers) { if (resultAnswer.PaperItemId == paperItem.PaperItemId) { theExamResultAnswer = resultAnswer; break; } } // 若子表无记录,结束页面输出 if (theExamResultAnswer == null) { SessionSet.PageMessage = "数据错误!"; } // 否则组织考生答案 if (theExamResultAnswer.Answer != null) { strUserAnswers = theExamResultAnswer.Answer.Split(new char[] { '|' }); } for (int n = 0; n < strUserAnswers.Length; n++) { string strN = intToString(int.Parse(strUserAnswers[n]) + 1); if (n == 0) { strUserAnswer += strN; } else { strUserAnswer += "," + strN; } } //多选 if (paperSubject.ItemTypeId == 2) { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); strPaperString += " <tr ><td style='font-size:10.5pt'> " + strN + "." + strAnswer[n] + "</td></tr >"; } } else { //单选 string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); strPaperString += "<tr > <td style='font-size:10.5pt'> " + strN + "." + strAnswer[n] + "</td></tr >"; } } // 组织正确答案 string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' }); string strRightAnswer = ""; for (int n = 0; n < strRightAnswers.Length; n++) { string strN = intToString(int.Parse(strRightAnswers[n]) + 1); if (n == 0) { strRightAnswer += strN; } else { strRightAnswer += "," + strN; } } strPaperString += " <tr><td style='font-size:10.5pt'> ★标准答案:" + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId + "'>" + strRightAnswer + "</span> 考生答案:" + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId + "'>" + strUserAnswer + "</span> 得分: " + theExamResultAnswer.JudgeScore.ToString() + "</td></tr>"; } } strPaperString += " </table> "; } return(strPaperString); }
protected void btnSave_Click(object sender, EventArgs e) { PaperStrategyBookChapterBLL psbcBll = new PaperStrategyBookChapterBLL(); int Ncount = psbcBll.GetBookChapterCount(int.Parse(Request.QueryString.Get("id"))); if (Ncount == 0) { SessionSet.PageMessage = "请添加策略!"; return; } string strPaperID = Request.QueryString.Get("Paperid"); if (!string.IsNullOrEmpty(strPaperID)) { int nStrategyId = int.Parse(Request.QueryString.Get("id")); int nPaperId = int.Parse(strPaperID); PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL(); RailExam.Model.PaperStrategy paperStrategy = paperStrategyBLL.GetPaperStrategy(nStrategyId); PaperStrategySubjectBLL paperStrategySubjectBLL = new PaperStrategySubjectBLL(); IList <PaperStrategySubject> paperStrategySubjects = paperStrategySubjectBLL.GetPaperStrategySubjectByPaperStrategyId(nStrategyId); int nStrategyMode = paperStrategy.StrategyMode; for (int i = 0; i < paperStrategySubjects.Count; i++) { //大题 PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); PaperSubject paperSubject = new PaperSubject(); paperSubject.ItemCount = paperStrategySubjects[i].ItemCount; paperSubject.ItemTypeId = paperStrategySubjects[i].ItemTypeId; paperSubject.Memo = paperStrategySubjects[i].Memo; paperSubject.OrderIndex = paperStrategySubjects[i].OrderIndex; paperSubject.PaperId = nPaperId; paperSubject.Remark = paperStrategySubjects[i].Remark; paperSubject.SubjectName = paperStrategySubjects[i].SubjectName; paperSubject.TotalScore = paperStrategySubjects[i].TotalScore; paperSubject.UnitScore = paperStrategySubjects[i].UnitScore; decimal nUnitScore = paperSubject.UnitScore; int nPaperSubjectId = paperSubjectBLL.AddPaperSubject(paperSubject); ItemBLL itemBLL = new ItemBLL(); if (nStrategyMode == 2) //教材章节模式 { PaperStrategyBookChapterBLL paperStrategyBookChapterBLL = new PaperStrategyBookChapterBLL(); IList <PaperStrategyBookChapter> paperStrategyBookChapters = paperStrategyBookChapterBLL.GetItemsByPaperStrategySubjectID(paperStrategySubjects[i].PaperStrategySubjectId); for (int k = 0; k < paperStrategyBookChapters.Count; k++) { //策略 int nChapterId = paperStrategyBookChapters[k].RangeId; int nRangeType = paperStrategyBookChapters[k].RangeType; int typeId = paperStrategyBookChapters[k].ItemTypeId; int nDifficultR = paperStrategyBookChapters[k].ItemDifficultyRandomCount; //int nDifficulty1 = paperStrategyBookChapters[k].ItemDifficulty1Count; //int nDifficulty2 = paperStrategyBookChapters[k].ItemDifficulty2Count; //int nDifficulty3 = paperStrategyBookChapters[k].ItemDifficulty3Count; //int nDifficulty4 = paperStrategyBookChapters[k].ItemDifficulty4Count; //int nDifficulty5 = paperStrategyBookChapters[k].ItemDifficulty5Count; decimal uScore = paperStrategyBookChapters[k].UnitScore; string strExcludeIDs = paperStrategyBookChapters[k].ExcludeChapterId; //难度1 //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType,1, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore); ////难度2 //itemList = itemBLL.GetItemsByStrategy(nRangeType,2, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore); ////难度3 //itemList = itemBLL.GetItemsByStrategy(nRangeType,3, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore); ////难度4 //itemList = itemBLL.GetItemsByStrategy(nRangeType,4, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore); ////难度5 //itemList = itemBLL.GetItemsByStrategy(nRangeType,5, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore); //随机难度 Random ObjRandom = new Random(); int ndr = ObjRandom.Next(1, 5); //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType, ndr, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore); } } } int itemCount = 0; decimal totalScore = 0; PaperItemBLL paperBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> PaperItems = paperBLL.GetItemsByPaperId(nPaperId); if (PaperItems.Count > 0) { itemCount = PaperItems.Count; totalScore = PaperItems[0].Score * PaperItems.Count; } btnPreview.Visible = true; this.btnedit.Visible = true; this.btnSave.Visible = false; NewButton.Visible = false; btnLast.Visible = false; SessionSet.PageMessage = "随机生成试卷共" + itemCount + "题," + totalScore + "分,如果试卷题数不等于设定的总题数请手工进行修改!"; ViewState["DeleteFlag"] = 1; } else { Response.Write("<script>top.window.opener.form1.Refresh.value='true';top.window.opener.form1.submit();top.window.close();</script>"); } }
protected void btnSave_Click(object sender, EventArgs e) { int nStrategyId = int.Parse(hfStrategyId.Value); int nPaperId = int.Parse(Request.QueryString.Get("id")); PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL(); RailExam.Model.PaperStrategy paperStrategy = paperStrategyBLL.GetPaperStrategy(nStrategyId); PaperStrategySubjectBLL paperStrategySubjectBLL = new PaperStrategySubjectBLL(); IList <PaperStrategySubject> paperStrategySubjects = paperStrategySubjectBLL.GetPaperStrategySubjectByPaperStrategyId(nStrategyId); int nStrategyMode = paperStrategy.StrategyMode; txtStrategyName.Text = paperStrategy.PaperStrategyName; for (int i = 0; i < paperStrategySubjects.Count; i++) { //大题 PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); PaperSubject paperSubject = new PaperSubject(); paperSubject.ItemCount = paperStrategySubjects[i].ItemCount; paperSubject.ItemTypeId = paperStrategySubjects[i].ItemTypeId; paperSubject.Memo = paperStrategySubjects[i].Memo; paperSubject.OrderIndex = paperStrategySubjects[i].OrderIndex; paperSubject.PaperId = nPaperId; paperSubject.Remark = paperStrategySubjects[i].Remark; paperSubject.SubjectName = paperStrategySubjects[i].SubjectName; paperSubject.TotalScore = paperStrategySubjects[i].TotalScore; paperSubject.UnitScore = paperStrategySubjects[i].UnitScore; decimal nUnitScore = paperSubject.UnitScore; int nPaperSubjectId = paperSubjectBLL.AddPaperSubject(paperSubject); ItemBLL itemBLL = new ItemBLL(); if (nStrategyMode == 2) //教材章节模式 { PaperStrategyBookChapterBLL paperStrategyBookChapterBLL = new PaperStrategyBookChapterBLL(); IList <PaperStrategyBookChapter> paperStrategyBookChapters = paperStrategyBookChapterBLL.GetItemsByPaperStrategySubjectID(paperStrategySubjects[i].PaperStrategySubjectId); for (int k = 0; k < paperStrategyBookChapters.Count; k++) { //策略 int nChapterId = paperStrategyBookChapters[k].RangeId; int typeId = paperStrategyBookChapters[k].ItemTypeId; int nRangeType = paperStrategyBookChapters[k].RangeType; int nDifficultR = paperStrategyBookChapters[k].ItemDifficultyRandomCount; //int nDifficulty1 = paperStrategyBookChapters[k].ItemDifficulty1Count; //int nDifficulty2 = paperStrategyBookChapters[k].ItemDifficulty2Count; //int nDifficulty3 = paperStrategyBookChapters[k].ItemDifficulty3Count; //int nDifficulty4 = paperStrategyBookChapters[k].ItemDifficulty4Count; //int nDifficulty5 = paperStrategyBookChapters[k].ItemDifficulty5Count; decimal uScore = paperStrategyBookChapters[k].UnitScore; string strExcludeIDs = paperStrategyBookChapters[k].ExcludeChapterId; ////难度1 //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType, 1, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore); ////难度2 //itemList = itemBLL.GetItemsByStrategy(nRangeType, 2, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore); ////难度3 //itemList = itemBLL.GetItemsByStrategy(nRangeType, 3, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore); ////难度4 //itemList = itemBLL.GetItemsByStrategy(nRangeType, 4, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore); ////难度5 //itemList = itemBLL.GetItemsByStrategy(nRangeType, 5, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore); //随机难度 Random ObjRandom = new Random(); int ndr = ObjRandom.Next(1, 5); //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategy(nRangeType, ndr, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore); } } else //试题辅助分类模式 { PaperStrategyItemCategoryBLL paperStrategyItemCategoryBLL = new PaperStrategyItemCategoryBLL(); IList <PaperStrategyItemCategory> paperStrategyItemCategorys = paperStrategyItemCategoryBLL.GetItemsByPaperSubjectId(paperStrategySubjects[i].PaperStrategySubjectId); for (int k = 0; k < paperStrategyItemCategorys.Count; k++) { //策略 int nChapterId = paperStrategyItemCategorys[k].ItemCategoryId; int typeId = paperStrategyItemCategorys[k].ItemTypeId; int nDifficultR = paperStrategyItemCategorys[k].ItemDifficultyRandomCount; //int nDifficulty1 = paperStrategyItemCategorys[k].ItemDifficulty1Count; //int nDifficulty2 = paperStrategyItemCategorys[k].ItemDifficulty2Count; //int nDifficulty3 = paperStrategyItemCategorys[k].ItemDifficulty3Count; //int nDifficulty4 = paperStrategyItemCategorys[k].ItemDifficulty4Count; //int nDifficulty5 = paperStrategyItemCategorys[k].ItemDifficulty5Count; decimal uScore = paperStrategyItemCategorys[k].UnitScore; string strExcludeIDs = paperStrategyItemCategorys[k].ExcludeCategorysId; ////难度1 //IList<RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategyItem(1, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty1, nPaperId, nPaperSubjectId, nUnitScore); ////难度2 //itemList = itemBLL.GetItemsByStrategyItem(2, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty2, nPaperId, nPaperSubjectId, nUnitScore); ////难度3 //itemList = itemBLL.GetItemsByStrategyItem(3, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty3, nPaperId, nPaperSubjectId, nUnitScore); ////难度4 //itemList = itemBLL.GetItemsByStrategyItem(4, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty4, nPaperId, nPaperSubjectId, nUnitScore); ////难度5 //itemList = itemBLL.GetItemsByStrategyItem(5, nChapterId, typeId, strExcludeIDs); //SavePaperItem(itemList, nDifficulty5, nPaperId, nPaperSubjectId, nUnitScore); //随机难度 Random ObjRandom = new Random(); int ndr = ObjRandom.Next(1, 5); IList <RailExam.Model.Item> itemList = itemBLL.GetItemsByStrategyItem(ndr, nChapterId, typeId, strExcludeIDs); SavePaperItem(itemList, nDifficultR, nPaperId, nPaperSubjectId, nUnitScore); } } } int itemCount = 0; decimal totalScore = 0; PaperItemBLL paperBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> PaperItems = paperBLL.GetItemsByPaperId(nPaperId); if (PaperItems.Count > 0) { itemCount = PaperItems.Count; totalScore = PaperItems[0].Score * PaperItems.Count; } SessionSet.PageMessage = "随机生成试卷共" + itemCount + "题," + totalScore + "分,如果试卷题数不等于设定的总题数请手工进行修改!"; this.btnSave.Visible = false; this.btnLast.Visible = false; btnPreview.Visible = true; btnEdit.Visible = true; }
protected void FillResultPaper(string strTaskResultId) { string strId = strTaskResultId; // Not pass id if (string.IsNullOrEmpty(strId)) { return; } PaperItemBLL kBLL = new PaperItemBLL(); PaperSubjectBLL kBSLL = new PaperSubjectBLL(); TaskResultBLL examResultBLL = new TaskResultBLL(); TaskResultAnswerBLL examResultAnswerBLL = new TaskResultAnswerBLL(); TaskResult examResult = examResultBLL.GetTaskResult(int.Parse(strId)); // Not found if (examResult == null) { return; } IList <PaperSubject> PaperSubjects = kBSLL.GetPaperSubjectByPaperId(examResult.PaperId); PaperSubject paperSubject = null; IList <PaperItem> PaperItems = null; IList <TaskResultAnswer> examResultAnswers = examResultAnswerBLL.GetTaskResultAnswers(examResult.TaskResultId); if (PaperSubjects != null) { for (int i = 0; i < PaperSubjects.Count; i++) { paperSubject = PaperSubjects[i]; PaperItems = kBLL.GetItemsByPaperSubjectId(paperSubject.PaperSubjectId); Response.Write("<table width='100%' class='contentTable'>"); Response.Write(" <tr > <td align='left' style='background-color:#54FF9F' >"); Response.Write(" " + GetNo(i) + ""); Response.Write(". " + paperSubject.SubjectName + ""); Response.Write(" (共" + paperSubject.ItemCount + "题,共" + paperSubject.ItemCount * paperSubject.UnitScore + "分)</td></tr >"); // 用于前台JS判断是否完成全部试题 hfPaperItemsCount.Value = paperSubject.ItemCount.ToString(); if (PaperItems != null) { for (int j = 0; j < PaperItems.Count; j++) { PaperItem paperItem = PaperItems[j]; int k = j + 1; Response.Write("<tr > <td style='text-align:left; background-color:gainsboro;'> " + k + ". " + paperItem.Content + " (" + paperSubject.UnitScore + "分)</td></tr >"); // 组织用户答案 TaskResultAnswer theExamResultAnswer = null; string[] strUserAnswers = new string[0]; string strUserAnswer = string.Empty; foreach (TaskResultAnswer resultAnswer in examResultAnswers) { if (resultAnswer.PaperItemId == paperItem.PaperItemId) { theExamResultAnswer = resultAnswer; break; } } // 若子表无记录,结束页面输出 if (theExamResultAnswer == null) { SessionSet.PageMessage = "数据错误!"; return; } // 否则组织考生答案 if (theExamResultAnswer.Answer != null) { strUserAnswers = theExamResultAnswer.Answer.Split(new char[] { '|' }); } for (int n = 0; n < strUserAnswers.Length; n++) { string strN = intToString(int.Parse(strUserAnswers[n]) + 1); if (n == 0) { strUserAnswer += strN; } else { strUserAnswer += "," + strN; } } //多选 if (paperSubject.ItemTypeId == 2) { string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write(" <tr ><td align='left'> " + "<input type='checkbox' id='Answer" + strij + "' name='Answer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >"); } } else { //单选 string[] strAnswer = paperItem.SelectAnswer.Split(new char[] { '|' }); for (int n = 0; n < strAnswer.Length; n++) { string strN = intToString(n + 1); string strij = "-" + paperItem.PaperItemId + "-" + i.ToString() + "-" + j.ToString() + "-" + n.ToString(); string strName = i.ToString() + j.ToString(); Response.Write("<tr > <td align='left'> " + "<input type='Radio' id='RAnswer" + strij + "' name='RAnswer" + strName + "' " + (Array.IndexOf(strUserAnswers, n) > -1 ? "checked" : "") + " disabled/> " + strN + "." + strAnswer[n] + "</td></tr >"); } } // 组织正确答案 string[] strRightAnswers = paperItem.StandardAnswer.Split(new char[] { '|' }); string strRightAnswer = ""; for (int n = 0; n < strRightAnswers.Length; n++) { string strN = intToString(int.Parse(strRightAnswers[n]) + 1); if (n == 0) { strRightAnswer += strN; } else { strRightAnswer += "," + strN; } } Response.Write(" <tr><td style='color:green; text-align:left; '> ★标准答案:" + "<span id='span-" + paperItem.PaperItemId + "-0' name='span-" + paperItem.PaperItemId + "'>" + strRightAnswer + "</span></td></tr>"); Response.Write(" <tr><td style='color:blue; text-align:left; '> ★考生答案:" + "<span id='span-" + paperItem.PaperItemId + "-1' name='span-" + paperItem.PaperItemId + "'>" + strUserAnswer + "</span></td></tr>"); Response.Write(" <tr score='" + paperItem.Score + "'><td style='color:purple; text-align:left; '>★"// + "得分<input type='text' readonly id='txtScore" + "-" + paperItem.PaperItemId + "' name='txtScore" + "-" + paperItem.PaperItemId + "' value='" + theExamResultAnswer.JudgeScore.ToString(".00") + "' size='8' style='width:20%'></input> " + "评语<input type='text' readonly id='txtMemo" + "-" + paperItem.PaperItemId + "' name='txtMemo" + "-" + paperItem.PaperItemId + "' size='40' value='" + theExamResultAnswer.JudgeRemark + "' style='width:70%'></input>" + "</td></tr>"); } } Response.Write(" </table> "); } } Response.Write("<table width='100%'> <tr></tr><tr><td style='color:purple;text-align:left; '> ★★★该作业最终得分:" + examResult.Score + "分 </td></tr></table>"); Response.Write("<table width='100%'> <tr><td style='text-align:center; '><a onclick='Close()' href='#'><b>关闭</b></a> </td></tr></table>"); }
protected void btnSaveAndNext_Click(object sender, EventArgs e) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = new RailExam.Model.Paper(); string strID = string.Empty; string strMode = ViewState["mode"].ToString(); if (strMode == "Insert") { paper.CategoryId = int.Parse(hfCategoryId.Value); paper.PaperName = txtPaperName.Text; paper.Description = txtDescription.Text; paper.Memo = txtMemo.Text; paper.CreatePerson = PrjPub.CurrentLoginUser.EmployeeName; paper.CreateMode = int.Parse(ddlMode.SelectedValue); paper.CreateTime = DateTime.Now; paper.ItemCount = 0; paper.StatusId = 1; paper.TotalScore = 0; paper.OrgId = PrjPub.CurrentLoginUser.StationOrgID; int id = paperBLL.AddPaper(paper); strID = id.ToString(); if (ddlMode.SelectedValue == "1") { Response.Redirect("PaperManageEditSecond.aspx?mode=" + strMode + "&id=" + strID); } else if (ddlMode.SelectedValue == "2") { Response.Redirect("PaperManageStrategy.aspx?mode=" + strMode + "&id=" + strID); } else { PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL(); RailExam.Model.PaperStrategy paperStrategy = new RailExam.Model.PaperStrategy(); paperStrategy.PaperCategoryId = int.Parse(hfCategoryId.Value); paperStrategy.PaperStrategyName = "temp"; paperStrategy.StrategyMode = int.Parse(ddlStrategyMode.SelectedValue); paperStrategy.SingleAsMultiple = false; paperStrategy.IsRandomOrder = false; paperStrategy.Description = ""; paperStrategy.Memo = ""; string strStrategyID = paperStrategyBLL.AddPaperStrategy(paperStrategy).ToString(); Response.Redirect("PaperStrategyEditSecond.aspx?mode=" + strMode + "&id=" + strStrategyID + "&Paperid=" + strID); } } else { strID = Request.QueryString.Get("id"); paper.PaperName = txtPaperName.Text; paper.PaperId = int.Parse(strID); paper.Memo = txtMemo.Text; paper.Description = txtDescription.Text; paper.TotalScore = 0; paperBLL.UpdatePaper(paper); if (ddlMode.SelectedValue == "2") { PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> psList = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strID)); if (psList.Count > 0) { Response.Redirect("PaperManageEditSecond.aspx?mode=" + strMode + "&id=" + strID); } else { Response.Redirect("PaperManageStrategy.aspx?mode=" + strMode + "&id=" + strID); } } else if (ddlMode.SelectedValue == "3") { PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> psList = paperSubjectBLL.GetPaperSubjectByPaperId(int.Parse(strID)); if (psList.Count > 0) { Response.Redirect("PaperManageEditSecond.aspx?mode=" + strMode + "&id=" + strID); } else { string strStrategyID = Request.QueryString.Get("Strategyid"); if (!string.IsNullOrEmpty(strStrategyID)) { Response.Redirect("PaperStrategyEditSecond.aspx?mode=" + strMode + "&id=" + strStrategyID + "&Paperid=" + strID); } else { PaperStrategyBLL paperStrategyBLL = new PaperStrategyBLL(); RailExam.Model.PaperStrategy paperStrategy = new RailExam.Model.PaperStrategy(); paperStrategy.PaperCategoryId = int.Parse(hfCategoryId.Value); paperStrategy.PaperStrategyName = "temp"; paperStrategy.StrategyMode = int.Parse(ddlStrategyMode.SelectedValue); paperStrategy.SingleAsMultiple = false; paperStrategy.IsRandomOrder = false; paperStrategy.Description = ""; paperStrategy.Memo = ""; strStrategyID = paperStrategyBLL.AddPaperStrategy(paperStrategy).ToString(); Response.Redirect("PaperStrategyEditSecond.aspx?mode=" + strMode + "&id=" + strStrategyID + "&Paperid=" + strID); } } } else { Response.Redirect("PaperManageEditSecond.aspx?mode=" + strMode + "&id=" + strID); } } }