public AllPassengersVM(IPassengerRepository repository,
                               IMainNavigationService navigationService)
        {
            this.DataGridVisibility = true;
            this.ButtonVisible      = false;

            _repository        = repository;
            _navigationService = navigationService;

            Task.Factory.StartNew(() =>
            {
                lock (locker)
                {
                    this.Passengers = new ObservableCollection <PassengerModel>(_repository.GetAll());
                }

                Application.Current.Dispatcher.Invoke(
                    new Action(() =>
                {
                    this.DataGridVisibility = false;
                    this.ButtonVisible      = true;
                    this.ForegroundForUser  = "******";
                    this.MessageForUser     = "******";
                }));
            });

            ReceivePassenger();
        }
예제 #2
0
        /// <summary>
        /// This Method will return TravelList Details
        /// </summary>
        /// <param name="travelListId">accept travel list ID</param>
        /// <returns>it return travel list details on object</returns>
        public object GetTravelList(long travelListId)
        {
            TravelList travel = _travelListRepository.FindBy(m => m.Id == travelListId).FirstOrDefault();
            IEnumerable <TravelPassengerLists> travelPassengerlst = _travelpassengerlistRepository.FindBy(m => m.travelList == travelListId).AsQueryable();
            List <Passengers> psgrlst = (from pl in _passengerRepository.GetAll().AsQueryable()
                                         join tp in travelPassengerlst on pl.Id equals tp.passenger
                                         orderby pl.name
                                         select pl).ToList();

            object returnObj = new { Id = travel.Id, description = travel.description, listName = travel.listName, Passengers = psgrlst };

            return(returnObj);
        }
예제 #3
0
        public IEnumerable <Passenger> GetCustomerPassengers(string userId)
        {
            Guid userIdGuid = Guid.Empty;

            if (!Guid.TryParse(userId, out userIdGuid))
            {
                throw new Exception("Invalid Guid Format");
            }

            return(passengerRepository.GetAll()
                   .Where(Passenger => Passenger.customer != null && passenger.customer.UserId == userIdGuid)
                   .AsEnumerable());
        }
        public IHttpActionResult Get()
        {
            List <Passenger> PassengerList = passengerRepository.GetAll();

            return(Ok(this.passengerRepository.GetAll()));
        }