public static void AddNewListVehicle() { Vehicle vehicle = new Vehicle(); ManagmentApp.ShowMessage("Enter Id"); vehicle.Id = InputVerificationID.EnterIdVehicle(); while (ShowVehicle.Vehicles.Exists(veh => veh.Id == vehicle.Id)) { ManagmentApp.ShowMessage("Enter new ID"); vehicle.Id = InputVerificationID.EnterIdVehicle(); } ChoiseTypeAndBrand.TypeOfVehicles(vehicle); ShowVehicle.InformationVehicle(vehicle); ShowVehicle.Vehicles.Add(new Vehicle(vehicle.Id, vehicle.BrandVehicle, vehicle.TypeVehicle, vehicle.RentalPrice)); EventLogWorking.message = $"Add new vehicle. Vehicle ID: {vehicle.Id}, " + $"brand vehicle: { vehicle.BrandVehicle}, " + $"renta price for vehicle: { vehicle.RentalPrice}$ per 10 minutes"; vehicle.WriteToEventLog += EventLogWorking.InformationEventLog; vehicle.ShowMessage += ShowVehicle.WriteToFile; vehicle.Message(); }
public static BrandVehicles ChoiseBusBrandse(Vehicle vehicle) { ManagmentApp.ShowMessage("Choise brand bus: 1 - Ikarus, 2 - Iveco, 3 - MCV, 4 - Otokar"); int choiseBrand = ChoiseTypeAndBrand.ChoiseType(); switch (choiseBrand) { case 1: vehicle.BrandVehicle = BrandVehicles.Ikarus; vehicle.RentalPrice = DataRentalPrice.IkarusRentalPrice; break; case 2: vehicle.BrandVehicle = BrandVehicles.Iveco; vehicle.RentalPrice = DataRentalPrice.IvecoRentalPrice; break; case 3: vehicle.BrandVehicle = BrandVehicles.MCV; vehicle.RentalPrice = DataRentalPrice.MCVRentalPrice; break; case 4: vehicle.BrandVehicle = BrandVehicles.Otokar; vehicle.RentalPrice = DataRentalPrice.OtokarRentalPrice; break; } while (vehicle.BrandVehicle == 0) { ChoiseBusBrandse(vehicle); } return(vehicle.BrandVehicle); }
public static BrandVehicles ChoiseMotorcycleBrandse(Vehicle vehicle) { ManagmentApp.ShowMessage("Choise brand motorcycle : 1 - BMW, 2 - Yamaha, 3 - Kawasaki, 4 - Ducati"); int choiseBrand = ChoiseTypeAndBrand.ChoiseType(); switch (choiseBrand) { case 1: vehicle.BrandVehicle = BrandVehicles.BMW; vehicle.RentalPrice = DataRentalPrice.BMWRentalPrice; break; case 2: vehicle.BrandVehicle = BrandVehicles.Yamaha; vehicle.RentalPrice = DataRentalPrice.YamahaRentalPrice; break; case 3: vehicle.BrandVehicle = BrandVehicles.Kawasaki; vehicle.RentalPrice = DataRentalPrice.KawasakiRentalPrice; break; case 4: vehicle.BrandVehicle = BrandVehicles.Ducati; vehicle.RentalPrice = DataRentalPrice.DucatiRentalPrice; break; } while (vehicle.BrandVehicle == 0) { ChoiseMotorcycleBrandse(vehicle); } return(vehicle.BrandVehicle); }
public static BrandVehicles ChoiseTruckBrandse(Vehicle vehicle) { ManagmentApp.ShowMessage("Choise brand truck : 1 - Otokar, 2 - Ural, 3 - MAZ, 4 - Magirus"); int choiseBrand = ChoiseTypeAndBrand.ChoiseType(); switch (choiseBrand) { case 1: vehicle.BrandVehicle = BrandVehicles.Otokar; vehicle.RentalPrice = DataRentalPrice.OtokarRentalPrice; break; case 2: vehicle.BrandVehicle = BrandVehicles.Ural; vehicle.RentalPrice = DataRentalPrice.UralRentalPrice; break; case 3: vehicle.BrandVehicle = BrandVehicles.MAZ; vehicle.RentalPrice = DataRentalPrice.MAZRentalPrice; break; case 4: vehicle.BrandVehicle = BrandVehicles.Magirus; vehicle.RentalPrice = DataRentalPrice.MagirusRentalPrice; break; } while (vehicle.BrandVehicle == 0) { ChoiseTruckBrandse(vehicle); } return(vehicle.BrandVehicle); }
public static BrandVehicles ChoiseCarMake(Vehicle vehicle) { ManagmentApp.ShowMessage("Choise brand car: 1 - Audi, 2 - Cadillac, 3 - Honda, 4 - Nissan, 5 - Peugeot"); int choiseBrand = ChoiseTypeAndBrand.ChoiseType(); switch (choiseBrand) { case 1: vehicle.BrandVehicle = BrandVehicles.Audi; vehicle.RentalPrice = DataRentalPrice.AudiRentalPrice; break; case 2: vehicle.BrandVehicle = BrandVehicles.Cadillac; vehicle.RentalPrice = DataRentalPrice.CadillacRentalPrice; break; case 3: vehicle.BrandVehicle = BrandVehicles.Honda; vehicle.RentalPrice = DataRentalPrice.HondaRentalPrice; break; case 4: vehicle.BrandVehicle = BrandVehicles.Nissan; vehicle.RentalPrice = DataRentalPrice.NissanRentalPrice; break; case 5: vehicle.BrandVehicle = BrandVehicles.Peugeot; vehicle.RentalPrice = DataRentalPrice.PeugeotRentalPrice; break; } while (vehicle.BrandVehicle == 0) { ChoiseCarMake(vehicle); } return(vehicle.BrandVehicle); }