public PassengerSummaryComponent(ILogger <PassengerSummaryComponent> logger, IPassengerService passengerService, IAppointmentService appointmentService, IMapper mapper) { _logger = logger; _appointmentService = appointmentService; _passengerService = passengerService; _mapper = mapper; }
public PassengerChaperoneEditViewModel() { passengerService = (App.Current as App).Container.GetService <IPassengerService>(); // Cast object to ChaperoneModel and assign chaperoneModelToEdit = passengerService.GetPassengerToEdit() as ChaperoneModel; // Set passenger name for label PassengerNameToDisplay = chaperoneModelToEdit.FirstName + " " + chaperoneModelToEdit.LastName; PublishEditChaperonePassengerCommand = new RelayCommand( async() => { var messageDialog = new MessageDialog("Are you sure you want to commit these changes?", "Accept Chaperone Changes"); messageDialog.Commands.Add(new UICommand("Yes", null)); messageDialog.Commands.Add(new UICommand("No", null)); messageDialog.DefaultCommandIndex = 0; messageDialog.CancelCommandIndex = 1; var cmd = await messageDialog.ShowAsync(); if (cmd.Label == "Yes") { chaperoneModelToEdit.FirstName = FirstName; chaperoneModelToEdit.LastName = LastName; chaperoneModelToEdit.EmergencyContactNumber = EmergencyContactNumber; } NavigationService.Navigate(typeof(PassengersPage)); }); }
/// <summary> /// Initializes a new instance of the PassengersController class. /// Constructor for Passenger Controller. /// </summary> /// <param name="passengersService">The passengers service.</param> /// <param name="logger">The instance of a logger.</param> public PassengersController( IPassengerService passengersService, ILogger <PassengersController> logger) { _passengersService = passengersService; _logger = logger; }
public AppointmentController(ILogger <AppointmentController> logger, IPassengerService passengerService, IAppointmentService appointmentService, IMapper mapper) { _logger = logger; _appointmentService = appointmentService; _passengerService = passengerService; _mapper = mapper; }
public PassengerStudentEditViewModel() { AgeGroup = new AgeGroupCapabilities(); passengerService = (App.Current as App).Container.GetService <IPassengerService>(); // Cast object to StudentModel and assign studentModelToEdit = passengerService.GetPassengerToEdit() as StudentModel; // Set passenger name for label PassengerNameToDisplay = studentModelToEdit.FirstName + " " + studentModelToEdit.LastName; PublishEditStudentPassengerCommand = new RelayCommand( async() => { var messageDialog = new MessageDialog("Are you sure you want to commit these changes?", "Accept Student Changes"); messageDialog.Commands.Add(new UICommand("Yes", null)); messageDialog.Commands.Add(new UICommand("No", null)); messageDialog.DefaultCommandIndex = 0; messageDialog.CancelCommandIndex = 1; var cmd = await messageDialog.ShowAsync(); if (cmd.Label == "Yes") { studentModelToEdit.FirstName = FirstName; studentModelToEdit.LastName = LastName; studentModelToEdit.ClassName = ClassName; studentModelToEdit.ParentName = ParentName; studentModelToEdit.ParentEmail = ParentEmail; studentModelToEdit.AgeGroup = AgeGroup; } NavigationService.Navigate(typeof(PassengersPage)); }); }
public void Calculate(IPassengerService passengers, IFlightService flightService) { passengers.Calculate(flightService); flightService.ProfitSurplus = flightService.ProfitFromFlight - flightService.CostOfFlight; flightService.CanFlightProceed = CurrentRule.CanFlightProceed(flightService, passengers); }
public PassengerController( IUnitOfWork db, IPassengerService passengerService ) { _passengerService = passengerService; _db = db; }
public DataInitializer(IWebRequestService webRequestService, IUserService userService, IDriverService driverService, IPassengerService passengerService, IDriverRouteService driverRouteService, ILogger <DataInitializer> logger) { _webRequestService = webRequestService; _userService = userService; _driverService = driverService; _passengerService = passengerService; _driverRouteService = driverRouteService; _logger = logger; }
public bool CanFlightProceed(IFlightService flightService, IPassengerService passengerService) { if (flightService.ProfitSurplus > 0 && flightService.SeatsTaken <= flightService.Aircraft.NumberOfSeats && flightService.SeatsTaken / (double)flightService.Aircraft.NumberOfSeats > flightService.FlightRoute.MinimumTakeOffPercentage) { return(true); } return(false); }
public ScheduledFlight(IFlightService flightService, IPassengerService passengerService, IAircraftService aircraftService, ICalculationService calculationService, IFormat format) { _flightService = flightService; _calculationService = calculationService; _format = format; _passengerService = passengerService; _aircraftService = aircraftService; }
public SummaryFormat(IPassengerService passengerService, IAircraftService aircraftService) { _passengerService = passengerService; _aircraftService = aircraftService; _translation = new Dictionary <string, string> { { nameof(GeneralPassenger), "General sales: " }, { nameof(LoyaltyPassenger), "Loyalty member sales: " }, { nameof(DiscountedPassenger), "Discounted sales: " }, { nameof(AirlineEmployeePassenger), "Airline employee comps: " } }; }
public WindowsUserDialogService(IRouteService routeService, IFlightService flightService, IAirplaneService airplaneService, IAirportService airportService, IPassengerService passengerService, ITicketService ticketService, ICarrierService carrierService) { _routeService = routeService; _flightService = flightService; _airplaneService = airplaneService; _airportService = airportService; _passengerService = passengerService; _ticketService = ticketService; _carrierService = carrierService; }
public AssignPassengersViewModel() { // Retrieve passenger and route service routeService = (App.Current as App).Container.GetService <IRouteService>(); passengerService = (App.Current as App).Container.GetService <IPassengerService>(); // Set type TypeSelected = "All"; AssignPassengersCommand = new RelayCommand <object>((param) => { routeService.AssignPassengersToRoute(selectedPassengers); }); }
public bool CanFlightProceed(IFlightService flightService, IPassengerService passengerService) { var airlineEmployeesPercentage = passengerService.GetCountForPassengerType <AirlineEmployeePassenger>() / (double)flightService.Aircraft.NumberOfSeats; if ((airlineEmployeesPercentage > flightService.FlightRoute.MinimumTakeOffPercentage || flightService.ProfitSurplus > 0) && flightService.SeatsTaken / (double)flightService.Aircraft.NumberOfSeats > flightService.FlightRoute.MinimumTakeOffPercentage && flightService.SeatsTaken <= flightService.Aircraft.NumberOfSeats ) { return(true); } return(false); }
public PassengersViewModel() { // Retrieve passenger service passengerService = (App.Current as App).Container.GetService <IPassengerService>(); // FIX: For some reason, I can't bind to the datacontext of the grid to get the BusModel, // so I have to bind to the grid and get the datacontext of that through here... // Set command for editing passengers so new page appears EditPassengerCommand = new RelayCommand <object>((param) => { object passengerModel = (param as Grid).DataContext as object; passengerService.SetPassengerToEdit(passengerModel as PassengerModel); if (passengerModel.GetType() == typeof(StudentModel)) { NavigationService.Navigate(typeof(PassengerStudentEditPage)); } else { NavigationService.Navigate(typeof(PassengerChaperoneEditPage)); } }); // Go to new passenger page NewPassengerCommand = new RelayCommand(() => { NavigationService.Navigate(typeof(PassengerNewPage)); }); // Remove passenger from list of passengers RemovePassengerCommand = new RelayCommand <object>(async(param) => { object passengerModel = (param as Grid).DataContext as object; var messageDialog = new MessageDialog("Are you sure you want to remove this passenger?", "Remove Passenger"); messageDialog.Commands.Add(new UICommand("Yes", null)); messageDialog.Commands.Add(new UICommand("No", null)); messageDialog.DefaultCommandIndex = 0; messageDialog.CancelCommandIndex = 1; var cmd = await messageDialog.ShowAsync(); if (cmd.Label == "Yes") { passengerService.RemovePassenger(passengerModel); } }); }
public PassengersNewViewModel() { passengerService = (App.Current as App).Container.GetService <IPassengerService>(); PublishAddPassengerCommand = new RelayCommand( async() => { var messageDialog = new MessageDialog("Are you sure you want to add a new passenger?", "Add New Passenger"); messageDialog.Commands.Add(new UICommand("Yes", null)); messageDialog.Commands.Add(new UICommand("No", null)); messageDialog.DefaultCommandIndex = 0; messageDialog.CancelCommandIndex = 1; var cmd = await messageDialog.ShowAsync(); if (cmd.Label == "Yes") { // Let's get what passenger we want to add PivotItem pivotItemSelected = SelectedPivotItem as PivotItem; if (pivotItemSelected.Header.ToString() == "Student") { passengerModelChosen = StudentModel; } else if (pivotItemSelected.Header.ToString() == "Chaperone") { passengerModelChosen = ChaperoneModel; } passengerModelChosen.FirstName = FirstName; passengerModelChosen.LastName = LastName; passengerService.AddPassenger(passengerModelChosen); } ResetPassengerData(); NavigationService.Navigate(typeof(PassengersPage)); }); }
public FlightsController(IPassengerService passengerService) { _passengerService = passengerService; }
public PassengerController(IPassengerService pserv) { passengerService = pserv; }
public PassengerController(IPassengerService passervice, IFlightService flightservice) { _passervice = passervice; _flightservice = flightservice; }
public PassengersController(IPassengerService service) { _service = service; }
public void Setup() { _personRepositoryAsync = new PersonAsyncRepository(); _passengerService = new PassengerService(_personRepositoryAsync); }
public CheckInManager() { passengerServiceClient = new PassengerServiceClient("BasicHttpBinding_IPassengerService"); }
public CheckInManager(IPassengerService client) { passengerServiceClient = client; }
public FlightSummaryService(ICashFlowCalculationService cashFlowCalculationService, IPassengerService passengerService, IFlightValidationService flightValidationService) { _passengerService = passengerService; _cashFlowCalculationService = cashFlowCalculationService; _flightValidationService = flightValidationService; }
public PassengerController(IPassengerService passengerService, IMapper mapper) { _mapper = mapper; _passengerService = passengerService; }
public PassengerManager(IPassengerService service) { passengerService = service; }
public ValuesController(IPassengerService passengerService) { _passengerService = passengerService; }
public PassengersController(ILogger <PassengerDTO> logger, IPassengerService passengerService) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _passengerService = passengerService ?? throw new ArgumentNullException(nameof(passengerService)); }
public FlightValidationService(ICashFlowCalculationService cashFlowCalculationService, IAircraftService aircraftService, IPassengerService passengerService) { _cashFlowCalculationService = cashFlowCalculationService; _aircraftService = aircraftService; _passengerService = passengerService; }
public PassengerController(IPassengerService passengerService) { _passengerService = passengerService; }