Esempio n. 1
0
 protected void imgBtnSave_Click(object sender, ImageClickEventArgs e)
 {
     Scoresmr insertExamScore = new Scoresmr();  //����Scoresmr�����
     insertExamScore.UserID = Request.QueryString["UserID"].ToString();
     insertExamScore.ExamTime = Convert.ToDateTime(lblExamtime.Text);
     insertExamScore.PaperID = int.Parse(Request.QueryString["PaperID"].ToString());
     if (queScore.Text.Trim() != "")
     {
         insertExamScore.Score = Convert.ToInt32(sumScore.Text);
     }
     insertExamScore.PingYu = tbxPingyu.Text;
     //ʵ����������Papermr
     Papermr mypaper = new Papermr();
     mypaper.UserID= Request.QueryString["UserID"].ToString();
     mypaper.PaperID = int.Parse(Request.QueryString["PaperID"].ToString());
     mypaper.state = "������";
     //ʹ��CheckScore������֤�ɼ��Ƿ����
        if (!insertExamScore.CheckScore(insertExamScore.UserID, insertExamScore.PaperID))
        {
         //����InsertByProc���������ݿ��в���ɼ�
        if (insertExamScore.InsertByProc())
         {
             mypaper.UpdateByProc(mypaper.UserID, mypaper.PaperID,mypaper.state);
            //�����ɹ���ʾ��Ϣ
             lblMessage.Text = "�����ɼ�����ɹ�!";
         }
         else
         {
             lblMessage.Text = "�����ɼ�����ʧ��!";
         }
        }
        else
        {
        lblMessage.Text = "���û��ijɼ��Ѵ���,����ɾ���ɼ�������!";
        }
 }