Esempio n. 1
0
 public static void CheckIfElectricEngine(Owner_Details i_owner) // this function check if the vehicle is a electric vehicle
 {
     if (!(i_owner.ownerVehicle.engine is Electric))             // if its not a electric engine
     {
         throw new ArgumentException("The vehicle type is not suitable for charging");
     }
 }
Esempio n. 2
0
 public static void CheckIfGasolinEngine(Owner_Details i_owner) // this function check if the vehicle is a gas driven vehicle
 {
     if (!(i_owner.ownerVehicle.engine is Gasolin))             // if its not a gasolin engine
     {
         throw new ArgumentException("The vehicle type is not suitable for refueling");
     }
 }
Esempio n. 3
0
 public void CheckFuleTypeOfVehicle(Owner_Details i_owner, string i_fualType) // this function check if the fual type that user input is currect
 {
     Gasolin.eFuelType enumFulType;
     enumFulType = (Gasolin.eFuelType)Enum.Parse(typeof(Gasolin.eFuelType), i_fualType);
     if (((Gasolin)(i_owner.ownerVehicle.engine)).FuelType != enumFulType)  // if the fual type not suitable for vehicle
     {
         throw new ArgumentException("Fuel type is not suitable for vehicle fueling");
     }
 }
Esempio n. 4
0
 public void AddOwnerToGarage(Owner_Details i_newOwner)  // this function add a new owner vehicle to garage
 {
     m_vehicleCollection.Add(i_newOwner.ownerVehicle.lincesNumber, i_newOwner);
 }
Esempio n. 5
0
        public static Owner_Details NewOwnerDetails() // this function create newOwner vehicle
        {
            Owner_Details newOwner = new Owner_Details();

            return(newOwner);
        }