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"); } }
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"); } }
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"); } }
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); }
public static Owner_Details NewOwnerDetails() // this function create newOwner vehicle { Owner_Details newOwner = new Owner_Details(); return(newOwner); }