public bool Update_Product(BL.Product product)
        {
            BL.Product pro = new Product();
            if (product == null || !product.Check_Product_Name(product.Product_Name1) || product.Product_Name1 == "" || product.Product_Name1 == null)
                return false;
            if (product.Sales_Price1 <= 0 && product.Sales_Price1 <= product.Oraginal_Price1)
                return false;
            if (product.Oraginal_Price1 < 0)
                return false;
            if (product.Avalible_Quantity1 < product.Critcal_Quantity1 || product.Avalible_Quantity1 <= 0)
                return false;
            if (product.Critcal_Quantity1 <= 0)
                return false;

            return mang.Update_Product(product);
        }
        public notification()
        {
            InitializeComponent();
            Product product = new Product();
            List<Product> product_list = new List<Product>();
            product_list = product.selectAllProduct();
            foreach (Product p in product_list)
            {
              // show notification if citical >= available
                if (p.Critcal_Quantity1 >= p.Avalible_Quantity1)
                {
                    notficationToolStripMenuItem.BackColor = Color.Red;
                    ToolStripMenuItem b1 = new ToolStripMenuItem();
                    b1.Name = "tttytfytToolStripMenuItem";
                    b1.Size = new System.Drawing.Size(152, 22);
                    b1.Text = p.Product_Name1 + "  " + "انت تحتاج"+(p.Critcal_Quantity1-p.Avalible_Quantity1).ToString();

                    this.notficationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             b1});
                }

            }
        }
 public bool Delet_Product(Product product)
 {
     if (product == null || product.Product_Name1 == null || product.Product_Name1 == "" || !product.Check_Product_Name(product.Product_Name1)) return false;
     return mang.Delet_Product(product);
 }
        public bool check_udate_product(Product pro1, ref Product product)
        {
            if (pro1 != null && product != null)
            {

                pro.check_update_product(ref product,pro1.Product_Name1);
                if (pro1.Avalible_Quantity1 == product.Avalible_Quantity1 && pro1.Critcal_Quantity1 == product.Critcal_Quantity1 && pro1.Oraginal_Price1 == product.Oraginal_Price1 && pro1.Sales_Price1 == product.Sales_Price1)
                {
                    return false;
                }
                else
                {
                    if (pro1.Product_Name1 == null || pro1.Avalible_Quantity1 <= 0 || pro1.Critcal_Quantity1 <= 0 || pro1.Oraginal_Price1 <= 0 || pro1.Sales_Price1 <= 0 || pro1.Avalible_Quantity1 < pro1.Critcal_Quantity1 || pro1.Sales_Price1 < pro1.Oraginal_Price1)
                    {
                        return false;
                    }
                    else
                    {
                        return true;
                    }
                }
            }
            else
            {
                return false;
            }
        }