public ServiceDetails(Vehicle i_Vehicle, string i_OwnerName, string i_OwnerPhoneNum) { m_OwnerName = i_OwnerName; m_OwnerPhoneNum = i_OwnerPhoneNum; m_Vehicle = i_Vehicle; m_CarStatus = eCarStatus.InService; }
public ClientTicket(Vehicle i_vehicle, string i_OwnerName, string i_OwnerPhoneNumber) { this.m_vehicle = i_vehicle; this.r_OwnerName = i_OwnerName; this.r_OwnerPhoneNumber = i_OwnerPhoneNumber; this.m_CarStatus = eCarStatus.InRepair; }
public VehicleAtTheGarage(string i_OwnerName, string i_PhoneNumber, Vehicle i_Vehicle) { m_ownerName = i_OwnerName; m_phoneNumber = i_PhoneNumber; m_carStatus = eCarStatus.InRepair; m_vehicle = i_Vehicle; }
public void CheckEqualStatus(eCarStatus userChoice) { if ((ServiceDetails.eCarStatus)userChoice == m_CarStatus) { throw new ArgumentException( string.Format( "The vehicle is already in {0} status", m_CarStatus)); } }
//this function showes how is in the garage with a status public string ShowCarsInGarageBystatus(eCarStatus i_StatusToShow) { StringBuilder CarsInGarage = new StringBuilder(); CarsInGarage.Append("The cars in the garage By status"); CarsInGarage.Append(Environment.NewLine); foreach (ClientTicket iterator in m_VehiclesDictionary.Values) { if (iterator.CarStatus == i_StatusToShow) { CarsInGarage.Append(iterator.VehicleLicenseNumber); CarsInGarage.Append(Environment.NewLine); } } return(CarsInGarage.ToString()); }
private void openListOfLicenseByStatus() { Console.WriteLine(@"Wich vehicals to display? (1) In Repair (2) Repaired (3) Payed (4) All"); eCarStatus DisplaySelection = (eCarStatus)int.Parse(getNumberInRange(1, 4, true)); if (DisplaySelection == eCarStatus.All) { Console.WriteLine(m_LogicManager.ShowCarsInGarage()); } else { Console.WriteLine(m_LogicManager.ShowCarsInGarageBystatus(DisplaySelection)); } Console.WriteLine("Thank you! press enetr to return main menu "); Console.ReadLine(); }
internal Vehicle(PowerSystem i_PowerSystem, string i_Model, string i_LicenseNumber, float i_EnergyPrecentege, int i_NumOfWheels, float[] i_WheelsAirPressure, float i_MaxAirPressure, string i_WheelsManufacturer, string i_OwnerPhoneNumber, string i_OwnerName) { m_PowerSystem = i_PowerSystem; m_EnergyPrecentege = i_EnergyPrecentege; m_LicenseNumber = i_LicenseNumber; m_Model = i_Model; m_OwnerPhoneNumber = i_OwnerPhoneNumber; m_OwnerName = i_OwnerName; m_CarStatus = eCarStatus.InRepair; m_Wheels = new Wheel[i_NumOfWheels]; for (int i = 0; i < i_NumOfWheels; i++) { m_Wheels[i] = new Wheel(i_WheelsAirPressure[i], i_MaxAirPressure, i_WheelsManufacturer); } }
private void changeVehicleStatus() { Console.WriteLine("Hello, please enter vehicle's License number in order to change the status:"); string VehicleLicense = getNotEmptyInput(); try { m_LogicManager.IsInGarage(VehicleLicense); Console.WriteLine(@"What this vehicle's new status? (1) In Repair (2) Repaired (3) Payed"); eCarStatus NewCarStatus = (eCarStatus)int.Parse(getNumberInRange(1, 3, true)); m_LogicManager.ChangeVehicleStatus(VehicleLicense, NewCarStatus); Console.WriteLine("status of {0} changed to {1} status!", VehicleLicense, NewCarStatus); Console.ReadLine(); } catch { Console.WriteLine("This vehicle License number not exsit in our garage, press enter for main menu"); Console.ReadLine(); } }
/** change customer's Vehicle status by license number and desired Vehicle status * if the Vehicle does not exist in the garage, return false **/ public void ChangeCarStatus(string i_LicenseNumber, eCarStatus i_VehicleStatus) { m_Customers[i_LicenseNumber].Status = i_VehicleStatus; }
public void ChangeVehicleStatus(string i_LicenseNumber, eCarStatus i_NewCarStatus) { m_VehiclesDictionary[i_LicenseNumber].CarStatus = i_NewCarStatus; }