예제 #1
0
 private void btnPay_Click(object sender, EventArgs e)
 {
     try
     {
         DataProvider data = new DataProvider();
         data.RemoveVehicle(_vehicle);
         MessageBox.Show("Vehicle payed and removed", "Success");
     }
     catch
     {
         MessageBox.Show("Transaction failed or could not checkout", "Failed");
     }
     finally
     {
         RaiseIsCancelled?.Invoke(this, e);
         this.Close();
     }
 }
예제 #2
0
        private void btnMove_Click(object sender, EventArgs e)
        {
            DataProvider data = new();

            try
            {
                data.MoveVehicle(_vehicle, (int)cmbParkingSlots.SelectedItem);
                MessageBox.Show($"{_vehicle.Regnum} moved to {(int)cmbParkingSlots.SelectedItem}", "Success!");
            }
            catch
            {
                MessageBox.Show("Failed to move vehicle", "Failed!");
            }
            finally
            {
                RaiseIsCancelled?.Invoke(this, e);
                this.Close();
            }
        }
예제 #3
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     RaiseIsCancelled?.Invoke(this, e);
     this.Close();
 }