예제 #1
0
 public PassengerSummaryComponent(ILogger <PassengerSummaryComponent> logger, IPassengerService passengerService, IAppointmentService appointmentService, IMapper mapper)
 {
     _logger             = logger;
     _appointmentService = appointmentService;
     _passengerService   = passengerService;
     _mapper             = mapper;
 }
예제 #2
0
        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));
            });
        }
예제 #3
0
 /// <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));
            });
        }
예제 #6
0
        public void Calculate(IPassengerService passengers, IFlightService flightService)
        {
            passengers.Calculate(flightService);
            flightService.ProfitSurplus = flightService.ProfitFromFlight - flightService.CostOfFlight;

            flightService.CanFlightProceed = CurrentRule.CanFlightProceed(flightService, passengers);
        }
예제 #7
0
 public PassengerController(
     IUnitOfWork db,
     IPassengerService passengerService
     )
 {
     _passengerService = passengerService;
     _db = db;
 }
예제 #8
0
 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;
 }
예제 #9
0
        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);
        }
예제 #10
0
 public ScheduledFlight(IFlightService flightService,
                        IPassengerService passengerService,
                        IAircraftService aircraftService,
                        ICalculationService calculationService,
                        IFormat format)
 {
     _flightService      = flightService;
     _calculationService = calculationService;
     _format             = format;
     _passengerService   = passengerService;
     _aircraftService    = aircraftService;
 }
예제 #11
0
 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;
 }
예제 #13
0
        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);
            });
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
                }
            });
        }
예제 #16
0
        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));
            });
        }
예제 #17
0
 public FlightsController(IPassengerService passengerService)
 {
     _passengerService = passengerService;
 }
 public PassengerController(IPassengerService pserv)
 {
     passengerService = pserv;
 }
예제 #19
0
 public PassengerController(IPassengerService passervice, IFlightService flightservice)
 {
     _passervice    = passervice;
     _flightservice = flightservice;
 }
예제 #20
0
 public PassengersController(IPassengerService service)
 {
     _service = service;
 }
예제 #21
0
 public void Setup()
 {
     _personRepositoryAsync = new PersonAsyncRepository();
     _passengerService      = new PassengerService(_personRepositoryAsync);
 }
예제 #22
0
 public CheckInManager()
 {
     passengerServiceClient = new PassengerServiceClient("BasicHttpBinding_IPassengerService");
 }
예제 #23
0
 public CheckInManager(IPassengerService client)
 {
     passengerServiceClient = client;
 }
예제 #24
0
 public FlightSummaryService(ICashFlowCalculationService cashFlowCalculationService, IPassengerService passengerService, IFlightValidationService flightValidationService)
 {
     _passengerService           = passengerService;
     _cashFlowCalculationService = cashFlowCalculationService;
     _flightValidationService    = flightValidationService;
 }
 public PassengerController(IPassengerService passengerService, IMapper mapper)
 {
     _mapper           = mapper;
     _passengerService = passengerService;
 }
예제 #26
0
 public PassengerManager(IPassengerService service)
 {
     passengerService = service;
 }
예제 #27
0
 public ValuesController(IPassengerService passengerService)
 {
     _passengerService = passengerService;
 }
예제 #28
0
 public PassengersController(ILogger <PassengerDTO> logger, IPassengerService passengerService)
 {
     _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     _passengerService = passengerService ?? throw new ArgumentNullException(nameof(passengerService));
 }
예제 #29
0
 public FlightValidationService(ICashFlowCalculationService cashFlowCalculationService, IAircraftService aircraftService, IPassengerService passengerService)
 {
     _cashFlowCalculationService = cashFlowCalculationService;
     _aircraftService            = aircraftService;
     _passengerService           = passengerService;
 }
 public PassengerController(IPassengerService passengerService)
 {
     _passengerService = passengerService;
 }