Beispiel #1
0
        public void HandlePublishedSearchRequestsEvent(CriteriaUsageEventPayload eventPayload)
        {
            if (eventPayload == null)
            {
                throw new ArgumentNullException("eventPayload");
            }

            if (log.IsDebugEnabled)
            {
                log.Debug("Received published search requests event => " + eventPayload);
            }

            ISearch search = new SearchImpl();

            if (eventPayload.Criteria != null)
            {
                foreach (var criterion in eventPayload.Criteria)
                {
                    search.Criteria.Add(new SearchCriterionImpl {
                        ControlName = criterion.Key, ControlValue = criterion.Value
                    });
                }
            }

            Requests.Clear();
            Requests.AddRange(optionRequestPersistanceManager.GetRequestMatchingAdhocCriteria(search, false));
            NotifyPropertyChanged("Requests");

            if (!Requests.Any())
            {
                MessageBox.Show("No RFQs matching the search criteria were found!\nPlease broaden your search criteria.",
                                "No Search Results Returned.", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
Beispiel #2
0
        public async void GetRequestsSearch()
        {
            // IsRefreshing = true;
            var _searchModel = new SearchModel
            {
                maxResult = 200,
                order     = "desc",
                sortedBy  = "request_creation_date",
                date      = CheckDateFrom,
                date1     = CheckDateTo,
                status    = SelectedStatus.name
            };
            var cookie   = Settings.Cookie;
            var res      = cookie.Substring(11, 32);
            var response = await apiService.PostRequest <Request>(
                "https://portalesp.smart-path.it",
                "/Portalesp",
                "/request/searchRequest?mobile=mobile",
                res,
                _searchModel);

            requestsList = (List <Request>)response.Result;
            // RequestsObservable = new ObservableCollection<Request>(requestsList);
            Requests.AddRange(requestsList);
            //OnDialogClosed?.Invoke(this, new DialogResult { Success = true, Message = "send Data", RequestsPopup = Requests });
            // IsRefreshing = false;
            MessagingCenter.Send(new DialogResult()
            {
                RequestsPopup = Requests
            }, "PopUpData");
            await App.Current.MainPage.Navigation.PopPopupAsync(true);
        }
Beispiel #3
0
        public void HandlePublishedFilterRequestsEvent(CriteriaUsageEventPayload eventPayload)
        {
            if (eventPayload == null)
            {
                throw new ArgumentNullException("eventPayload");
            }

            if (log.IsDebugEnabled)
            {
                log.Debug("Received published filter requests event => " + eventPayload);
            }

            if (eventPayload.Criteria != null && eventPayload.Criteria.Count > 0)
            {
                var view = CollectionViewSource.GetDefaultView(Requests);
                view.Filter = (request) => ((IRequestForQuote)request).DoesRequestMatchFilter(eventPayload.Criteria);
            }
            else
            {
                Requests.Clear();
                Requests.AddRange(TodaysRequests);
                NotifyPropertyChanged("Requests");
                var view = CollectionViewSource.GetDefaultView(Requests);
                view.Filter = null;
            }
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="requests"></param>
        /// <param name="progCallback"></param>
        /// <param name="completeCallback"></param>
        public AsyncBatchRequest(ICollection <IRequest> requests, AsyncBatchProgressCallback progCallback, AsyncBatchCompletedCallback completeCallback)
        {
            requestCompletedCount = 0;
            requestCount          = requests.Count;

            ProgressUpdate += progCallback;
            BatchCompleted += completeCallback;

            foreach (IRequest req in requests)
            {
                ((BaseRequest)req).RequestCompleted += InternalRequestCompleted;
            }

            Requests.AddRange(requests);
        }
        protected void Read()
        {
            Requests.Clear();

            if (System.IO.File.Exists(FilePath))
            {
                using (var f = System.IO.File.OpenText(FilePath))
                {
                    using (var reader = new JsonTextReader(f))
                    {
                        var serializer = new JsonSerializer();
                        Requests.AddRange(serializer.Deserialize <List <EndorsementRequest> >(reader));
                    }
                }
            }
        }
Beispiel #6
0
        public void HandlePublishedNewRequestEvent(NewRequestForQuoteEventPayload eventPayload)
        {
            if (eventPayload == null)
            {
                throw new ArgumentNullException("eventPayload");
            }

            IRequestForQuote request = new RequestForQuoteImpl();

            request.Legs       = optionRequestParser.ParseRequest(eventPayload.NewRequestText.ToUpper(), request);
            request.Request    = eventPayload.NewRequestText;
            request.Status     = StatusEnum.PENDING;
            request.Identifier = -1;
            request.Client     = eventPayload.NewRequestClient;
            request.TradeDate  = DateTime.Today;
            if (request.Legs != null)
            {
                request.ExpiryDate = request.Legs[0].MaturityDate;
            }
            request.LotSize                 = 100;
            request.Multiplier              = 10;
            request.Contracts               = 100;
            request.NotionalFXRate          = 1;
            request.NotionalMillions        = 1;
            request.BookCode                = eventPayload.NewRequestBookCode;
            request.DayCountConvention      = 250.0;
            request.PremiumSettlementFXRate = 1;
            request.SalesCreditFXRate       = 1;
            request.IsOTC = true;
            request.SalesCreditPercentage         = 2;
            request.PremiumSettlementDaysOverride = 1;
            request.PremiumSettlementDate         = DateTime.Today.AddDays(request.PremiumSettlementDaysOverride);
            request.CalculatePricing(optionRequestPricer);

            TodaysRequests.Add(request);
            Requests.Clear();
            Requests.AddRange(TodaysRequests);
            NotifyPropertyChanged("Requests");

            // TODO - add all fields with their defaults.

            if (log.IsDebugEnabled)
            {
                log.Debug("Received and prcoessed published new request for quote => " + request);
            }
        }
Beispiel #7
0
        public void HandleGetTodaysRequestsEvent(EmptyEventPayload emptyPayload)
        {
            if (emptyPayload == null)
            {
                throw new ArgumentNullException("emptyPayload");
            }

            if (log.IsDebugEnabled)
            {
                log.Debug("Received request to reset grid to today's requests.");
            }

            var view = CollectionViewSource.GetDefaultView(Requests);

            view.Filter = null;

            Requests.Clear();
            Requests.AddRange(TodaysRequests);
            NotifyPropertyChanged("Requests");
        }