protected void ImageButton1_Click(object sender, ImageClickEventArgs e) //查询
 {
     if (TextBox1.Text == "")
     {
         dataconn.bindinfostring(GridView1, "select * from student_score  where ID='" + Session["ID"] + "'", "ID");
     }
     else
     {
         if (RadioButton1.Checked)
         {
             dataconn.bind(GridView1, "select * from student_score  where ID='" + Session["ID"] + "'and c_name Like'%" + TextBox1.Text + "%'");
         }
         else if (RadioButton2.Checked)
         {
             dataconn.bind(GridView1, "select * from student_score  where ID='" + Session["ID"] + "'and PaperName Like'%" + TextBox1.Text + "%'");
         }
         else if (RadioButton3.Checked)
         {
             dataconn.bind(GridView1, "select * from student_score  where ID='" + Session["ID"] + "'and Score Like'%" + TextBox1.Text + "%'");
         }
         else
         {
             ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('请选择查询类型!');</script>");
         }
     }
 }
Exemple #2
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     if (TextBox1.Text == "")
     {
         dataconn.bindinfostring(GridView1, "select * from Student order by ID DESC", "ID");
     }
     else
     {
         dataconn.bind(GridView1, "select * from Student where  " + DropDownList1.SelectedValue + "   Like'%" + TextBox1.Text + "%'");
     }
 }
Exemple #3
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     if (TextBox1.Text == "")
     {
         dataconn.bindinfostring(GridView1, "select * from Course where teacher_id='" + Session["ID"] + "'", "c_name");
     }
     else
     {
         dataconn.bind(GridView1, "select * from  Course  where  teacher_id='" + Session["ID"] + "'and " + DropDownList1.SelectedValue + " Like '%" + TextBox1.Text + "%'");
     }
 }
Exemple #4
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     if (TextBox1.Text == "")
     {
         dataconn.bindinfostring(gvQueInfo, "select * from JudgeProblem where c_id in(select c_id from Course where teacher_id='" + Session["ID"] + "')  order by ID DESC", "ID");
     }
     else
     {
         dataconn.bind(gvQueInfo, "select * from JudgeProblem where c_id in(select c_id from Course where teacher_id='" + Session["ID"] + "') and " + DropDownList1.SelectedValue + "  Like'%" + TextBox1.Text + "%'");
     }
 }
 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridView1.PageIndex = e.NewPageIndex;
     dataconn.bind(GridView1, "select * from Teacher order by id DESC");
 }