Beispiel #1
0
        public string GetVehicleDetails(string i_LicenseNumber)
        {
            string       vehicleDetails, wheelsDetails, engineDetails, vehicleSpecificDetails;
            Vehicle      vehicle      = this[i_LicenseNumber];
            OwnerDetails ownerDetails = r_VehiclesInGarage[vehicle];

            wheelsDetails          = vehicle.GetWheelsDetails();
            engineDetails          = vehicle.GetEngineDetails();
            vehicleSpecificDetails = vehicle.GetSpecificDetails();
            vehicleDetails         = string.Format(
                @"License Number: {0}
Model: {1}
Owner's name: {2}
Owner's phone number: {3}
Status: {4}
The Current Energy Percent is: {5} %
{6}
{7}
{8}",
                vehicle.LicenseNumber,
                vehicle.Model,
                ownerDetails.OwnerName,
                ownerDetails.OwnerPhoneNumber,
                ownerDetails.VehicleStatus.ToString(),
                vehicle.CurrentEnergyPercent.ToString(),
                wheelsDetails,
                engineDetails,
                vehicleSpecificDetails);

            return(vehicleDetails);
        }