private void btAdd(object sender, RoutedEventArgs e) { if (ListViewMenu.SelectedIndex == 1) { NewCar ac = new NewCar(appviemodel, true); ac.ShowDialog(); appviemodel.CarAct.RefreshPages(); } else { if (!appviemodel.IsAdmin) { if (!appviemodel.CurrenUser.CanTake()) { MessageBox.Show("You have unpaid rent, pay, before creating a new rent!"); return; } NewReservation nr = new NewReservation(appviemodel, null, appviemodel.CurrenUser); nr.ShowDialog(); } else { NewReservation nr = new NewReservation(appviemodel); nr.ShowDialog(); } } }
private void btAdd_Click(object sender, RoutedEventArgs e) { appviemodel.BillAct.NewBill.Rent.Car = appviemodel.CarAct.SelectedCar; if (appviemodel.IsAdmin) { NewReservation nr = new NewReservation(appviemodel, appviemodel.CarAct.SelectedCar); nr.ShowDialog(); } else { NewReservation nr = new NewReservation(appviemodel, appviemodel.CarAct.SelectedCar, appviemodel.CurrenUser); nr.ShowDialog(); } this.Close(); }