コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("FlightId,LeavingDate,DepartureTime,ArrivalDate,ArrivalTime,Origin,Destination")] Flight flight)
        {
            if (id != flight.FlightId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(flight);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FlightExists(flight.FlightId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(flight));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ScheduleId,FlightId,AircraftId,CabinCrewId,CabinCrewId2,CabinCrewId3,FlightCrewId1,FlightCrewId2,FlightCrewId3,Flying_Hours")] Passenger_Aircraft_Crew_Schedule flight_Aircraft_Crew_Schedule)
        {
            if (id != flight_Aircraft_Crew_Schedule.ScheduleId)
            {
                return(NotFound());
            }

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