Ejemplo n.º 1
0
 public ClientData(string i_FullName, string i_PhoneNumber, Vehicle i_Vehicle)
 {
     r_FullName    = i_FullName;
     m_PhoneNumber = i_PhoneNumber;
     m_Vehicle     = i_Vehicle;
     m_CarStatus   = eVehicleStatusInGarage.Repairing;
 }
Ejemplo n.º 2
0
 public GarageVehicle(Vehicle i_VehicleToGarage, string i_OwnersName, long i_OwnersPhone, eVehicleStatusInGarage i_StatusOfVehicle)
 {
     m_VehicleInGarage = i_VehicleToGarage;
     m_OwnersName      = i_OwnersName;
     m_OwnersPhone     = i_OwnersPhone;
     m_StatusOfVehicle = i_StatusOfVehicle;
 }
Ejemplo n.º 3
0
        public static eVehicleStatusInGarage GetStatusOnGarage()
        {
            string vechileStatusFromUser = Console.ReadLine();

            while (true)
            {
                try
                {
                    eVehicleStatusInGarage eStatusOnGarage = (eVehicleStatusInGarage)Enum.Parse(typeof(eVehicleStatusInGarage), vechileStatusFromUser);
                    if ((int)eStatusOnGarage > (int)Enum.GetValues(typeof(eVehicleStatusInGarage)).Cast <eVehicleStatusInGarage>().Last())
                    {
                        throw new ValueOutOfRangeException(3, 1);
                    }

                    return(eStatusOnGarage);
                }
                catch (ArgumentException ex)
                {
                    Console.WriteLine(@"Wrong input due to {0},please enter InProgress(1)/Fixed(2)/Paid(3)", ex.Message);
                    vechileStatusFromUser = Console.ReadLine();
                }
                catch (ValueOutOfRangeException ex)
                {
                    Console.WriteLine(ex.Message);
                    vechileStatusFromUser = Console.ReadLine();
                }
            }
        }
Ejemplo n.º 4
0
        private void changeStatusOfVehicle(GarageVehicle i_SearchvihicleInGarage)
        {
            Console.WriteLine("Please enter the Vehicles new status you would like to set:");
            eVehicleStatusInGarage statusToUpdate = ValidationOfData.GetStatusOnGarage();

            i_SearchvihicleInGarage.ChangeCarStatus(statusToUpdate);
            Console.WriteLine("The new status is: {0}", statusToUpdate);
        }
Ejemplo n.º 5
0
        private static void modifyVehicleStatus()
        {
            Console.WriteLine("Please enter a plate number");
            string plateNumber = Console.ReadLine();
            eVehicleStatusInGarage newVehicleStatus = (eVehicleStatusInGarage)getUserChoiceFromEnumValues(typeof(eVehicleStatusInGarage));

            s_Garage.ChangeVehicleStatus(plateNumber, newVehicleStatus);
            Console.WriteLine("Vehicle status changed successfully");
        }
Ejemplo n.º 6
0
 public Vehicle(string i_ModelName, string i_LicenceId, string i_WheelManufacturerName, float i_MaxWheelPressureManufacturerSuggested, int i_NumberOfWheels, VehicleType.eVehicleType i_VehicleType, params string[] i_DataToFillEnergySource)
 {
     this.m_ModelName        = i_ModelName;
     this.m_LicenceId        = i_LicenceId;
     m_VehicleStatusInGarage = eVehicleStatusInGarage.Infix; // The first status of the Vehicle is 'Infix'
     createVehicleWheelsArray(i_WheelManufacturerName, i_NumberOfWheels, i_MaxWheelPressureManufacturerSuggested);
     updateTheCurrentPressureInVehicleWheelsArray(k_InitPressureInVehicleWheel);
     updateVehicleType(i_VehicleType, i_DataToFillEnergySource);
 }
Ejemplo n.º 7
0
        private static void DisplayFilteredPlateNumbers()
        {
            eVehicleStatusInGarage filter       = (eVehicleStatusInGarage)getUserChoiceFromEnumValues(typeof(eVehicleStatusInGarage));
            List <string>          plateNumbers = s_Garage.GetPlateNumbers(filter);

            foreach (string currentPlate in plateNumbers)
            {
                Console.WriteLine(currentPlate);
            }
        }
Ejemplo n.º 8
0
 private void displayByStatus(eVehicleStatusInGarage i_StatusToDisplay)
 {
     foreach (KeyValuePair <string, GarageVehicle> searchInGarage in m_HadarAndKochGarage.AllVehicleInGarage)
     {
         if (searchInGarage.Value.StatusOfVehicle.Equals(i_StatusToDisplay))
         {
             Console.WriteLine(searchInGarage.Key);
         }
     }
 }
Ejemplo n.º 9
0
        public void ChangeVehicleStatus(string i_PlateNumber, eVehicleStatusInGarage i_NewVehicleStatus)
        {
            GarageVehicle vehicleToChangeStatus = getVehicleFromDictionary(i_PlateNumber);

            if (vehicleToChangeStatus == null)
            {
                throw new ArgumentException(string.Format("Vehicle with plate number {0} not found ", i_PlateNumber));
            }

            vehicleToChangeStatus.VehicleStatusInGarage = i_NewVehicleStatus;
        }
Ejemplo n.º 10
0
        public List <string> GetPlateNumbers(eVehicleStatusInGarage i_StatusInGarage)
        {
            List <string> plateNumbers = new List <string>();

            foreach (GarageVehicle vehicleInGarage in m_DictOfGarageVehicles.Values)
            {
                if (vehicleInGarage.VehicleStatusInGarage == i_StatusInGarage)
                {
                    plateNumbers.Add(vehicleInGarage.Vehicle.DetailsOfVehicle.plateNumber);
                }
            }

            return(plateNumbers);
        }
Ejemplo n.º 11
0
        private void displayAllVehiclesLicenseNumber()
        {
            bool isStatusNeeded = false;

            Console.WriteLine("Would you like to filter the vehicles by their status ? - true/false");
            isStatusNeeded = ValidationOfData.GetBoolFromUser();
            if (isStatusNeeded)
            {
                Console.WriteLine("Please enter the Vehicles status you would like to watch - InProgress(1)/Fixed(2)/Paid(3):");
                eVehicleStatusInGarage statusToSearch = ValidationOfData.GetStatusOnGarage();
                displayByStatus(statusToSearch);
            }
            else
            {
                displayAllVehicles();
            }
        }
Ejemplo n.º 12
0
 public GarageVehicle(Vehicle i_Vehicle)
 {
     m_Vehicle = i_Vehicle;
     m_VehicleStatusInGarage = eVehicleStatusInGarage.InRepair;
 }
Ejemplo n.º 13
0
 public void ChangeCarStatus(eVehicleStatusInGarage i_NewStatusFromUser)
 {
     m_StatusOfVehicle = i_NewStatusFromUser;
 }
Ejemplo n.º 14
0
 public void ChangeStatusOfVehicle(eVehicleStatusInGarage i_Status)
 {
     m_CarStatus = i_Status;
 }
Ejemplo n.º 15
0
 public void AddVehicleToGarage(Vehicle i_VehicleFromUI, string i_OwnersNameFromUI, long i_OwnersPhoneFromUI, eVehicleStatusInGarage i_StatusOfVehicleFromUI)
 {
     m_AllVehicleInGarage.Add(i_VehicleFromUI.VehicleLicensenumber, new GarageVehicle(i_VehicleFromUI, i_OwnersNameFromUI, i_OwnersPhoneFromUI, i_StatusOfVehicleFromUI));
 }