Exemple #1
0
        public async Task <IActionResult> FlightsTableAdmin(string filter)
        {
            EFlightStatus status     = EFlightStatus.Pending;
            var           flightsAll = (await flightsController.GetAllReducedAsync()).Object;

            try
            {
                status.SetTo(filter);
                List <FlightBasicDTO> flights = new List <FlightBasicDTO>();
                foreach (var flight in flightsAll)
                {
                    if (flight.Status == status)
                    {
                        flights.Add(flight);
                    }
                }
                return(View(model: flights));
            }
            catch (ArgumentException)
            {
                return(View(model: flightsAll));
            }
        }