public async Task <IActionResult> Create([Bind("Id,Attraction_Name,Attraction_Place,Attraction_Address,Attraction_Description,Attraction_Price,Attraction_Open_Hours")] Attraction attraction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(attraction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(attraction));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Customer_Name,Mobile,Email,Address")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
        public async Task <IActionResult> Create([Bind("Id,Hotal_Name,Address,Room_Price,Room_Type")] Hotel hotel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hotel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(hotel));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("Id,No_of_tickets,Ticket_price,CustomerId,HotelId,AttractionId,EventId")] Booking booking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(booking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AttractionId"] = new SelectList(_context.Attraction, "Id", "Attraction_Address", booking.AttractionId);
            ViewData["EventId"]      = new SelectList(_context.Event, "Id", "Event_Address", booking.EventId);
            ViewData["HotelId"]      = new SelectList(_context.Famous_Hotel, "Id", "Address", booking.HotelId);
            ViewData["CustomerId"]   = new SelectList(_context.Customer, "Id", "Address", booking.CustomerId);
            return(View(booking));
        }