Пример #1
0
        private ClientVehicle findClientVehicleInGarageByLicenseNumber(string i_LicenseNumber)
        {
            ClientVehicle WantedClientVehicle = r_ClientVehiclesCollection[i_LicenseNumber];

            if (WantedClientVehicle == null)
            {
                throw new ArgumentException(string.Format("License Number: {0}, don't exist in the garage.", i_LicenseNumber));
            }

            return(WantedClientVehicle);
        }
Пример #2
0
        public bool AddVehicleToGarage(ClientVehicle i_NewClientVehicle)
        {
            bool isNewClientVehicleHasAdded = true;

            if (r_ClientVehiclesCollection.ContainsKey(i_NewClientVehicle.GetVehicleLicenseCode()) == false)
            {
                addClientVehicleToGarageCollection(i_NewClientVehicle);
            }
            else
            {
                ChangeClientVehicleStatus(i_NewClientVehicle.GetVehicleLicenseCode(), ClientVehicle.eClientVehicleStatus.InRepair);
                isNewClientVehicleHasAdded = false;
            }

            return(isNewClientVehicleHasAdded);
        }
Пример #3
0
        public void RechargeClientVehicleByLicenseNumber(string i_LicenseNumber, float i_AmountOfMinutes)
        {
            ClientVehicle clientVehiclesToCharge = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToCharge.RechargeVehicle(i_AmountOfMinutes);
        }
Пример #4
0
        public void RefuelClientVehicleByLicenseNumber(string i_LicenseNumber, FueledEngine.eFuelType i_WantedFuelType, float i_AmountOfFuel)
        {
            ClientVehicle clientVehiclesToRefuel = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToRefuel.RefuelVehicle(i_AmountOfFuel, i_WantedFuelType);
        }
Пример #5
0
        public void InflateTiresOfClientVehicleToMaximum(string i_LicenseNumber)
        {
            ClientVehicle clientVehicleToInflate = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehicleToInflate.InflateVehicleTiresToMaximum();
        }
Пример #6
0
        public void ChangeClientVehicleStatus(string i_LicenseNumber, ClientVehicle.eClientVehicleStatus i_NewClientVehicleStatus)
        {
            ClientVehicle clientVehiclesToChange = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            clientVehiclesToChange.ClientVehicleStatus = i_NewClientVehicleStatus;
        }
Пример #7
0
        public string GetClientVehicleInformation(string i_LicenseNumber)
        {
            ClientVehicle clientVehicle = findClientVehicleInGarageByLicenseNumber(i_LicenseNumber);

            return(clientVehicle.GetClientVehicleInformation());
        }
Пример #8
0
 private void addClientVehicleToGarageCollection(ClientVehicle i_NewClientVehicle)
 {
     r_ClientVehiclesCollection.Add(i_NewClientVehicle.GetVehicleLicenseCode(), i_NewClientVehicle);
 }