Example #1
0
    private static void insertVehicleToGarage(string existingVehicleNumber, Ex03.GarageLogic.GarageManager i_GarageManager)
    {
        Ex03.GarageLogic.VehicleGenerator.eVehicleToGenerate vehicleToGenerateType;
        string validVehicleNumber             = auxGetValidVehicleNumber();
        bool   isVehicleAlreadyExistsInGarage = i_GarageManager.IsVehicleExistsInGarage(validVehicleNumber);

        if (!isVehicleAlreadyExistsInGarage)
        {
            string vehicleOwnerName, vehicleOwnerPhoneNumber;
            auxGetValidVehicleOwnerAndHisPhoneNumber(out vehicleOwnerName, out vehicleOwnerPhoneNumber);
            List <string> vehicleToInsertData = auxGetDataOfVehicleToInsert(out vehicleToGenerateType);
            vehicleToInsertData.Insert(0, validVehicleNumber);
            Ex03.GarageLogic.Vehicle vehicleToInsert = Ex03.GarageLogic.VehicleGenerator.GenerateNewVehicle(vehicleToGenerateType, vehicleToInsertData);
            i_GarageManager.InsertVehicleToGarage(vehicleToInsert, vehicleOwnerName, vehicleOwnerPhoneNumber);
            System.Console.WriteLine(Environment.NewLine + "The vehicle was successfuly added to the garage..." + Environment.NewLine);
        }
        else
        {
            i_GarageManager.GetVehicleInTreatmentDetailsByExistingVehicleNumber(existingVehicleNumber).VehicleInTreatmentStatus = Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus.InRepair;
            System.Console.WriteLine("Vehicle already exists in garage, status was changed to 'In Repair'");
        }
    }
Example #2
0
        public bool InsertNewVehicleToGarage(eTypeOfVehicle i_VehicleType, string i_LicenseNumber)
        {
            bool flag = false;

            try
            {
                m_Vehicle = searchVehicleByLicenseNumber(i_LicenseNumber);
                UpdateStatusOfVehicle(m_Vehicle.VehicleLicenseNumber, eVehicleGarageStatus.InRepair);
            }
            catch (Exception)
            {
                m_Vehicle = CreateVehicles.CreateNewVehicle(i_VehicleType);
                m_Vehicle.VehicleLicenseNumber = i_LicenseNumber;
                VehicleCollection.Add(m_Vehicle);
                flag = true;
            }

            return flag;
        }
Example #3
0
 public string DisplayVehicleDetailes(string i_VehicleLicenseNumber)
 {
     m_Vehicle = searchVehicleByLicenseNumber(i_VehicleLicenseNumber);
     return m_Vehicle.ToString();
 }
Example #4
0
 internal Customer(string i_Name, string i_PhoneNumber, eServiceStatuses i_VehicleStatus, Vehicle i_Vehicle)
 {
     r_Name          = i_Name;
     r_PhoneNumber   = i_PhoneNumber;
     m_VehicleStatus = i_VehicleStatus;
     r_Vehicle       = i_Vehicle;
 }