Example #1
0
        public void AddVehicleRecord(string i_LicenseNumber, string i_VehicleOwnerName, string i_VehicleOwnerPhoneNum, Dictionary <string, string> i_FieldsToFill, string i_VehicleType)
        {
            Vehicle        vehicle        = VehicleFactory.CreateVehicle(i_FieldsToFill, i_VehicleType, i_LicenseNumber);
            VechicleRecord vechicleRecord = new VechicleRecord(i_VehicleOwnerName, i_VehicleOwnerPhoneNum, eVehicleStatus.Repair, vehicle);

            m_VechicleRecords.Add(i_LicenseNumber, vechicleRecord);
        }
Example #2
0
        private void createNewVehicleByType(int i_Choice)
        {
            Vehicle newVehicle = VehicleFactory.CreateNewVehicleByType(i_Choice);

            switch ((Utilities.eVehicleType)i_Choice)
            {
            case Utilities.eVehicleType.Motorcycle:
                setMotorcycleInfo(newVehicle);
                break;

            case Utilities.eVehicleType.ElectricMotorcycle:
                setMotorcycleInfo(newVehicle);
                break;

            case Utilities.eVehicleType.Car:
                setCarInformation(newVehicle);
                break;

            case Utilities.eVehicleType.ElectricCar:
                setCarInformation(newVehicle);
                break;

            default:
                setTruckInfo(newVehicle);
                break;
            }

            setGeneralInfoVehicle(newVehicle);
            addToDataBase(newVehicle);
        }
Example #3
0
        public void InsertNewVehicle(eVehicleType i_VehicleType, Dictionary <string, string> i_Properties, Customer i_Customer, string i_LicenseNumber)
        {
            Vehicle vehicle = VehicleFactory.CreateVehicle(i_VehicleType, i_Properties);

            vehicle.VehicleType = i_VehicleType;
            i_Customer.Vehicle  = vehicle;
            i_Customer.Vehicle.LicenseNumber = i_LicenseNumber;
        }
Example #4
0
        public void AddVehicleToGarage(ArgumentsCollection i_Arguments, string i_VehicleTypeString, string i_OwnerName, string i_OwnerPhoneNumber)
        {
            eSupportedVehicles vehicleType = parseVehicleTypeFromString(i_VehicleTypeString);
            Vehicle            newVehicle  = VehicleFactory.BuildVehicle(vehicleType, i_Arguments);

            r_VehicleInventory.Add(newVehicle.LicensePlateNumber, newVehicle);
            AddTicket(newVehicle.LicensePlateNumber, new GarageTicket(i_OwnerName, i_OwnerPhoneNumber, newVehicle.LicensePlateNumber));
        }
Example #5
0
        public static void AddNewGarageEntry(eVehicleType i_VehicleType, string i_ModelName, string i_LicenceNumber, string i_WheelManfucaturerName, string i_OwnerName, string i_OwnerPhoneNum, Dictionary <string, string> uniqueVehicleProperties)
        {
            Vehicle vehicleToAdd = VehicleFactory.CreateVehicle((int)i_VehicleType, i_ModelName, i_LicenceNumber);

            vehicleToAdd.SetVehicleWheels(i_WheelManfucaturerName);
            vehicleToAdd.InitUniqueVehicleProperties(uniqueVehicleProperties);

            CustomerData vehicleCustomerData = new CustomerData(i_OwnerName, i_OwnerPhoneNum);

            vehicleCustomerData.VehicleStatus = eVehicleStatus.InRepair;

            s_GarageEntries.Add(vehicleToAdd, vehicleCustomerData);
        }
        public ComposedVehicle CreateTruck(
            eValidVehicle i_eValidVehicle,
            string i_OwnerName,
            string i_OwnerPhoneNumber,
            string i_LicenseNumber,
            string i_ModelName,
            string i_WheelManufacturer,
            float i_WheelPressure,
            float i_CurrentPower,
            float i_TruckCapacity,
            bool i_IsCooled)
        {
            Vehicle         vehicle         = VehicleFactory.CreateTruck(i_ModelName, i_LicenseNumber, i_WheelManufacturer, i_WheelPressure, i_CurrentPower, i_TruckCapacity, i_IsCooled);
            ComposedVehicle composedVehicle = new ComposedVehicle(vehicle, i_OwnerName, i_OwnerPhoneNumber);

            return(composedVehicle);
        }
Example #7
0
        public bool AddVehicleToGarage(string i_OwnerName, string i_OwnerPhone, eVehicleTypes i_Identifier, List <object> i_ParametersToCreateVehicle, Wheel[] i_Wheels)
        {
            bool    vehicleAlreadyInGarage = false;
            Owner   vehicleOwner           = new Owner(i_OwnerName, i_OwnerPhone);
            Vehicle vehicleToAdd           = VehicleFactory.Create(i_Identifier, i_ParametersToCreateVehicle, i_Wheels);

            if (m_VehiclesInGarage.ContainsKey(vehicleToAdd.LicenseNumber))
            {
                m_VehiclesInGarage[vehicleToAdd.LicenseNumber].VehicleState = eVehicleConditions.InRepair;
                vehicleAlreadyInGarage = true;
            }
            else
            {
                m_VehiclesInGarage.Add(vehicleToAdd.LicenseNumber, new VehicleInGarage(vehicleToAdd, vehicleOwner));
            }

            return(vehicleAlreadyInGarage);
        }
