public async Task <IActionResult> Edit(int id, [Bind("ActorID,ActorFullName,ActorNotes")] RoomPrices roomPrices) { if (id != roomPrices.RoomPricesID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(roomPrices); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomPricesExists(roomPrices.RoomPricesID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(roomPrices)); }
public static RoomPriceModel ToRoomPriceModel(this RoomPrices roomPrices) { return(new RoomPriceModel { RoomId = roomPrices.RoomId, Price = roomPrices.Price, HotelId = roomPrices.HotelId }); }
public async Task <IActionResult> Create([Bind("ActorID,ActorFullName,ActorNotes")] RoomPrices roomPrices) { if (ModelState.IsValid) { _context.Add(roomPrices); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(roomPrices)); }