Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("SeatsId,Color")] Seats seats)
        {
            if (id != seats.SeatsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(seats);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeatsExists(seats.SeatsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(seats));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("PlanesId,Name,Model,NumberOfSeats")] Planes planes)
        {
            if (id != planes.PlanesId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(planes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlanesExists(planes.PlanesId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(planes));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(string id, [Bind("Name,ExtraPrice")] Classes classes)
        {
            if (id != classes.Name)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(classes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClassesExists(classes.Name))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(classes));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("DestinationsId,Name,Language,CurrencyValue")] Destinations destinations)
        {
            if (id != destinations.DestinationsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(destinations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DestinationsExists(destinations.DestinationsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(destinations));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Passport,Name,Country,Address,Phone,DateOfBirth")] Customers customers)
        {
            if (id != customers.Passport)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomersExists(customers.Passport))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customers));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("TicketNumber,LandingDate,TakeOffTime")] Ticket ticket)
        {
            if (id != ticket.TicketNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ticket);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TicketExists(ticket.TicketNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ticket));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("OrdersId,Date")] Orders orders)
        {
            if (id != orders.OrdersId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orders);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdersExists(orders.OrdersId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(orders));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Edit(int id, [Bind("FlightNumber,TakeOff,Landing,Price")] Flight flight)
        {
            if (id != flight.FlightNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(flight);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FlightExists(flight.FlightNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(flight));
        }
Exemplo n.º 9
0
        public async Task <IActionResult> Edit(string id, [Bind("Name")] Terminal terminal)
        {
            if (id != terminal.Name)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(terminal);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TerminalExists(terminal.Name))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(terminal));
        }