async void Delete() { await _flightService.Delete(Flight.Id); Flight = new Flight(); await LoadFlights().ConfigureAwait(false); }
async void Delete() { await flightservice.Delete(Flight.Id); Flight = new Flight(); await LoadEntity().ConfigureAwait(false); }
public ActionResult <Flight> Delete(int id) { try { return(Ok(_service.Delete(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task Delete() { await flightService.Delete(Flight.Id); Flight = new Flight(); NotifyPropertyChanged(() => Flight); List <Flight> tempFlights = await flightService.GetAll(); Flights = new ObservableCollection <Flight>(); foreach (var fl in tempFlights) { Flights.Add(fl); } NotifyPropertyChanged(() => Flights); }
public async Task CreateFlight_WhenFlightValid_ReturnNewFlight() { FlightDto flight = new FlightDto() { ArrivalPoint = "Test", DeparturePoint = "Test", ArrivalTime = new TimeSpan(), DepartureTime = new TimeSpan(), Tickets = new List <TicketDto>() }; FlightDto flightDtoSaved = await serviceFlight.Create(flight); Assert.AreEqual(flight.ArrivalPoint, flight.ArrivalPoint); Assert.AreEqual(flight.DeparturePoint, flight.DeparturePoint); bool result = await serviceFlight.Delete <Aircraft>(aircr => aircr.Id == flightDtoSaved.Id); Assert.IsTrue(result); }
private void BtnDelete_Click(object sender, RoutedEventArgs e) { if (loginService.IsSuperUser) { if (MessageBox.Show("Are you sure to delete this flight?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes) { flightService.Delete(LstFlights.SelectedIndex); for (int i = 0; i < flightService.GetFlights().Count; i++) { flightService.GetFlights()[i].ID = i; } RefreshList(); } } else { MessageBox.Show("Access Denied", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } }
public async Task DeleteById(int id) { await fs.Delete(id); this.Frame.Navigate(typeof(Flights)); }
public void Delete(int id) { flightService.Delete(id); }