public ActionResult Edit([Bind(Include = "id,userID,country,postCode,city,street")] Address address)
 {
     if (ModelState.IsValid)
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Checkout"));
     }
     ViewBag.userID = new SelectList(db.Users, "id", "name", address.userID);
     return(View(address));
 }
 public ActionResult Edit([Bind(Include = "userID,cardNumber,cvr,expiryDate")] PaymentDetail paymentDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(paymentDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Checkout"));
     }
     ViewBag.userID = new SelectList(db.Users, "id", "name", paymentDetail.userID);
     return(View(paymentDetail));
 }
Exemplo n.º 3
0
 public ActionResult AdsEdit(Ad ad)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ad).State = EntityState.Modified;
         db.SaveChanges();
         if (ad != null)
         {
             return(RedirectToAction("Index"));
         }
     }
     ViewBag.categoryID = new SelectList(db.Categories, "id", "name", ad.categoryID);
     return(View("~/Views/Ads/Edit.cshtml", ad));
 }
Exemplo n.º 4
0
 public Ad UpdateAd(Ad ad)
 {
     db.Entry(ad).State = EntityState.Modified;
     db.SaveChanges();
     return(ad);
 }
Exemplo n.º 5
0
 public Basket UpdateBasket(Basket basket)
 {
     db.Entry(basket).State = EntityState.Modified;
     db.SaveChanges();
     return(basket);
 }
Exemplo n.º 6
0
 public Category UpdateCategory(Category category)
 {
     db.Entry(category).State = EntityState.Modified;
     db.SaveChanges();
     return(category);
 }