public async Task <IActionResult> Create([Bind("FacilitieListID,FacilityDesc")] FacilitieList facilitieList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(facilitieList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(facilitieList));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("RoomTypeID,RoomTypeDesc")] RoomType roomType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roomType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(roomType));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("GuestID,GuestTitle,GuestForenames,GuestSurnames,GuestDOB,GuestAdressStreet,GuestAdressTown,GuestAdressCounty,GuestAdressPostalCode,GuestContactPhone")] Guest guest)
        {
            if (ModelState.IsValid)
            {
                _context.Add(guest);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(guest));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("PaymentMethodID,PaymentMethodDesc")] PaymentMethod paymentMethod)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentMethod);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paymentMethod));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("CustomerID,CustomerTitle,CustomerForenames,CustomerSurnames,CustomerDOB,CustomerAdressStreet,CustomerAdressTown,CustomerAdressCountry,CustomerAdressPostalCode,CustomerHomePhone,CustomerWorkPhone,CustomerMobilePhone,CustomerEmail")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("BookingID,CustomerID,DateBookingMade,TimeBookingMade,BookedStartDate,BookedEndDate,TotalPaymentDueDate,TotalPaymentDueAmount,TotalPaymentMadeOn,BookingComments")] Booking booking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(booking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerID"] = new SelectList(_context.Customer, "CustomerID", "CustomerAdressCountry", booking.CustomerID);
            return(View(booking));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("RoomID,FacilitieListID,FacilityDetails")] RoomFacilities roomFacilities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roomFacilities);
                await _context.SaveChangesAsync();

                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> Create([Bind("BookingID,RoomID,GuestID")] BookingRoom bookingRoom)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bookingRoom);
                await _context.SaveChangesAsync();

                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));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Create([Bind("RoomID,RoomTypeID,RoomBandID,RoomPriceID,Floor,AdditionalNotes")] Room room)
        {
            if (ModelState.IsValid)
            {
                _context.Add(room);
                await _context.SaveChangesAsync();

                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));
        }
Exemplo n.º 10
0
        public async Task <IActionResult> Create([Bind("PaymentID,BookingID,CustomerID,PaymentMethodID,PaymentAmount,PaymentComments")] Payment payment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(payment);
                await _context.SaveChangesAsync();

                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));
        }