Example #8
0
        public List <Questioning> GetInfoToFill(eVehicleType i_VehicleType, string i_licence)
        {
            List <Questioning> questionings = new List <Questioning>();

            if (!m_TreatedVehicles.ContainsKey(i_licence))
            {
                Vehicle newVehicle = VehicleFactory.CreateVehicle(i_VehicleType, i_licence);
                m_TreatedVehicles.Add(i_licence, newVehicle);
                questionings = newVehicle.Questionings;
            }
            else
            {
                throw new Exception("Vehicle with licence plate " + i_licence +
                                    " already exists.\n" +
                                    "Vehicle status will change to 'in treatment'.");
            }

            return(questionings);
        }
        public ComposedVehicle CreateMotorcycle(
            eValidVehicle i_eValidVehicle,
            string i_OwnerName,
            string i_OwnerPhoneNumber,
            string i_LicenseNumber,
            string i_ModelName,
            string i_WheelManufacturer,
            float i_WheelPressure,
            float i_CurrentPower,
            eLicencseType i_eLicenseType,
            int i_EngineCapacity)
        {
            Vehicle         vehicle;
            ComposedVehicle composedVehicle;

            if (i_eValidVehicle == eValidVehicle.RegMotorCycle)
            {
                vehicle = VehicleFactory.CreateMotorcycle(
                    i_ModelName,
                    i_LicenseNumber,
                    i_WheelManufacturer,
                    i_WheelPressure,
                    i_CurrentPower,
                    i_eLicenseType,
                    i_EngineCapacity);
            }
            else
            {
                vehicle = VehicleFactory.CreateElectricMotorcycle(
                    i_ModelName,
                    i_LicenseNumber,
                    i_WheelManufacturer,
                    i_WheelPressure,
                    i_CurrentPower,
                    i_eLicenseType,
                    i_EngineCapacity);
            }

            composedVehicle = new ComposedVehicle(vehicle, i_OwnerName, i_OwnerPhoneNumber);

            return(composedVehicle);
        }
        public ComposedVehicle CreateAutomobile(
            eValidVehicle i_eValidVehicle,
            string i_OwnerName,
            string i_OwnerPhoneNumber,
            string i_LicenseNumber,
            string i_ModelName,
            string i_WheelManufacturer,
            float i_WheelPressure,
            float i_CurrentPower,
            eColor i_eColor,
            eNumOfDoors i_eNumOfDoors)
        {
            Vehicle         vehicle;
            ComposedVehicle composedVehicle;

            if (i_eValidVehicle == eValidVehicle.RegCar)
            {
                vehicle = VehicleFactory.CreateAutomobile(
                    i_ModelName,
                    i_LicenseNumber,
                    i_WheelManufacturer,
                    i_WheelPressure,
                    i_CurrentPower,
                    i_eColor,
                    i_eNumOfDoors);
            }
            else
            {
                vehicle = VehicleFactory.CreateElectricAutomobile(
                    i_ModelName,
                    i_LicenseNumber,
                    i_WheelManufacturer,
                    i_WheelPressure,
                    i_CurrentPower,
                    i_eColor,
                    i_eNumOfDoors);
            }

            composedVehicle = new ComposedVehicle(vehicle, i_OwnerName, i_OwnerPhoneNumber);

            return(composedVehicle);
        }
Example #11
0
 public GarageManager()
 {
     r_ClientList     = new Dictionary <string, ClientData>();
     m_vehicleCreator = new VehicleFactory();
 }
Example #12
0
 public Garage()
 {
     m_Vehicls = new Dictionary <string, GarageClient>();
     r_Factory = new VehicleFactory();
 }
Example #13
0
 public List <string> GetFieldsByVehicleType(string i_VehicleType)
 {
     return(VehicleFactory.GetFieldsToFill(i_VehicleType));
 }
Example #14
0
 public List <String> GetSupportedVehiclesList()
 {
     return(VehicleFactory.GetVehicleType());
 }
Example #15
0
        public ArgumentsCollection GetArgumentsByVehicleType(string i_VehicleTypeSting)
        {
            eSupportedVehicles vehicleType = parseVehicleTypeFromString(i_VehicleTypeSting);

            return(VehicleFactory.GetArgumentsByVehicleType(vehicleType));
        }
Example #16
0
 public Dictionary <string, List <string> > GetPropertiesForNewVehicle(eVehicleType i_VehicleType)
 {
     return(VehicleFactory.GetVehicleProperties(i_VehicleType));
 }
Example #17
0
 public Vehicle CallCreateVehicle(GarageManager.eSupportedVehciles i_SupportedVehicle, object[] i_InputParameters)
 {
     return(VehicleFactory.CreateVehicle(i_SupportedVehicle, i_InputParameters, this.m_CurrentVehicleConstruction));
 }
Example #18
0
 public Garage()
 {
     m_Vehicles = new Dictionary <string, Record>();
     m_Factory  = new VehicleFactory();
 }
Example #19
0
 public Garage()
 {
     m_Vehicles = new Dictionary <string, VehicleTicket>();
     m_Factory  = new VehicleFactory();
 }