Example #1
0
        public async Task <PaginatedList <PTOInformation> > GetActivePTOs(PassInfoSearchParams searchParams)
        {
            //Get Existing PTO info based on search params
            IQueryable <PTOInformation> ptoInformation = this._context.PTOInformations
                                                         .Include(desc => desc.PTODescription)
                                                         .Where(p => p.IsActive && p.PTODescription != null && p.PTODescription.Any(o => o.SelectedLanguage == searchParams.Lang));

            //This is used to create a PaginatedList class that uses Skip and Take statements to filter data on the server instead of always retrieving all rows of the table
            var filteredResult = await PaginatedList <PTOInformation> .CreateAsync(ptoInformation.AsNoTracking(), searchParams.PageIndex, searchParams.PageSize);

            return(filteredResult);
        }
Example #2
0
        public async Task <PaginatedList <TravellerFeedback> > GetTravellerFeedback(PassInfoSearchParams searchParams)
        {
            //Get active curriencies
            IQueryable <TravellerFeedback> activeFeedback = this._context.TravellerFeedback.Where(p => p.IsActive);

            if (activeFeedback == null)
            {
                throw new Exception(string.Format(_messageHandler.GetMessage(ErrorMessagesEnum.NullException), _messageHandler.GetMessage(ErrorMessagesEnum.NotValidInformations)));
            }

            //This is used to create a PaginatedList class that uses Skip and Take statements to filter data on the server instead of always retrieving all rows of the table
            var filteredResult = await PaginatedList <TravellerFeedback> .CreateAsync(activeFeedback.AsNoTracking(), searchParams.PageIndex, searchParams.PageSize);

            return(filteredResult);
        }
Example #3
0
        public async Task <PaginatedList <BookedPassInformation> > GetExpiredPasses(PassInfoSearchParams searchParams)
        {
            //Get QR code information
            var availableQRCodes = this._context.QRCodes.Where(q => (q.IsActive && q.ActivatedPassExpiredDate < searchParams.StartDateAndTime) || q.PassExpiredDuraionDate < searchParams.StartDateAndTime);

            //Get all active QR ids
            var qrCodeIds = availableQRCodes.Select(p => p.BookedPassInformationId).ToArray();

            //Get Booking Info based on traveller id
            var bookingInformation = this._context.BookedPassInformations.Include(qr => qr.QRCode).Include(pass => pass.PassInformation).ThenInclude(passDesc => passDesc.PassDescription).Where(p => qrCodeIds.Contains(p.Id) && p.TravellerId == searchParams.TravellerId && p.IsActive && p.PaymentStatus);

            if (bookingInformation == null)
            {
                throw new Exception(string.Format(_messageHandler.GetMessage(ErrorMessagesEnum.NullException), _messageHandler.GetMessage(ErrorMessagesEnum.NotValidInformations)));
            }

            //This is used to create a PaginatedList class that uses Skip and Take statements to filter data on the server instead of always retrieving all rows of the table
            var filteredResult = await PaginatedList <BookedPassInformation> .CreateAsync(bookingInformation.AsNoTracking(), searchParams.PageIndex, searchParams.PageSize);

            return(filteredResult);
        }
Example #4
0
        public async Task <PaginatedList <BookedPassInformation> > GetBookingInformations(PassInfoSearchParams searchParams)
        {
            //Get Booking Info based on traveller id
            var bookingInformation = this._context.BookedPassInformations.Include(qr => qr.QRCode).Include(pass => pass.PassInformation).ThenInclude(passDesc => passDesc.PassDescription).Where(p => p.TravellerId == searchParams.TravellerId && p.IsActive && p.PaymentStatus);

            if (bookingInformation == null)
            {
                throw new Exception(string.Format(_messageHandler.GetMessage(ErrorMessagesEnum.NullException), _messageHandler.GetMessage(ErrorMessagesEnum.NotValidInformations)));
            }

            //This is used to create a PaginatedList class that uses Skip and Take statements to filter data on the server instead of always retrieving all rows of the table
            var filteredResult = await PaginatedList <BookedPassInformation> .CreateAsync(bookingInformation.AsNoTracking(), searchParams.PageIndex, searchParams.PageSize);

            return(filteredResult);
        }
Example #5
0
        public async Task <PaginatedList <BookedPassInformation> > GetBookingInformation(PassInfoSearchParams searchParams)
        {
            object[]  queryString = searchParams.GetSearchQuery(searchParams);
            ArrayList searchArgs  = (ArrayList)queryString[1];

            //Get booking details based on search param
            IQueryable <BookedPassInformation> bookingInfo = this.GetDbSet <BookedPassInformation>().Where(queryString[0].ToString(), searchArgs.ToArray()).Include(p => p.PassInformation).ThenInclude(q => q.PassDescription).AsQueryable();

            if (bookingInfo == null)
            {
                throw new Exception(string.Format(_messageHandler.GetMessage(ErrorMessagesEnum.NullException), _messageHandler.GetMessage(ErrorMessagesEnum.NotValidInformations)));
            }

            //This is used to create a PaginatedList class that uses Skip and Take statements to filter data on the server instead of always retrieving all rows of the table
            var filteredResult = await PaginatedList <BookedPassInformation> .CreateAsync(bookingInfo.AsNoTracking(), searchParams.PageIndex, searchParams.PageSize);

            return(filteredResult);
        }