public ActionResult SellCarton()
        {
            var form = new CartonInventory
            {
                CartonList =
                    _context.Cartons.ToListItems(t => ("Carton - " + t.Item.ItemName),
                        v => v.CartonId.ToString(CultureInfo.InvariantCulture), "Please Select...")
            };


            return View(form);
        }
        public ActionResult SellCarton(CartonInventory formCartonInventory)
        {
            try
            {
                var cartonInvetory = _context.Inventories.SingleOrDefault(i => i.CartonId == formCartonInventory.CartonId);
                if (cartonInvetory == null)
                {
                    return RedirectToAction<InventoryController>(c => c.Index())
                        .WithWarning("No Inventory exists!");

                }

                //TODO: Update
                var existingCartons = cartonInvetory.NumberOfCartons;
                if (formCartonInventory.NumberOfCartons <= existingCartons)
                {
                    cartonInvetory.NumberOfCartons = existingCartons - formCartonInventory.NumberOfCartons;
                }
                else
                {
                    return RedirectToAction<InventoryController>(c => c.Index())
                        .WithWarning("Carton inventory can't satisfy sell demand!");
                }

                _context.SaveChanges();

                return RedirectToAction<InventoryController>(c => c.Index())
                .WithSuccess("Carton(s) Sold!");
            }
            catch (Exception ex)
            {
                return RedirectToAction<InventoryController>(c => c.Index())
                .WithError("Error Selling Cartons");
            }
        }
        public ActionResult AddCarton(CartonInventory formCartonInventory)
        {
            try
            {
                var carton = _context.Inventories.SingleOrDefault(i => i.CartonId == formCartonInventory.CartonId);
                if (carton == null)
                {
                    //TODO: Insert
                    _context.Inventories.Add(new Inventory
                    {
                        CartonId = formCartonInventory.CartonId,
                        NumberOfCartons = formCartonInventory.NumberOfCartons
                    });

                }
                else
                {
                    //TODO: Update
                    var existingCartons = carton.NumberOfCartons;
                    carton.NumberOfCartons = existingCartons + formCartonInventory.NumberOfCartons;
                }

                _context.SaveChanges();

                return RedirectToAction<InventoryController>(c => c.Index())
                .WithSuccess("Carton(s) Added!");
            }
            catch (Exception ex)
            {
                return RedirectToAction<InventoryController>(c => c.Index())
                .WithError("Error Adding Cartons");
            }
        }