/*
         *
         * Edit
         *
         */
        public ActionResult Edit(int? id)
        {
            if (!id.HasValue) {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            ShoppingCartModel model = new ShoppingCartModel();
            shopping_cart result = db.shopping_cart.FirstOrDefault(m => m.shopping_cart_id == id);

            if (result == null) {
                return HttpNotFound();
            }
            //shopping_cart res = db.shopping_cart.Find(id);
            model.name = result.name;

            return View("Edit", model);
        }
 public ActionResult Edit(ShoppingCartModel model)
 {
     try {
         if (ModelState.IsValid) {
             // Save to Database
             var newUpdate = db.shopping_cart.FirstOrDefault(m => m.shopping_cart_id == model.id);
             var c = model.name.Length;
             var x = newUpdate.name.Length;
             newUpdate.name = model.name;
             db.SaveChanges();
             return RedirectToAction("Index");
         }
     }
     catch (DbEntityValidationException dbEx) {
         foreach (var validationErrors in dbEx.EntityValidationErrors) {
             foreach (var validationError in validationErrors.ValidationErrors) {
                 System.Diagnostics.Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage);
             }
         }
     }
     return View("Edit", model);
 }