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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
        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 TypeVichle TypeOfVehicles(Vehicle vehicle)
        {
            ManagmentApp.ShowMessage("Choise type vehicle: 1 - Motorcecles, 2 - PassengerCars, 3 - Buses, 4 - Trucks");
            int typeCar = ChoiseType();

            switch (typeCar)
            {
            case 1:
                vehicle.TypeVehicle = TypeVichle.Motorcecles;
                Motorcecles.ChoiseMotorcycleBrandse(vehicle);
                break;

            case 2:
                vehicle.TypeVehicle = TypeVichle.PassengerCars;
                PassengerCars.ChoiseCarMake(vehicle);
                break;

            case 3:
                vehicle.TypeVehicle = TypeVichle.Buses;
                Buses.ChoiseBusBrandse(vehicle);
                break;

            case 4:
                vehicle.TypeVehicle = TypeVichle.Trucks;
                Trucks.ChoiseTruckBrandse(vehicle);
                break;
            }
            while (vehicle.TypeVehicle == 0)
            {
                TypeOfVehicles(vehicle);
            }
            return(vehicle.TypeVehicle);
        }
Esempio n. 6
0
 public static void InformationVehicle(Vehicle vehicle)
 {
     ManagmentApp.ShowMessage(
         $"Vehicle ID: {vehicle.Id}",
         $"Type car: {vehicle.TypeVehicle}",
         $"Brand {vehicle.TypeVehicle}: {vehicle.BrandVehicle}",
         $"Renta price {vehicle.BrandVehicle}: {vehicle.RentalPrice}$ per 10 minutes");
 }
        public static void ChoosingCarForRent()
        {
            ManagmentApp.ShowMessage("\nEnter ID vehicle do you want rent:");
            int Id      = InputVerificationID.NoVehiclesWithId();
            var vehicle = ShowVehicle.Vehicles.SingleOrDefault(r => r.Id == Id);

            ManagmentApp.ShowErrorMsg($"Your vehicle that you rented.");

            ShowVehicle.Vehicles.Remove(vehicle);

            ShowVehicle.InformationVehicle(vehicle);
            EventLogWorking.message  = $" You rented {vehicle.TypeVehicle}, brand: {vehicle.BrandVehicle}, price {vehicle.RentalPrice}$ per 10 minutes.";
            vehicle.WriteToEventLog += EventLogWorking.InformationEventLog;
            vehicle.Message();
        }
Esempio n. 8
0
        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);
        }