Beispiel #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     Subotai.Dal.Gatekeeper.Interfaces.Cart cart = db.Carts.Find(id);
     db.Carts.Remove(cart);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,IdProductItems,IdUser")] Subotai.Dal.Gatekeeper.Interfaces.Cart cart)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cart).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdProductItems = new SelectList(db.ProductItems, "Id", "Name", cart.IdProductItems);
     ViewBag.IdUser         = new SelectList(db.Users, "Id", "Name", cart.IdUser);
     return(View(cart));
 }
Beispiel #3
0
 // GET: Cart/Carts/Details/5
 public ActionResult Details(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Subotai.Dal.Gatekeeper.Interfaces.Cart cart = db.Carts.Find(id);
     if (cart == null)
     {
         return(HttpNotFound());
     }
     return(View(cart));
 }
Beispiel #4
0
 // GET: Cart/Carts/Edit/5
 public ActionResult Edit(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Subotai.Dal.Gatekeeper.Interfaces.Cart cart = db.Carts.Find(id);
     if (cart == null)
     {
         return(HttpNotFound());
     }
     ViewBag.IdProductItems = new SelectList(db.ProductItems, "Id", "Name", cart.IdProductItems);
     ViewBag.IdUser         = new SelectList(db.Users, "Id", "Name", cart.IdUser);
     return(View(cart));
 }