Ejemplo n.º 1
0
 private void frmUserPaper_Load(object sender, EventArgs e)
 {
     answer = UserAnswerBll.GetUserAnswer(UserID, Date, PaperID);
     lblPaper.Text = answer.PaperName;
     lblTime.Text = answer.ExamTime;
     txtSingleProblem.Text = answer.SingleProblem.ToString();
     txtMultiProblem.Text = answer.MultiProblem.ToString();
     txtJudgeProblem.Text = answer.JudgeProblem.ToString();
     txtFillBlankProblem.Text = answer.FillBlankProblem.ToString();
     dataGridView1.DataSource = UserAnswerBll.QuestionFillDs(UserID, Date, PaperID).Tables[0];
     getcolumn();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取用户考试试卷和考试时间
 /// </summary>
 /// <param name="userID">用户编号</param>
 /// <returns>UserAnswer类型,返回用户答案模板的信息</returns>
 public UserAnswer GetUserAnswer(string userID,string date,string paperID)
 {
     string str = "select distinct PaperName,UserAnswer.examTime from UserAnswer left join Paper on UserAnswer.PaperID=Paper.PaperID where userID=@userID and UserAnswer.examTime=@examTime and not exists(select *from score where userID=@userID and examTime=@examTime and PaperID=@paperID)";
     SH.SqlCom(str, CommandType.Text);
     SH.SqlPar("@userID", userID);
     SH.SqlPar("@examTime", date);
     SH.SqlPar("@paperID", paperID);
     UserAnswer Answer = new UserAnswer();
     Answer.PaperName = SH.SqlFillDs().Tables[0].Rows[0].ItemArray[0].ToString();
     Answer.ExamTime = SH.SqlFillDs().Tables[0].Rows[0].ItemArray[1].ToString();
     return Answer;
 }