コード例 #1
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (TextBox3.Text != "")
     {
         if (DropDownList1.Text == "借书证号")
         {
             Bll.BorTable bBor = new Bll.BorTable();
             this.GridView1.DataSource   = bBor.select("BorId like '%" + TextBox3.Text + "%'");
             this.GridView1.DataKeyNames = new string[] { "ID" };
             this.GridView1.DataBind();
         }
         if (DropDownList1.Text == "读者名字")
         {
             Bll.BorTable bBor = new Bll.BorTable();
             this.GridView1.DataSource   = bBor.select("BorName like '%" + TextBox3.Text + "%'");
             this.GridView1.DataKeyNames = new string[] { "ID" };
             this.GridView1.DataBind();
         }
         if (DropDownList1.Text == "读者班级")
         {
             Bll.BorTable bBor = new Bll.BorTable();
             this.GridView1.DataSource   = bBor.select("BorClass like '%" + TextBox3.Text + "%'");
             this.GridView1.DataKeyNames = new string[] { "ID" };
             this.GridView1.DataBind();
         }
         this.Label4.Text = "";
     }
     else
     {
         this.Label4.Text = "不能为空";
     }
 }
コード例 #2
0
 public void bind()
 {
     Bll.BorTable bBor = new Bll.BorTable();
     this.GridView1.DataSource   = bBor.select("");
     this.GridView1.DataKeyNames = new string[] { "ID" };
     this.GridView1.DataBind();
 }
コード例 #3
0
 public void bind()
 {
     Bll.BorTable bpre = new Bll.BorTable();
     GridView_Excel.DataSource        = bpre.select("");
     this.GridView_Excel.DataKeyNames = new string[] { "ID" };
     this.GridView_Excel.DataBind();
 }
コード例 #4
0
        protected void txt_bookid_TextChanged(object sender, EventArgs e)
        {
            Bll.BorTable bor = new Bll.BorTable();
            DataTable    da  = bor.select("BorId='" + Convert.ToInt32(txt_broid.Text) + "'");

            if (da.Rows.Count == 1)
            {
                txt_broname.Text = da.Rows[0]["BorName"].ToString();
                cunzai           = true;
                btn_add.Enabled  = true;
            }
            else
            {
                btn_add.Enabled  = false;
                txt_broname.Text = "用户不存在";
            }
        }
コード例 #5
0
 private void BindData()
 {
     Bll.BorTable bBor = new Bll.BorTable();
     GridView1.DataSource = bBor.select(string.Empty);
     GridView1.DataBind();
 }