示例#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 btEdit(object sender, RoutedEventArgs e)
		{
			if (ListViewMenu.SelectedIndex == 1)
			{
				appviemodel.CarAct.EditCar();
				NewCar ac = new NewCar(appviemodel, false);
				ac.ShowDialog();
			}
			else
			{
				appviemodel.BillAct.OnlyDeleteReservation();
			}
		}
        private void btAddNewCar_Click(object sender, RoutedEventArgs e)
        {
            NewCar nc = new NewCar(appviemodel, true);

            nc.Show();
        }