public bool checkPin(string pinCode, Owner owner)
 {
     if (owner.Bankaccount.Pincode == pinCode)
     {
         return true;
     }
     return false;
 }
Example #2
0
 /// <summary>
 /// Create a car without a owner
 /// </summary>
 /// <param name="licenseplate"></param>
 /// <param name="fueltype"></param>
 /// <param name="brand"></param>
 /// <param name="fuelcapacity"></param>
 public Car(string licenseplate, TypeOfFuel fueltype, string brand, double fuelcapacity)
 {
     Licenseplate = licenseplate;
     Fueltype = fueltype;
     Brand = brand;
     FuelCapacity = fuelcapacity;
     Owner = null;
 }
        private string getPinCodeFromUser(Owner owner, decimal amountToPay)
        {
            // Create and display an instance of the dialog box
            BankPinCode dlg = new BankPinCode();
            string pinCode = "";

            // Show the dialog and determine the state of the 
            // DialogResult property for the form.
            dlg.lblBalance.Text = "Current Balance: " + owner.Bankaccount.Balance.ToString() + "\n Price: " + amountToPay.ToString();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                pinCode = dlg.PinCode;
                dlg.Dispose();
            }
            return pinCode;
        }