public ActionResult Create_Ingredient(product_ingresients product_Ingresients)
        {
            try
            {
                using (OrderSystemEntities2 db = new OrderSystemEntities2())
                {
                    db.product_ingresients.Add(product_Ingresients);
                    db.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                ViewBag.dup = 1;
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Create(product product, HttpPostedFileBase picture, product_ingresients product_Ingresients)
        {
            OrderSystemEntities2 db1 = new OrderSystemEntities2();

            try
            {
                product             pro    = new product();
                product_ingresients pro_in = new product_ingresients();

                string path = UpLoadImage(picture);

                pro.name        = product.name;
                pro.categoryID  = product.categoryID;
                pro.description = product.description;
                pro.price       = product.price;
                pro.img         = path;
                pro.isCombo     = product.isCombo;
                pro.disable     = product.disable;

                db.products.Add(pro);

                db.SaveChanges();



                //int lastProductId = db.products.Max(item => item.id);
                ////int lastProductId1 = pro.id;

                //pro_in.productID = lastProductId;
                //pro_in.ingID = product_Ingresients.ingID;
                //pro_in.amount = product.amount;


                //db1.product_ingresients.Add(pro_in);

                //db1.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(RedirectToAction("Error", "Error"));
            }
        }