public async Task <Flight> UpdateStatusAsync(Guid id, EFlightStatus status) { var flight = await GetRowAsync(id); flight.Status = status; var ent = _context.Flights.Update(flight); _context.SaveChanges(); return(ent.Entity); }
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)); } }
public static string GetName(this EFlightStatus role) { return(Enum.GetName(typeof(EFlightStatus), role)); }