Exemplo n.º 1
0
 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     busSupplier bussup = new busSupplier();
     this.GridView1.PageIndex = e.NewPageIndex;
     DataTable dt = new DataTable("User");
     dt = bussup.allSupplier();
     GridView1.DataSource = dt;
     GridView1.DataBind();
 }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                busSupplier bussup = new busSupplier();

                DataTable dt = new DataTable("User");
                dt = bussup.allSupplier();
                ViewState["Supplier"] = dt;
                GridView1.DataSource = dt;
                GridView1.DataBind();

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = new DataTable("User");
                busProducts busProd = new busProducts();
                dt = new DataTable("User");
                dt = busProd.allProducts();
                ViewState["Products"] = dt;
                this.drpProduct.Items.Clear();
                this.drpProduct.Items.Add(new ListItem("Select One", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpProduct.Items.Add(new ListItem(dr["ProductName"].ToString(), dr["ID"].ToString()));
                }

                busSupplier busSup = new busSupplier();
                dt = busSup.allSupplier();
                ViewState["Supplier"] = dt;
                this.drpSupplier.Items.Clear();
                this.drpSupplier.Items.Add(new ListItem("Select One", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    this.drpSupplier.Items.Add(new ListItem(dr["Company"].ToString(), dr["ID"].ToString()));
                }
            }
        }