//��ʼ���Ծ���
 protected void InitData()
 {
     Papermr paper = new Papermr();
     DataSet ds = paper.QueryUserPaperList();
     GridView1.DataSource = ds;
     GridView1.DataBind();
     LabelPageInfo.Text = "��ǰ����" + (GridView1.PageIndex + 1).ToString() + "ҳ ��" + GridView1.PageCount.ToString() + "ҳ��";
 }
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     string UserID = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); //ȡ��Ҫɾ����¼������ֵ1
     int PaperID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[1].ToString().Trim());//ȡ��Ҫɾ����¼������ֵ2
     Papermr paper = new Papermr();
     if (paper.DeleteByProc(UserID, PaperID))
     {
         Response.Write("<script language=javascript>alert('�ɹ�ɾ����')</script>");
     }
     else
     {
         Response.Write("<script language=javascript>alert('ɾ��ʧ�ܣ�')</script>");
     }
     InitData();
 }
Example #3
0
    //GridView�ؼ�RowDeleting�¼�
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Papermr paper = new Papermr();      //����Papermr����
        int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString()); //ȡ��Ҫɾ����¼������ֵ
        if (paper.DeleteByStr(ID))
        {
            Response.Write("<script language=javascript>alert('�ɹ�ɾ�����Ծ��')</script>");
        }
        else
        {
            Response.Write("<script language=javascript>alert('ɾ���Ծ�ʧ�ܣ�')</script>");

        }
        //InitData();
        Response.Redirect("PaperLists.aspx");
    }
Example #4
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ɼ��Ѵ���,����ɾ���ɼ�������!";
        }
 }
Example #5
0
 //GridView�ؼ�RowUpdating�¼�
 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     //ȡ��Ҫɾ����¼������ֵ
     int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
     //����Papermr����
     Papermr paper = new Papermr();
     //Ӧ��FindControl����GridView�ؼ��е�DropDownList���������б��е�ֵת����byte���͸��蹫����Papermr�е�PaperState�Ծ�״̬����
     paper.PaperState = byte.Parse(((DropDownList)GridView1.Rows[e.RowIndex].FindControl("ddlPaperState")).SelectedValue);
     //ʹ��Papermr��UpdateByProc�����޸��Ծ�״̬
     if (paper.UpdateByStr(ID))
     {
         Response.Write("<script language=javascript>alert('�Ծ�״̬�޸ijɹ�!')</script>");
     }
     else
     {
         Response.Write("<script language=javascript>alert('�Ծ�״̬�޸�ʧ��!')</script>");
     }
     //ȡ���༭����
     GridView1.EditIndex = -1;
     //�����Զ��巽��InitData()���°�GridView�ؼ�����Ϣ
     InitData();
 }
Example #6
0
 protected void InitData()
 {
     Papermr paper = new Papermr();
     DataSet ds = paper.QueryAllPaper();
     if (ds.Tables[0].Rows.Count > 0)
     {
         GridView1.DataSource = ds;
         GridView1.DataBind();
     }
     else
     {
         lblMessage.Text = "û���Ծ�!";
     }
 }
    //��ʼ�����Կ�Ŀ�����б��
    protected void InitData()
    {
        Papermr paper = new Papermr();              //����Papermr����
        DataSet ds = paper.QueryPaper();        //��ѯ���п����Ծ�
        if (ds.Tables[0].Rows.Count >= 1)
        {
            ddlPaper.DataSource = ds;           //ָ�����Կ�Ŀ�б������Դ
            ddlPaper.DataTextField = "PaperName";   //DataTextField��ʾName�ֶ�ֵ
            ddlPaper.DataValueField = "PaperID";    //DataValueField��ʾID�ֶ�ֵ
            ddlPaper.DataBind();                //������

        }
        else
        {
            ddlPaper.Enabled = false;
            ImgStartExam.Enabled = false;
            lblMessage.Text = "û���Ծ��";
        }
    }