Example #1
0
        public async Task <IActionResult> Create([Bind("PlanesId,Name,Model,NumberOfSeats")] Planes planes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(planes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(planes));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("DestinationsId,Name,Language,CurrencyValue")] Destinations destinations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(destinations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(destinations));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("SeatsId,Color")] Seats seats)
        {
            if (ModelState.IsValid)
            {
                _context.Add(seats);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(seats));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("PlanesId,ClassesId")] PlaneUnit planeUnit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(planeUnit);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(planeUnit));
        }
        public async Task <IActionResult> Create([Bind("Name,ExtraPrice")] Classes classes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(classes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(classes));
        }
        public async Task <IActionResult> Create([Bind("Passport,Name,Country,Address,Phone,DateOfBirth")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customers));
        }
Example #7
0
        public async Task <IActionResult> Create([Bind("TicketNumber,LandingDate,TakeOffTime")] Ticket ticket)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ticket);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ticket));
        }
        public async Task <IActionResult> Create([Bind("OrdersId,Date")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(orders));
        }
        public async Task <IActionResult> Create([Bind("FlightNumber,TakeOff,Landing,Price")] Flight flight)
        {
            if (ModelState.IsValid)
            {
                _context.Add(flight);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(flight));
        }
Example #10
0
        public async Task <IActionResult> Create([Bind("Name")] Terminal terminal)
        {
            if (ModelState.IsValid)
            {
                _context.Add(terminal);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(terminal));
        }