コード例 #1
0
ファイル: Customer.cs プロジェクト: AdiBenoz/CSharp_projects
 internal Customer(string i_CustomerName, string i_CustomerPhoneNumber, Vehicle i_Vehicle)
 {
     m_CostumerName         = i_CustomerName;
     m_CustomerPhoneNumber  = i_CustomerPhoneNumber;
     r_CustomerVehicle      = i_Vehicle;
     m_CurrentVehicleStatus = eVehicleGarageStatus.InRepair;
 }
コード例 #2
0
 public CustomerData(string i_customerNamer, string i_phoneNumber, Vehicle i_CustomerVehicle)
 {
     m_CustomerName         = i_customerNamer;
     m_PhoneNumber          = i_phoneNumber;
     m_CustomerVehicle      = i_CustomerVehicle;
     m_CurrentVehicleStatus = eVehicleGarageStatus.InRepair;
 }
コード例 #3
0
 public Vehicle()
 {
     m_ModelName           = string.Empty;
     m_LicenseNumber       = string.Empty;
     m_EnergyPercentage    = 0;
     m_Wheels              = new List <Wheel>();
     m_EnergySource        = null;
     m_VehicleGarageStatus = eVehicleGarageStatus.InRepair;
 }
コード例 #4
0
ファイル: GarageManager.cs プロジェクト: ShirlyEzer/portfolio
        public List<string> GetVehicleLicenseNumbersInGarageFilteredByStatus(eVehicleGarageStatus i_VehicleGarageStatus)
        {
            List<string> vehicleLicenseNumbersCollection = new List<string>(0);

            foreach (Vehicle vehicle in VehicleCollection)
            {
                if (vehicle.VehicleInformation.VehicleGarageStatus == i_VehicleGarageStatus)
                {
                    vehicleLicenseNumbersCollection.Add(vehicle.VehicleLicenseNumber);
                }
            }

            if (vehicleLicenseNumbersCollection.Count == 0)
            {
                throw new Exception("Does not exist any vehicle in status " + i_VehicleGarageStatus.ToString());
            }

            return vehicleLicenseNumbersCollection;
        }
コード例 #5
0
ファイル: GarageManager.cs プロジェクト: ShirlyEzer/portfolio
        public void UpdateStatusOfVehicle(string i_VehicleLicenseNumber, eVehicleGarageStatus i_VehicleGarageStatus)
        {
            Vehicle vehicleStatusUpdate = null;

            vehicleStatusUpdate = searchVehicleByLicenseNumber(i_VehicleLicenseNumber);
            vehicleStatusUpdate.VehicleInformation.VehicleGarageStatus = i_VehicleGarageStatus;
        }
コード例 #6
0
ファイル: GarageManager.cs プロジェクト: ShirlyEzer/portfolio
 public void SetVehicleGeneralInformation(string i_VehicleOwnerName, string i_VehicleOwnerPhone, eVehicleGarageStatus i_GarageStatus)
 {
     m_Vehicle.VehicleInformation.VehicleGarageStatus = i_GarageStatus;
     m_Vehicle.VehicleInformation.VehicleOwnerName = i_VehicleOwnerName;
     m_Vehicle.VehicleInformation.VehicleOwnerPhone = i_VehicleOwnerPhone;
 }
コード例 #7
0
 /**
  * Constructor method
  * Initializes the vehicles repair status as " in repair"
  */
 protected Vehicle()
 {
     this.m_VehicleGarageStatus = eVehicleGarageStatus.InRepair;
 }
コード例 #8
0
ファイル: GarageUI.cs プロジェクト: ShirlyEzer/portfolio
        private void getVehicleGarageStatus()
        {
            bool isValidVehicleStatus = true;

            do
            {
                try
                {
                    m_VehicleGarageStatus = (eVehicleGarageStatus)parseEnumUserInput(
            @"Please enter the new vehicle garage status by choosing a number from the menu:
            1. InRepair
            2. Repaired
            3. Paid",
            typeof(eVehicleGarageStatus));

                    isValidVehicleStatus = Enum.IsDefined(typeof(eVehicleGarageStatus), m_VehicleGarageStatus);
                    if (!isValidVehicleStatus)
                    {
                        Console.WriteLine("Invalid vehicle type input");
                    }
                }
                catch (ArgumentException ex)
                {
                    isValidVehicleStatus = false;
                    Console.WriteLine(ex.Message);
                }
                catch (Exception ex)
                {
                    isValidVehicleStatus = false;
                    Console.WriteLine(ex.Message);
                }
            }
            while (!isValidVehicleStatus);
        }