private void BindText() { Supplier supplier = new Supplier(); supplier.Supplier_Id = Convert.ToInt32(id); SupplierProvider provider = new SupplierProvider(); DataTable table = new DataTable(); table = provider.Select(supplier); this.txt_name.Text = table.Rows[0]["supplier_name"].ToString(); this.txt_address.Text = table.Rows[0]["Supplier_address"].ToString(); this.txt_postcode.Text = table.Rows[0]["Supplier_postcode"].ToString(); this.txt_cell.Text = table.Rows[0]["Supplier_cell"].ToString(); this.txt_phone.Text = table.Rows[0]["Supplier_phone"].ToString(); this.txt_fax.Text = table.Rows[0]["Supplier_fax"].ToString(); this.txt_email.Text = table.Rows[0]["Supplier_email"].ToString(); this.txt_liaison.Text = table.Rows[0]["Supplier_liaison"].ToString(); }
/// <summary> /// 绑定Users信息的数据源 /// </summary> private void BindSource(int start, string name) { if (name != null) { Supplier supplier = new Supplier(); supplier.Supplier_Name = name; SupplierProvider provider = new SupplierProvider(); DataTable table = provider.Select(supplier, start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } else { SupplierProvider provider = new SupplierProvider(); DataTable table = provider.GetAll(start, this.ListPager1.PageSize); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind(); } }