public static void Main() { GarageUI m_GarageUI = new GarageUI(); m_GarageUI.StartGarage(); Console.WriteLine("my change"); }
public static void Main(string[] args) { GarageUI garageUI = new GarageUI(); garageUI.BeginGarageUI(); Console.ReadKey(); }
public static void Main() { // Starts the Garage App GarageUI garage = new GarageUI(); Console.ReadLine(); }
public static void ChargeYourVehicle(Garage i_MyGarage) { string licenseNum = GarageUI.AskForLicenseNum(); Console.WriteLine("How many minutes do you want to charge"); int amountToCharge = GarageUI.AskForAmount(); try { bool tryToCharge = i_MyGarage.ChargeTheVehicle(licenseNum, amountToCharge); Console.WriteLine("Charge success\n"); } catch (ArgumentNullException ane) { Console.WriteLine(ane.Message + "Charge faild \n"); } catch (ValueOutOfRangeException vore) { Console.WriteLine(vore.Message + "Charge faild \n"); } catch (ArgumentException ae) { Console.WriteLine(ae.Message + "Charge faild \n"); } }
internal static void AddVehicleToTheGarage(eVehicleTypes i_VeicleToTheGarage) { bool isValid = false; string ownerName; string ownerPhoneNumber; GarageUI.GetVehicleOwnerDetails(out ownerName, out ownerPhoneNumber); Vehicle currentVehicleToAdd = VehicleCreation.CreateVehicle(i_VeicleToTheGarage); Dictionary <string, string> vehicleDetails = currentVehicleToAdd.CreateVehicleDetailsDict(); vehicleDetails = currentVehicleToAdd.EngineOfVehicle.AddEngineDetailsToDict(vehicleDetails); while (!isValid) { vehicleDetails = GarageUI.GetVehicleDetailsFromUser(vehicleDetails, currentVehicleToAdd); try { currentVehicleToAdd.AddVehicleInformation(vehicleDetails); currentVehicleToAdd.EngineOfVehicle.AddEngineInformation(vehicleDetails); isValid = true; } catch (Exception exception) { Console.WriteLine(exception.Message); } } VehicleInGarage newVehicleIntheGarage = new VehicleInGarage(currentVehicleToAdd, ownerName, ownerPhoneNumber); ListVehiclesInGarage.Add(currentVehicleToAdd.LicenseNumber, newVehicleIntheGarage); }
public static void Main() { GarageUI garage = new GarageUI(); garage.RunGarage(); Console.WriteLine("Press 'enter' to exit"); Console.ReadLine(); }
public void AddNewVehicleGarage(Vehicles i_Vehicle) { string name = GarageUI.GetName(); string phoneNumber = GarageUI.GetPhoneNumber(); VehiclesGarage newVehicleGarage = new VehiclesGarage(name, phoneNumber, i_Vehicle); garage.m_VehiclesGarage.Add(newVehicleGarage); }
public static void SetLicenseType(Vehicles io_Vehicle) { Utils.LicenseTypes LicenseType; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo propertyInfo = vehicleType.GetProperty("LicenseType"); if (propertyInfo != null) { LicenseType = GarageUI.GetLicenseType(); propertyInfo.SetValue(io_Vehicle, LicenseType, null); } }
public static void SetDoor(Vehicles io_Vehicle) { Utils.DoorNumbers door; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo doorPropertyInfo = vehicleType.GetProperty("DoorNumber"); if (doorPropertyInfo != null) { door = GarageUI.GetDoor(); doorPropertyInfo.SetValue(io_Vehicle, door, null); } }
public static void SetColor(Vehicles io_Vehicle) { Utils.ColorCars color; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo colorPropertyInfo = vehicleType.GetProperty("ColorCar"); if (colorPropertyInfo != null) { color = GarageUI.GetColor(); colorPropertyInfo.SetValue(io_Vehicle, color, null); } }
public void StartMenuGarage() { string numOfOption; bool exit = false; while (!exit) { numOfOption = GarageUI.MenuGarage(); switch (numOfOption) { case "1": GarageUI.Clear(); EnterNewVehicle(); break; case "2": GarageUI.Clear(); ShowListVehicles(); break; case "3": GarageUI.Clear(); ChangeStatus(); break; case "4": GarageUI.Clear(); BlowingWheelsToTheMaximum(); break; case "5": GarageUI.Clear(); FuelingVehicle(); break; case "6": GarageUI.Clear(); VehicleLoading(); break; case "7": GarageUI.Clear(); ShowVehicleGarageDetails(); break; case "8": exit = true; break; } GarageUI.Clear(); } }
public static void SetEngineCapacity(Vehicles io_Vehicle) { int engineCapacity; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo propertyInfo = vehicleType.GetProperty("EngineCapacity"); if (propertyInfo != null) { engineCapacity = GarageUI.GetEngineCapacity(); propertyInfo.SetValue(io_Vehicle, engineCapacity, null); } }
public static void SetVolumeOfCargo(Vehicles io_Vehicle) { float volumeOfCargo; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo propertyInfo = vehicleType.GetProperty("VolumeOfCargo"); if (propertyInfo != null) { volumeOfCargo = GarageUI.GetVolumeOfCargo(); propertyInfo.SetValue(io_Vehicle, volumeOfCargo, null); } }
public static void SetHaveHazardousMaterials(Vehicles io_Vehicle) { bool haveHazardousMaterials; System.Type vehicleType = io_Vehicle.GetType(); PropertyInfo propertyInfo = vehicleType.GetProperty("HaveHazardousMaterials"); if (propertyInfo != null) { haveHazardousMaterials = GarageUI.GetHaveHazardousMaterials(); propertyInfo.SetValue(io_Vehicle, haveHazardousMaterials, null); } }
public void ShowListVehicles() { string getOption; garage.m_VehiclesGarage = garage.VehiclesInGarages(); GarageUI.PrintVehicles(garage.m_VehiclesGarage); getOption = GarageUI.OptionPrint(); if (getOption == "1") { garage.m_VehiclesGarage = garage.VehiclesInGaragesStatus(); GarageUI.PrintVehicles(garage.m_VehiclesGarage); } string toContinue = GarageUI.MesegeToContinue(); }
public void EnterNewVehicle() { bool isExists = false; string licenseNumber = GarageUI.GetLicenseNumber(); isExists = garage.HaveVehicleInGarage(licenseNumber); if (!isExists) { AddNewVehicle(licenseNumber); } else { GarageUI.MesegeChangeStatus(); } }
public void BlowingWheelsToTheMaximum() { string licenseNumber = GarageUI.GetLicenseNumber(); bool isSucceed = garage.BlowingWheelsToTheMaximum(licenseNumber); if (!isSucceed) { GarageUI.NotHaveVehicleInGarage(); } else { GarageUI.MesegeSucceeded(); } GarageUI.MesegeToContinue(); }
public static void GetVehicleInformation(Garage i_MyGarage) { string licenseNumber = GarageUI.AskForLicenseNum(); string vehicleInformation = string.Empty; try { vehicleInformation = i_MyGarage.GetVehicleInformation(licenseNumber); Console.WriteLine(vehicleInformation); } catch (ArgumentNullException ane) { Console.WriteLine(ane.Message); } }
public void ChangeStatus() { string licenseNumber = GarageUI.GetLicenseNumber(); if (licenseNumber != null) { Utils.VehicleStatus status = GarageUI.GetStatus(); garage.ChangeStatus(licenseNumber, status); GarageUI.MesegeSucceeded(); } else { GarageUI.NotHaveVehicleInGarage(); } GarageUI.MesegeToContinue(); }
public static void FuelVehical(Garage i_MyGarage) { string userAnswer = string.Empty; string licenseNum = GarageUI.AskForLicenseNum(); bool validFuel = !true; eFuel fuelType = 0; Console.WriteLine("Please enter fuel type <Octan98, Octan96, Octan95, Soler>"); while (!validFuel) { try { validFuel = true; userAnswer = Console.ReadLine(); fuelType = UIValidation.FuelTypeValidation(userAnswer); } catch (FormatException fe) { Console.WriteLine(fe.Message + "Wrong choise, please select fuel type <Octan98, Octan96, Octan95, Soler> "); validFuel = !true; } } int fuelAmount = 0; Console.WriteLine("Please enter fuel amount"); fuelAmount = GarageUI.AskForAmount(); try { bool fuelSucceses = i_MyGarage.FuelingVehicle(licenseNum, fuelType, fuelAmount); Console.WriteLine("Fuel success \n"); } catch (ArgumentNullException ane) { Console.WriteLine("The car is not in the garage \n"); } catch (ArgumentException ax) { Console.WriteLine(ax.Message + " Fuel faild"); } catch (ValueOutOfRangeException vor) { Console.WriteLine(vor.Message + " Fuel faild"); } }
public void ShowVehicleGarageDetails() { string licenseNumber; List <string> vehicle = new List <string>();; licenseNumber = GarageUI.GetLicenseNumber(); vehicle = garage.GetVehicleGarageDetails(licenseNumber); if (vehicle != null) { GarageUI.PrintVehicleDetails(vehicle); } else { GarageUI.NotHaveVehicleInGarage(); } GarageUI.MesegeToContinue(); }
public void AddNewVehicle(string i_LicenseNumber) { Ex03.GarageLogic.Builder.VehicleTypes type = GarageUI.GetVehicleType(); string modelName = GarageUI.GetModelName(); float reamainingEnergy = GarageUI.GetReamainingEnergy(); string manufacturerName = GarageUI.GetManufacturerName(); float currentAirPressure = GarageUI.GetCurrentAirPressure(); Vehicles newVehicle; newVehicle = builder.CreatVehicle(modelName, i_LicenseNumber, type, reamainingEnergy, manufacturerName, currentAirPressure); GarageUI.SetColor(newVehicle); GarageUI.SetDoor(newVehicle); GarageUI.SetHaveHazardousMaterials(newVehicle); GarageUI.SetVolumeOfCargo(newVehicle); GarageUI.SetLicenseType(newVehicle); GarageUI.SetEngineCapacity(newVehicle); AddNewVehicleGarage(newVehicle); }
public static void Main() { try { GarageUI garageUI = new GarageUI(); } catch (ArgumentException ax) { Console.WriteLine(ax.Message); } catch (ValueOutOfRangeException vr) { Console.WriteLine(vr.Message); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void VehicleLoading() { string licenseNumber = GarageUI.GetLicenseNumber(); if (licenseNumber != null) { float addCharging = GarageUI.GetAmountElectric(); try { garage.VehicleLoading(licenseNumber, addCharging); GarageUI.MesegeSucceeded(); } catch (ValueOutOfRangeException) { GarageUI.MesegeError(); } } else { GarageUI.NotHaveVehicleInGarage(); } GarageUI.MesegeToContinue(); }
public void FuelingVehicle() { string licenseNumber = GarageUI.GetLicenseNumber(); if (licenseNumber != null) { Utils.FuelTypes typeFuel = GarageUI.GetTypeFuel(); float addFuel = GarageUI.GetAmountFuel(); try { garage.FuelingVehicle(licenseNumber, typeFuel, addFuel); GarageUI.MesegeSucceeded(); } catch (ValueOutOfRangeException) { GarageUI.MesegeError(); } } else { GarageUI.NotHaveVehicleInGarage(); } GarageUI.MesegeToContinue(); }
public static void Main() { GarageUI uI = new GarageUI(); uI.ManageGarage(); }
// $G$ CSS-999 (-4) The method must have an access modifier. static void Main(string[] args) { GarageUI garage = new GarageUI(); garage.GargeOpen(); }
public static void Main() { GarageUI m_GarageUI = new GarageUI(); m_GarageUI.StartGarage(); }
public static void Main() { GarageUI garage = new GarageUI(); garage.MainMenu(); // Activate the garage program }
public static void Main() { GarageUI garageUi = new GarageUI(); garageUi.Run(); }