コード例 #1
0
        public async Task <DataTable> PaymentDetailsDatabase(UIRequest queryFormat)
        {
            string    query     = $"SELECT t3.PaymentType,Count(t3.PaymentType) as Bookings   FROM TripProducts t1 JOIN TripFolders t2 ON t1.TripFolderId=t2.FolderId JOIN Payments t3 ON t2.FolderId=t3.TripFolderId JOIN PassengerSegments t4 ON t1.Id=t4.TripProductId JOIN HotelSegments t5 ON t5.TripProductId = t1.Id where t5.City='{queryFormat.Filter}' and t1.ModifiedDate between  '{queryFormat.FromDate}' and '{queryFormat.ToDate}' and t1.ProductType='Hotel' and t4.BookingStatus='Purchased' and t1.ProductType='Hotel' group by t3.PaymentType; ";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #2
0
        private void MetaSearch(SearchMetadata metadata)
        {
            var sw      = new Stopwatch();
            var request = new UIRequest()
            {
                Id           = "MetaSearch",
                TypedRequest = metadata.TypedRequest,
                Delay        = metadata.Delay,
                OnBeforeRun  = () => {
                    sw.Start();
                    _progressBarTracker.Start(metadata.OperationId, metadata.HintText);
                },
                OnAfterRun = () => {
                    sw.Stop();
                    _progressBarTracker.Stop(metadata.OperationId);
                },
                SuccessCallback = typedResponse => {
                    metadata.ProcessResponse(typedResponse, sw);
                },
                ErrorCallback = errorResponse => {
                    ViewModel.SetErrorResponse(errorResponse);
                }
            };

            _uiRequestProcessor.Post(request);
        }
コード例 #3
0
        public async Task <DataTable> BookingDatesDatabase(UIRequest queryFormat)
        {
            string    query     = $"SELECT  t1.ModifiedDate ,COUNT(t1.ModifiedDate) AS Bookings FROM TripProducts t1 JOIN PassengerSegments t2 ON t1.Id=t2.TripProductId JOIN  HotelSegments t3 ON t3.TripProductId=t1.Id where t1.ProductType='Hotel' AND t2.BookingStatus='Purchased' AND  t3.City='{queryFormat.Filter}' AND t1.ModifiedDate between '{queryFormat.FromDate}' and '{queryFormat.ToDate}' group by t1.ModifiedDate ;  ";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #4
0
ファイル: UIRequestTests.cs プロジェクト: thild/dotnetopenid
        public void ModeEncoding()
        {
            var request = new UIRequest();
            MessageDictionary dictionary = this.MessageDescriptions.GetAccessor(request);

            Assert.AreEqual("popup", dictionary["mode"]);
        }
コード例 #5
0
        public async Task <DataTable> MarketingAirlineBookingsInfoDatabase(UIRequest uIRequest)
        {
            string    query     = $"SELECT t4.FullName,t5.MarketingAirlineCode,Count(t5.MarketingAirlineCode) as Bookings   FROM TripProducts t1 JOIN TripFolders t2 ON t1.TripFolderId=t2.FolderId JOIN Payments t3 ON t2.FolderId=t3.TripFolderId JOIN AirSegments t5 ON t5.TripProductId = t1.Id Join Airlines t4 ON t4.AirlineCode=t5.MarketingAirlineCode Join PassengerSegments t7 ON t7.TripProductId=t1.Id where t7.BookingStatus='Purchased'and t1.ModifiedDate between  '{uIRequest.FromDate}' and '{uIRequest.ToDate}'  and t1.ProductType='Air' group by t5.MarketingAirlineCode,t4.FullName;  ";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #6
0
        public async Task <DataTable> BookingsWithinDateRangeInfoDatabase(UIRequest uIRequest)
        {
            string    query     = $"SELECT  t1.ModifiedDate ,COUNT(t1.ModifiedDate) AS Bookings FROM TripProducts t1 JOIN PassengerSegments t2 ON t1.Id=t2.TripProductId JOIN  AirSegments t3 ON t3.TripProductId=t1.Id where t1.ProductType='Air' AND t2.BookingStatus='Purchased' AND t1.ModifiedDate between '{uIRequest.FromDate}' and '{uIRequest.ToDate}' group by t1.ModifiedDate;";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #7
0
        public async Task <DataTable> AirFailureCountDatabase(UIRequest uIRequest)
        {
            string    query     = $"SELECT COUNT(t3.BookingStatus) as FailureCount FROM AirSegments t1 JOIN TripProducts t2 ON t1.TripProductId = t2.Id JOIN PassengerSegments  t3 ON t2.Id = t3.TripProductId where t2.ModifiedDate between '{uIRequest.FromDate}' and '{uIRequest.ToDate}' and t3.BookingStatus ='Purchased' and t2.ProductType='Air' ;";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #8
0
        public async Task <DataTable> SupplierNamesWithDatesDatabase(UIRequest queryFormat)
        {
            string    query     = $"SELECT (t3.SupplierFamily),Count(t3.City) as Bookings FROM TripFolders t1 JOIN TripProducts t2 ON t1.FolderId = t2.TripFolderId JOIN HotelSegments t3 ON t2.Id = t3.TripProductId JOIN PassengerSegments t4 ON t4.TripProductId=t2.Id where t3.StayPeriodStart between '{queryFormat.FromDate}' and '{queryFormat.ToDate}' and t3.City='{queryFormat.Filter}' and t4.BookingStatus='Purchased' and t2.ProductType='Hotel' group by t3.SupplierFamily,t3.city,t3.StayPeriodStart ;";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #9
0
        public async Task <DataTable> FailureCountDataBase(UIRequest queryFormat)
        {
            string    query     = $"SELECT COUNT(t3.BookingStatus) as Failure FROM HotelSegments t1 JOIN TripProducts t2 ON t1.TripProductId = t2.Id JOIN PassengerSegments  t3 ON t2.Id = t3.TripProductId where t2.ModifiedDate between '{queryFormat.FromDate}' and '{queryFormat.ToDate}' and t3.BookingStatus ='Planned' and t2.ProductType='Hotel' and t1.City='{queryFormat.Filter}';";
            DataTable dataTable = await QueryExecuter(query);

            return(dataTable);
        }
コード例 #10
0
        public async Task <IActionResult> GetBookingsWithinDateRangeInfo([FromQuery] string fromDate, string toDate)
        {
            UIRequest uiRequest = new UIRequest {
                FromDate = fromDate, ToDate = toDate
            };

            return(Ok(await webApiServiceProvider.BookingsWithinDateRangeInfoService(uiRequest)));
        }
コード例 #11
0
        public async Task <IActionResult> GetFailureCountInfo([FromQuery] string fromDate, string toDate)
        {
            UIRequest uiRequest = new UIRequest {
                FromDate = fromDate, ToDate = toDate
            };

            return(Ok(await webApiServiceProvider.FailureCountInfoService(uiRequest)));
        }
コード例 #12
0
        public async Task <IActionResult> GetBookingDates([FromQuery] string fromDate, string toDate, string location)
        {
            UIRequest query = new UIRequest {
                ToDate = toDate, FromDate = fromDate, Filter = location
            };

            return(Ok(await service.BookingDatesService(query)));
        }
コード例 #13
0
        public async Task <IActionResult> GetPaymentType([FromQuery] string fromDate, string toDate)
        {
            UIRequest uiRequest = new UIRequest {
                FromDate = fromDate, ToDate = toDate
            };

            return(Ok(await webApiServiceProvider.AirPaymentTypeService(uiRequest)));
        }
コード例 #14
0
        public async Task <IActionResult> GetPaymentType([FromQuery] string fromDate, string toDate, string location)
        {
            UIRequest query = new UIRequest {
                ToDate = toDate, FromDate = fromDate, Filter = location
            };

            return(Ok(await service.PaymentDetailsService(query)));
        }
コード例 #15
0
        public async Task <IActionResult> GetMarketingAirlineBookingInfo([FromQuery] string fromDate, string toDate)
        {
            UIRequest uiRequest = new UIRequest {
                FromDate = fromDate, ToDate = toDate
            };

            return(Ok(await webApiServiceProvider.MarketingAirlineBookingsInfoService(uiRequest)));
        }
コード例 #16
0
        public async Task <IActionResult> GetHotelLocationWithDates([FromQuery] string fromDate, string toDate)
        {
            UIRequest query = new UIRequest {
                ToDate = toDate, FromDate = fromDate
            };

            return(Ok(await service.HotelsAtALocationWithDatesService(query)));
        }
コード例 #17
0
        public void Defaults()
        {
            UIRequest request = new UIRequest();

            Assert.AreEqual("popup", request.Mode);
            Assert.AreEqual(1, request.LanguagePreference.Length);
            Assert.AreEqual(CultureInfo.CurrentUICulture, request.LanguagePreference[0]);
        }
コード例 #18
0
        private void RefreshFileSystemTree()
        {
            var uiRequest = new UIRequest {
                Request = new RefreshFileSystemTreeRequest(),
                Id      = "RefreshFileSystemTreeRequest",
                Delay   = TimeSpan.FromSeconds(0.0),
            };

            _uiRequestProcessor.Post(uiRequest);
        }
コード例 #19
0
        public void RefreshFileSystemTree()
        {
            var uiRequest = new UIRequest {
                Request = new RefreshFileSystemTreeRequest(),
                Id      = "RefreshFileSystemTreeRequest",
                Delay   = TimeSpan.FromSeconds(0.0),
                OnSend  = () => {
                    this._performSearchOnNextRefresh = true;
                }
            };

            _uiRequestProcessor.Post(uiRequest);
        }
コード例 #20
0
ファイル: UIRequestTests.cs プロジェクト: thild/dotnetopenid
        public void IconEncodingDecoding()
        {
            var request = new UIRequest();
            MessageDictionary dictionary = this.MessageDescriptions.GetAccessor(request);

            Assert.IsFalse(dictionary.ContainsKey("icon"));

            Assert.IsFalse(request.Icon.HasValue);
            dictionary["icon"] = "true";
            Assert.IsTrue(request.Icon.Value);

            dictionary.ClearValues();
            request.Icon = true;
            Assert.AreEqual("true", dictionary["icon"]);
        }
コード例 #21
0
        private void SendUnregisterFileRequest(string path)
        {
            if (!IsValidPath(path))
            {
                return;
            }

            var request = new UIRequest {
                Id      = "UnregisterFileRequest-" + path,
                Request = new UnregisterFileRequest {
                    FileName = path
                }
            };

            _uiRequestProcessor.Post(request);
        }
コード例 #22
0
        private void SendRegisterFileRequest(string path)
        {
            if (!IsPhysicalFile(path))
            {
                return;
            }

            var request = new UIRequest {
                Id      = "RegisterFileRequest-" + path,
                Request = new RegisterFileRequest {
                    FileName = path
                }
            };

            _uiRequestProcessor.Post(request);
        }
        public async Task <FailuresInBooking> FailureCountService(UIRequest query)
        {
            string result   = null;
            string redisKey = "FailureCount";

            result = _cache.Get(redisKey);
            if (result == null)
            {
                DataTable dataTable = await _sqlDatabase.FailureCountDataBase(query);

                result = _hotelTranslator.FailureCountTranslator(dataTable);
                _cache.Add(redisKey, result);
            }
            FailuresInBooking FailureCount = JsonConvert.DeserializeObject <FailuresInBooking>(result);

            return(FailureCount);
        }
        public async Task <List <PaymentDetails> > PaymentDetailsService(UIRequest query)
        {
            string result   = null;
            string redisKey = query.ToDate + query.FromDate + "Payment" + query.Filter;

            result = _cache.Get(redisKey);
            if (result == null)
            {
                DataTable dataTable = await _sqlDatabase.PaymentDetailsDatabase(query);

                result = _hotelTranslator.PaymentDetailsTranslator(dataTable);
                _cache.Add(redisKey, result);
            }
            List <PaymentDetails> payment = JsonConvert.DeserializeObject <List <PaymentDetails> >(result);

            return(payment);
        }
        public async Task <List <HotelNamesWithBookings> > HotelNameWithDatesService(UIRequest query)
        {
            string result   = null;
            string redisKey = query.ToDate + query.Filter + query.FromDate;

            result = _cache.Get(redisKey);
            if (result == null)
            {
                DataTable dataTable = await _sqlDatabase.HotelNameWithDatesDatabases(query);

                result = _hotelTranslator.HotelNameWithDatesTranslator(dataTable);
                _cache.Add(redisKey, result);
            }
            List <HotelNamesWithBookings> ListOfHotelNamesWithDates = JsonConvert.DeserializeObject <List <HotelNamesWithBookings> >(result);

            return(ListOfHotelNamesWithDates);
        }
コード例 #26
0
        public async Task <FailureCount> FailureCountInfoService(UIRequest uIRequest)
        {
            string result   = null;
            string redisKey = "AirFailureCount" + uIRequest.FromDate + uIRequest.ToDate;

            result = _cache.Get(redisKey);
            if (result == null)
            {
                DataTable dataTable = await _sqlDatabase.AirFailureCountDatabase(uIRequest);

                result = _airTranslator.AirFailureCountTranslator(dataTable);
                _cache.Add(redisKey, result);
            }
            FailureCount failureCount = JsonConvert.DeserializeObject <FailureCount>(result);

            return(failureCount);
        }
コード例 #27
0
        public async Task <List <AirPaymentType> > AirPaymentTypeService(UIRequest uIRequest)
        {
            string result   = null;
            string redisKey = "AirPaymentType" + uIRequest.FromDate + uIRequest.ToDate;

            result = _cache.Get(redisKey);
            if (result == null)
            {
                DataTable dataTable = await _sqlDatabase.AirPaymentTypeDatabase(uIRequest);

                result = _airTranslator.AirPaymentTypeTranslator(dataTable);
                _cache.Add(redisKey, result);
            }
            List <AirPaymentType> airPaymentType = JsonConvert.DeserializeObject <List <AirPaymentType> >(result);

            return(airPaymentType);
        }
コード例 #28
0
ファイル: UIManager.cs プロジェクト: Eliice/RPGRogueLike
    public void Notify(UIRequest request, UIRequestMode mode, params object[] parameters)
    {
        if (request == UIRequest.NbMenus || menus[(int)request] == null)
        {
#if UNITY_EDITOR
            if (request == UIRequest.NbMenus)
            {
                Debug.Log("request == UIRequest.NbMenus");
            }
            else
            {
                Debug.Log("menus[" + request.ToString() + "] == null");
            }
#endif
            return;
        }
        UseMenu(request, mode, parameters);
    }
コード例 #29
0
        private void FetchFilesystemTree()
        {
            var request = new UIRequest()
            {
                Id              = "GetFileSystemRequest",
                TypedRequest    = new GetFileSystemRequest {
                },
                SuccessCallback = (typedResponse) => {
                    var response = (GetFileSystemResponse)typedResponse;
                    ViewModel.SetFileSystemTree(response.Tree);
                },
                ErrorCallback = (errorResponse) => {
                    ViewModel.SetErrorResponse(errorResponse);
                }
            };

            _uiRequestProcessor.Post(request);
        }
コード例 #30
0
        public void OnDocumentClose(ITextDocument document)
        {
            var path = document.FilePath;

            if (!IsPhysicalFile(path))
            {
                return;
            }

            var request = new UIRequest {
                Id           = "RemoveFileNameRequest-" + path,
                TypedRequest = new RemoveFileNameRequest {
                    FileName = path
                }
            };

            _uiRequestProcessor.Post(request);
        }