public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Layout")] Room room) { if (id != room.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(room); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomExists(room.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(room)); }
public async Task <IActionResult> Edit(int id, [Bind("HotelID,RoomNumber,RoomID,Rate,PetFriendly")] HotelRoom hotelRoom) { if (id != hotelRoom.HotelID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hotelRoom); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HotelRoomExists(hotelRoom.HotelID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RoomID"] = new SelectList(_context.Rooms, "ID", "ID", hotelRoom.RoomID); return(View(hotelRoom)); }
public async Task <IActionResult> Edit(int id, [Bind("AmenitiesID,RoomID")] RoomAmenities roomAmenities) { if (id != roomAmenities.AmenitiesID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(roomAmenities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomAmenitiesExists(roomAmenities.AmenitiesID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AmenitiesID"] = new SelectList(_context.Amenities, "ID", "ID", roomAmenities.AmenitiesID); ViewData["RoomID"] = new SelectList(_context.Rooms, "ID", "ID", roomAmenities.RoomID); return(View(roomAmenities)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name")] Amenities amenities) { if (id != amenities.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(amenities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AmenitiesExists(amenities.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(amenities)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,StreetAddress,City,State,Phone")] Hotel hotel) { if (id != hotel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hotel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HotelExists(hotel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hotel)); }
public async Task <IActionResult> Edit(int id, [Bind("RoomLocationId,RoomId,LocationId,Price,PetFriendly")] RoomLocation roomLocation) { if (id != roomLocation.RoomLocationId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(roomLocation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomLocationExists(roomLocation.RoomLocationId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["LocationId"] = new SelectList(_context.Locations, "LocationId", "LocationId", roomLocation.LocationId); ViewData["RoomId"] = new SelectList(_context.Rooms, "RoomId", "RoomId", roomLocation.RoomId); return(View(roomLocation)); }
public async Task EditHotel(int id, [Bind("ID,Name,StreetAdress,City,State,Phone")] Hotel hotel) { _context.Update(hotel); await _context.SaveChangesAsync(); }
public void UpdateAmenityPackage(int id, AmenityPackage amenityPackage) { _context.Update(amenityPackage); }
public async Task EditRoom(int id, [Bind("ID,Name,Layout")] Room room) { _context.Update(room); await _context.SaveChangesAsync(); }
public void UpdateLocation(int id, Location location) { _context.Update(location); }
public async Task EditAmenity(int id, [Bind(new[] { "ID,Name" })] Amenities amenity) { _context.Update(amenity); await _context.SaveChangesAsync(); }
public void UpdateRoom(int id, Room room) { _context.Update(room); }