Example #1
0
        private void Button6_Click(object sender, EventArgs e)
        {
            if (tbProdName.Text == "" || tbProdPrice.Text == "" || tbProdStock.Text == "")
            {
                MessageBox.Show("Please fill all boxes!");
            }
            else
            {
                string name  = tbProdName.Text;
                double price = Convert.ToDouble(tbProdPrice.Text);
                int    stock = Convert.ToInt32(tbProdStock.Text);
                int    sold  = 0;
                string category;
                int    amount = 0;

                category = "DEPOT";
                Product prod = new Product(name, price, stock, sold, category, amount);
                conn.AddProductToDB(prod);
                ProductManagment.AddProductDEPOT(prod);
                MessageBox.Show("Product Added!");
                tbProdName.Text  = "";
                tbProdPrice.Text = "";
                tbProdStock.Text = "";
                managment.AddProductinDEPOT(prod);
            }
        }