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); }
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); }
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); }
public void ModeEncoding() { var request = new UIRequest(); MessageDictionary dictionary = this.MessageDescriptions.GetAccessor(request); Assert.AreEqual("popup", dictionary["mode"]); }
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); }
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); }
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); }
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); }
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); }
public async Task <IActionResult> GetBookingsWithinDateRangeInfo([FromQuery] string fromDate, string toDate) { UIRequest uiRequest = new UIRequest { FromDate = fromDate, ToDate = toDate }; return(Ok(await webApiServiceProvider.BookingsWithinDateRangeInfoService(uiRequest))); }
public async Task <IActionResult> GetFailureCountInfo([FromQuery] string fromDate, string toDate) { UIRequest uiRequest = new UIRequest { FromDate = fromDate, ToDate = toDate }; return(Ok(await webApiServiceProvider.FailureCountInfoService(uiRequest))); }
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))); }
public async Task <IActionResult> GetPaymentType([FromQuery] string fromDate, string toDate) { UIRequest uiRequest = new UIRequest { FromDate = fromDate, ToDate = toDate }; return(Ok(await webApiServiceProvider.AirPaymentTypeService(uiRequest))); }
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))); }
public async Task <IActionResult> GetMarketingAirlineBookingInfo([FromQuery] string fromDate, string toDate) { UIRequest uiRequest = new UIRequest { FromDate = fromDate, ToDate = toDate }; return(Ok(await webApiServiceProvider.MarketingAirlineBookingsInfoService(uiRequest))); }
public async Task <IActionResult> GetHotelLocationWithDates([FromQuery] string fromDate, string toDate) { UIRequest query = new UIRequest { ToDate = toDate, FromDate = fromDate }; return(Ok(await service.HotelsAtALocationWithDatesService(query))); }
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]); }
private void RefreshFileSystemTree() { var uiRequest = new UIRequest { Request = new RefreshFileSystemTreeRequest(), Id = "RefreshFileSystemTreeRequest", Delay = TimeSpan.FromSeconds(0.0), }; _uiRequestProcessor.Post(uiRequest); }
public void RefreshFileSystemTree() { var uiRequest = new UIRequest { Request = new RefreshFileSystemTreeRequest(), Id = "RefreshFileSystemTreeRequest", Delay = TimeSpan.FromSeconds(0.0), OnSend = () => { this._performSearchOnNextRefresh = true; } }; _uiRequestProcessor.Post(uiRequest); }
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"]); }
private void SendUnregisterFileRequest(string path) { if (!IsValidPath(path)) { return; } var request = new UIRequest { Id = "UnregisterFileRequest-" + path, Request = new UnregisterFileRequest { FileName = path } }; _uiRequestProcessor.Post(request); }
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); }
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); }
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); }
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); }
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); }
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); }