public ActionResult Edit([Bind(Include = "atID,atName,atDes,atType,atLocLat,atLocLong,atTransportMode,atTransportDes")] Attraction attraction) { if (ModelState.IsValid) { dataGateway.Update(attraction); return(RedirectToAction("Index")); } return(View(attraction)); }
public ActionResult Edit([Bind(Include = "bookTitle,bookAuthor,bookGenre,bookDesc,bookISBN10,bookISBN13,bookType,bookImage,bookLocation,bookQuantity,bookAvailability,dateOfLoan")] Book book) { if (ModelState.IsValid) { DataGateway.Update(book); return(RedirectToAction("Index")); } return(View(book)); }
public ActionResult Edit([Bind(Include = "ID,restName,restDes,restType,restLocLat,restLocLong")] Restaurant myRestaurant) { if (ModelState.IsValid) { dataGateway.Update(myRestaurant); return(RedirectToAction("Index")); } return(View(myRestaurant)); }
public ActionResult Edit(int id, FormCollection collection) { try { Book book = bookDataGateway.SelectById(id); bookDataGateway.Update(book, id); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(View(bookDataGateway.SelectById(id))); } }
public virtual IActionResult Edit(int id, T t) { if (ModelState.IsValid) { try { dataGateway.Update(t); } catch (DbUpdateConcurrencyException) { if (!ObjectExists(id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(t)); }