protected void Button4_Click(object sender, EventArgs e)
 {
     Product d = new Product();
     d.ProductName = TextBox1.Text;
     GridView1.DataSource = d.SelectProduct();
     GridView1.DataBind();
 }
 protected void Button3_Click(object sender, EventArgs e)
 {
     Product c = new Product();
     c.ProductID = int.Parse(GridView1.SelectedRow.Cells[2].Text);
     c.DeleteProduct();
     UpdateGrid();
 }
        void UpdateGrid()
        {
            Product a = new Product();
            GridView1.DataSource = a.GetProduct2();
            GridView1.DataBind();

            Order b = new Order();
            GridView2.DataSource = b.GetOrders();
            GridView2.DataBind();
        }
        void UpdateGrid()
        {
            Product a = new Product();
            GridView1.DataSource = a.GetProduct2();
            GridView1.DataBind();

            Order b = new Order();
            b.Username = Session["Name"].ToString();
            GridView2.DataSource = b.GetOrders2();
            GridView2.DataBind();
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     Product a = new Product();
     a.ProductName = TextBox1.Text;
     a.SoH = int.Parse(TextBox2.Text);
     a.SR = int.Parse(TextBox3.Text);
     a.Description = TextBox4.Text;
     a.Price = int.Parse(TextBox5.Text);
     a.NumberSold = int.Parse(TextBox6.Text);
     a.ExpiryDate = TextBox7.Text;
     a.AddProduct();
     UpdateGrid();
 }
 protected void Button2_Click(object sender, EventArgs e)
 {
     Product b = new Product();
     b.ProductName = TextBox1.Text;
     b.SoH = int.Parse(TextBox2.Text);
     b.SR = int.Parse(TextBox3.Text);
     b.Description = TextBox4.Text;
     b.Price = int.Parse(TextBox5.Text);
     b.NumberSold = int.Parse(TextBox6.Text);
     b.ExpiryDate = TextBox7.Text;
     b.ProductID = int.Parse(GridView1.SelectedRow.Cells[2].Text);
     b.EditProduct();
     UpdateGrid();
 }
 void UpdateGrid()
 {
     Product a = new Product();
     GridView1.DataSource = a.GetProduct();
     GridView1.DataBind();
 }