private static void InitializeNewCommand(ConsoleTable menu, IParkingService _parkingService) { Console.Write("Your option: "); var newOption = Console.ReadLine(); SwithMenuItem(menu, newOption, _parkingService); }
public ParkingController(ILogger <ParkingController> logger, IConfiguration config, IParkingService parkingService) { this.logger = logger; this.parkingService = parkingService; this.logger.LogInformation("Initialized Parking Controller"); }
public MapViewModel(IParkingService parkingService, IGeoService geoService) { ParkingService = parkingService; GeoService = geoService; GetLocationAddress(); }
private static bool MainMenu(IParkingService parkingService) { Console.Clear(); Console.WriteLine("Welcome to our parking system!"); Console.WriteLine("Please select one of our operations:"); Console.WriteLine("1. Add new car"); Console.WriteLine("2. Exist a car"); Console.WriteLine("3. View all parked cars"); switch (Console.ReadLine()) { case "1": EnterCar(parkingService); return(true); case "2": ExitCar(parkingService); return(true); case "3": ShowAllCars(parkingService); return(true); default: return(false); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IParkingService parkingService) { app.UseCors(builder => { builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin(); }).Build(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "City of Grand Rapids Parking V1"); }); //app.UseHealthChecks("/health"); //app.UseHttpsRedirection(); app.UseMvc(); parkingService.UpdateMap(); }
public ParkingsController( IParkingService parkingService, IMapper mapper) { _parkingService = parkingService; _mapper = mapper; }
public ParkingController(ILogger <ParkingController> logger, IParkingService parkingService, IPaymentService paymentService) { _logger = logger; _parkingService = parkingService; _paymentService = paymentService; }
public VehicleModels2Controller(Garage2_0MVCContext db, IParkingService parkingService, IParkingCapacityService parkingCapacityService, IMemberSelectService memberSelectService) { this.db = db; this.parkingService = parkingService; this.memberSelectService = memberSelectService; this.parkingCapacityService = parkingCapacityService; }
public VehicleController(ILogger <VehicleController> logger, IVehicleService vehicleService, IParkingService parkingService, IMapper mapper) { this.logger = logger; this.vehicleService = vehicleService; this.parkingService = parkingService; this.mapper = mapper; this.logger.LogInformation("Initialized Vehicle Controller"); }
private static void ShowAllCars(IParkingService parkingService) { List <Car> allCars = parkingService.GetAllCars(); var json = JsonConvert.SerializeObject(allCars, Formatting.Indented); Console.WriteLine(json); Console.ReadKey(); }
public HomeController(ICarService carService, IClientService clientService, IParkingTicketService parkingTicketService, IParkingPlaceService parkingPlaceService, IParkingService parkingService) { CarService = carService; ClientService = clientService; ParkingPlaceService = parkingPlaceService; ParkingTicketService = parkingTicketService; ParkingService = parkingService; list = ParkingService.GetAll(); }
private static void ExitCar(IParkingService parkingService) { // exit car Console.WriteLine("Please enter your car register no:"); string regNo = Console.ReadLine(); var rsp = parkingService.ExitCar(regNo); Console.WriteLine(rsp.Message); Console.ReadKey(); }
public PaymentService(ILogger <PaymentService> logger, IRepository <Settings> settings, IParkingService parkingService, IRepository <ParkingPlace> parkingPlaces) { _logger = logger; _settings = settings; _parkingService = parkingService; _parkingPlaces = parkingPlaces; }
public CustomerTest() { var builder = new DbContextOptionsBuilder <InvoicingContext>(); builder.UseInMemoryDatabase($"database{Guid.NewGuid()}"); _invoicingContext = new InvoicingContext(builder.Options); _customerService = new CustomerService(_invoicingContext); _parkingService = new ParkingService(_invoicingContext); _parkedService = new ParkedService(_invoicingContext); }
public ParkingViewModel(IParkingService parkingService, IGpsProvider gpsProvider) { this._parkingService = parkingService; this._gpsProvider = gpsProvider; }
public ParkingsController(IParkingService locationService_) { parkingService = locationService_; }
public ParkingController(IParkingService parking) { _parking = parking; }
public TransactionsController(IParkingService parking) { _parking = parking; }
public ParkingController(IParkingService parkingService) { _parkingService = parkingService; }
public VehiclesController(IParkingService parking) { _parking = parking; }
public HomeController(IParkingService parkingService, IMapper mapper) { this._parkingService = parkingService; this._mapper = mapper; }
public DetailViewModel(IParkingService parkingDataService) { this._parkingDataService = parkingDataService; }
public ParkingsViewModel(IParkingService parkingService, IMvxNavigationService navigationService) { this._navigationService = navigationService; this._parkingService = parkingService; loadData(); }
public VehiclesController(IParkingService service) { Service = service; }
static void Main(string[] args) { provider = new ParkingServiceProvider(); HelperMethods.PrintWelcomeMessage(); if (args.Length != 0) { //Input from a file string line; try { System.IO.StreamReader file = new StreamReader(args[0]); while ((line = file.ReadLine()) != null) { if (provider.Validate(line)) { try { provider.Execute(line); } catch (ParkingException e) { Console.WriteLine(e.Message); } } } file.Close(); Console.Read(); } catch (System.Exception e) { Console.WriteLine(e.Message); } return; } else { //Input Interactively HelperMethods.PrintCommands(); while (true) { try { var input = Console.ReadLine(); if (input.ToLower().Equals("exit")) { break; } else { if (provider.Validate(input)) { try { provider.Execute(input); } catch (ParkingException e) { Console.WriteLine(e.Message); } } else { HelperMethods.PrintCommands(); } } } catch (System.Exception e) { Console.WriteLine(e.Message); } } } }
private static void SwithMenuItem(ConsoleTable menu, string selectedMenuOption, IParkingService _parkingService) { string registrationNumber; switch (selectedMenuOption) { case string value when value == Constants.MenuItems.AvaiableParkingSpots.ToString(): _parkingService.GetNumberOfFreeParkingSpots(); InitializeNewCommand(menu, _parkingService); break; case string value when value == Constants.MenuItems.DisplayCosts.ToString(): _parkingService.DisplayCosts(); InitializeNewCommand(menu, _parkingService); break; case string value when value == Constants.MenuItems.EnterTheParking.ToString(): registrationNumber = GetUserConsoleInput("Please enter the car registration number. Please use the format BV10ABC: "); _parkingService.AddNewParkingEntry(registrationNumber); InitializeNewCommand(menu, _parkingService); break; case string value when value == Constants.MenuItems.GetParkedCars.ToString(): _parkingService.GetParkedCars(); InitializeNewCommand(menu, _parkingService); break; case string value when value == Constants.MenuItems.ExitTheParkingAndPay.ToString(): registrationNumber = GetUserConsoleInput("Please enter the car registration number: "); _parkingService.ExitTheParking(registrationNumber); InitializeNewCommand(menu, _parkingService); break; case string value when value == Constants.MenuItems.ExitTheApp.ToString(): Console.WriteLine("Thank you for visiting us!"); break; default: Console.WriteLine("Looks like your selection is not valid. Please select one of the avaiable menu options!\n"); InitializeNewCommand(menu, _parkingService); break; } }
public TypeSelectService(Garage2_0MVCContext db, IParkingService parkingService, IParkingCapacityService parkingCapacityService) { this.db = db; this.parkingService = parkingService; this.parkingCapacityService = parkingCapacityService; }
public ParkingsController(IParkingService parkingService) { this.parkingService = parkingService; }
public ParkingGarage(IParkingService parkingService) { _parkingService = parkingService; }
public ParkingController(IParkingViewModelService parkingViewModelService, IParkingService parkingService, ILogger <HomeController> logger) { _logger = logger; _parkingViewModelService = parkingViewModelService; _parkingService = parkingService; }
/// <summary> /// Initializes a new instance of the <see cref="OwnerController"/> class. /// </summary> /// <param name="parkingService">Parking service.</param> public OwnerController(IParkingService parkingService) { this.parkingService = parkingService; }
public TransactionsController(IParkingService service) { Service = service; }