Beispiel #1
0
        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));
        }
Beispiel #2
0
 public static RoomPriceModel ToRoomPriceModel(this RoomPrices roomPrices)
 {
     return(new RoomPriceModel
     {
         RoomId = roomPrices.RoomId,
         Price = roomPrices.Price,
         HotelId = roomPrices.HotelId
     });
 }
Beispiel #3
0
        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));
        }