Example #1
0
        // Now do the UPDATE!!!!!!!
        public void Update(string id, string name, string pack, decimal price)
        {
            Beverage toUpdate = db.Beverages.Find(id);

            try
            {
                //Guess we should find it first
                FindById(id);

                //add info
                toUpdate.name  = name;
                toUpdate.pack  = pack;
                toUpdate.price = price;

                //Save info
                db.SaveChanges();
                ui.DisplayAddWineItemSuccess();
            }

            catch (Exception e)
            {
                ui.DisplayAddWineItemError();
            }
        }