public async Task <IActionResult> Edit(int id, [Bind("Customerid,Name,Email,Contact,Password")] 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)); }
public async Task <IActionResult> Edit(int id, [Bind("Bookingid,Room_ID,Customer_ID,Total_Amount,Booking_Date")] 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))); } return(View(booking)); }
public async Task <IActionResult> Edit(int id, [Bind("Roomid,RoomType,Specification,Fair,Status")] 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))); } return(View(room)); }