Exemple #1
0
        public static int RemoveFromList()
        {
            ManagmentApp.ShowErrorMsg("Enter please ID vehicle that do you dismiss");
            int id = InputVerificationID.NoVehiclesWithId();

            var vehicle = ShowVehicle.Vehicles.SingleOrDefault(r => r.Id == id);

            if (vehicle != null)
            {
                ManagmentApp.ShowErrorMsg($"Vehicle delete with ID: {vehicle.Id}, Car make: {vehicle.BrandVehicle}, Type car: {vehicle.TypeVehicle}.");

                ShowVehicle.Vehicles.Remove(vehicle);

                EventLogWorking.message = $"You remove from parking list. Vehicle ID: {vehicle.Id}, " +
                                          $"brand vehicle: { vehicle.BrandVehicle}, " +
                                          $"renta price for vehicle: { vehicle.RentalPrice}$ per 10 minutes";

                vehicle.WriteToEventLog += EventLogWorking.InformationEventLog;
                vehicle.Message();
                return(id);
            }
            else
            {
                return(0);
            }
        }
        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();
        }