Beispiel #1
0
        private void donebtn_Click(object sender, EventArgs e)
        {
            if (product_name.Text.Length == 0 || product_price.Text.Length == 0 || product_count.Text.Length == 0 || displaysupplier.Text.Length == 0 || display_category.Text.Length == 0)//check if all fields are inserted
            {
                MessageBox.Show("חובה להזין כל הפרטים");
                return;
            }


            Product product = new Product();

            product.Product_id    = product_code.Text;
            product.Product_name  = product_name.Text;
            product.Categoryname  = display_category.Text;
            product.Price         = double.Parse(product_price.Text);
            product.Suppliername  = displaysupplier.Text;
            product.Product_count = int.Parse(product_count.Text);
            Product_data.updateproduct(product);
            MessageBox.Show("המוצר עודכן בהצלחה");

            this.Close();
        }