public ActionResult Edit([Bind(Include = "Id,Description")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "Id,ImageUrl,AccommodationId")] Image image) { if (ModelState.IsValid) { db.Entry(image).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AccommodationId = new SelectList(db.Accommodations, "Id", "Title", image.AccommodationId); return(View(image)); }
public ActionResult Edit([Bind(Include = "Id,ApplicationUserId,AccommodationId,Arrival,Departure,Occupancy,Rating")] Booking booking) { if (ModelState.IsValid) { db.Entry(booking).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AccommodationId = new SelectList(db.Accommodations, "Id", "Title", booking.AccommodationId); return(View(booking)); }
public ActionResult Edit([Bind(Include = "Id,ApplicationUserId,Title,Location,Adress,Description,Occupancy,Rooms,Baths,Price,CategoryId")] Accommodation accommodation) { if (ModelState.IsValid) { db.Entry(accommodation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Description", accommodation.CategoryId); return(View(accommodation)); }