private void btnIzbaciUslugu_Click(object sender, RoutedEventArgs e) { var SPDUsluga = (StavkaProdajeDodatnaUsluga)dgIzabraneUsluge.SelectedItem; if (MessageBox.Show($"Da li ste sigurni da zelite da izbacite ovu uslugu: {DodatnaUsluga.GetById(SPDUsluga.DodatnaUslugaId).Naziv}?", "Poruka o brisanju ", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { foreach (var du in korpaDodatneUsluge) { if (du.Id == SPDUsluga.Id) { StavkaProdajeDodatnaUsluga.Delete(du); } } } }
private void Izlaz(object sender, RoutedEventArgs e) { foreach (var spNamestaj in korpaNamestaj) { if (spNamestaj.RacunId == racun.Id) { StavkaProdajeNamestaj.Delete(spNamestaj); } } foreach (var spDodatnaUsluga in korpaDodatneUsluge) { if (spDodatnaUsluga.RacunId == racun.Id) { StavkaProdajeDodatnaUsluga.Delete(spDodatnaUsluga); } } this.Close(); }