示例#1
0
		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();
				}
			}
		}
示例#2
0
 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();
 }