Esempio n. 1
0
        private void LoadData()
        {
            DataSet ds = provider.GetAll();

            gvSuppliers.DataSource = ds;
            gvSuppliers.DataBind();
            btnUpdate.Visible = false;
        }
        /// <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();
            }
        }