public async Task <IActionResult> Edit(int id, [Bind("FacilitieListID,FacilityDesc")] FacilitieList facilitieList) { if (id != facilitieList.FacilitieListID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(facilitieList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FacilitieListExists(facilitieList.FacilitieListID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(facilitieList)); }
public async Task <IActionResult> Edit(int id, [Bind("RoomTypeID,RoomTypeDesc")] RoomType roomType) { if (id != roomType.RoomTypeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(roomType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomTypeExists(roomType.RoomTypeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(roomType)); }
public async Task <IActionResult> Edit(int id, [Bind("BookingID,RoomID,GuestID")] BookingRoom bookingRoom) { if (id != bookingRoom.BookingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bookingRoom); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingRoomExists(bookingRoom.BookingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BookingID"] = new SelectList(_context.Booking, "BookingID", "BookingID", bookingRoom.BookingID); ViewData["GuestID"] = new SelectList(_context.Guest, "GuestID", "GuestTitle", bookingRoom.GuestID); ViewData["RoomID"] = new SelectList(_context.Room, "RoomID", "RoomID", bookingRoom.RoomID); return(View(bookingRoom)); }
public async Task <IActionResult> Edit(int id, [Bind("PaymentMethodID,PaymentMethodDesc")] PaymentMethod paymentMethod) { if (id != paymentMethod.PaymentMethodID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(paymentMethod); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentMethodExists(paymentMethod.PaymentMethodID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(paymentMethod)); }
public async Task <IActionResult> Edit(int id, [Bind("BookingID,CustomerID,DateBookingMade,TimeBookingMade,BookedStartDate,BookedEndDate,TotalPaymentDueDate,TotalPaymentDueAmount,TotalPaymentMadeOn,BookingComments")] Booking booking) { if (id != booking.BookingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(booking); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingExists(booking.BookingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } //ViewData["CustomerID"] = new SelectList(_context.Customer, "CustomerID", "CustomerAdressCountry", booking.CustomerID); ViewData["CustomerID"] = new SelectList(_context.Customer, "CustomerID", "CustomerTitle", booking.CustomerID); return(View(booking)); }
public async Task <IActionResult> Edit(int id, [Bind("RoomID,RoomTypeID,RoomBandID,RoomPriceID,Floor,AdditionalNotes")] Room room) { if (id != room.RoomID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(room); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomExists(room.RoomID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RoomBandID"] = new SelectList(_context.RoomBand, "RoomBandID", "BandDesc", room.RoomBandID); ViewData["RoomPriceID"] = new SelectList(_context.RoomPrice, "RoomPriceID", "RoomPriceAmount", room.RoomPriceID); ViewData["RoomTypeID"] = new SelectList(_context.RoomType, "RoomTypeID", "RoomTypeDesc", room.RoomTypeID); return(View(room)); }
public async Task <IActionResult> Edit(int id, [Bind("GuestID,GuestTitle,GuestForenames,GuestSurnames,GuestDOB,GuestAdressStreet,GuestAdressTown,GuestAdressCounty,GuestAdressPostalCode,GuestContactPhone")] Guest guest) { if (id != guest.GuestID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(guest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GuestExists(guest.GuestID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(guest)); }
public async Task <IActionResult> Edit(int id, [Bind("PaymentID,BookingID,CustomerID,PaymentMethodID,PaymentAmount,PaymentComments")] Payment payment) { if (id != payment.PaymentID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(payment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentExists(payment.PaymentID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BookingID"] = new SelectList(_context.Booking, "BookingID", "BookingID", payment.BookingID); ViewData["CustomerID"] = new SelectList(_context.Customer, "CustomerID", "CustomerTitle", payment.CustomerID); ViewData["PaymentMethodID"] = new SelectList(_context.PaymentMethod, "PaymentMethodID", "PaymentMethodDesc", payment.PaymentMethodID); return(View(payment)); }
public async Task <IActionResult> Edit(int id, [Bind("RoomID,FacilitieListID,FacilityDetails")] RoomFacilities roomFacilities) { if (id != roomFacilities.RoomID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(roomFacilities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomFacilitiesExists(roomFacilities.RoomID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FacilitieListID"] = new SelectList(_context.FacilitieList, "FacilitieListID", "FacilityDesc", roomFacilities.FacilitieListID); ViewData["RoomID"] = new SelectList(_context.Room, "RoomID", "Floor", roomFacilities.RoomID); return(View(roomFacilities)); }
public async Task <IActionResult> Edit(int id, [Bind("CustomerID,CustomerTitle,CustomerForenames,CustomerSurnames,CustomerDOB,CustomerAdressStreet,CustomerAdressTown,CustomerAdressCountry,CustomerAdressPostalCode,CustomerHomePhone,CustomerWorkPhone,CustomerMobilePhone,CustomerEmail")] Customer customer) { if (id != customer.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }