Exemplo n.º 1
0
        private void Load()
        {
            IsBusy = true;
            var quote = _quoteBuilder.GetQuote();

            MonthlyPayments = quote.MonthlyPayments;
            CompanyName     = quote.CompanyName;
            Created         = quote.Created.ToString("MM/dd/yyyy");
            IsBusy          = false;
        }
Exemplo n.º 2
0
        private void LoadMonthlyPayments()
        {
            IsBusy = true;
            var quote = _quoteBuilder.GetQuote();

            MonthlyPayments = quote.MonthlyPayments;
            IsBusy          = false;
        }
Exemplo n.º 3
0
        public async Task <bool> LoadRateOptions()
        {
            var quote = _quoteBuilder.GetQuote();

            if (quote.RateCards != null)
            {
                return(true);
            }
            PointsVisible      = true;
            PassThroughVisible = true;

            //call service to get rate card options for dealer
            try
            {
                _hudProvider.DisplayProgress("Getting Rate Cards");

                //Pass through Amount -  maintenance Amount
                //Maintenance Type - pick list

                var response = await _rateCardService.GetRateCards();

                if (response != null)
                {
                    if (response.ErrorStatusCode.IsErrorCode())
                    {
                        _hudProvider.Dismiss();
                        return(false);
                    }
                    else
                    {
                        RateCards = response.RateCardsLocal;
                        if (RateCards.Count() > 0)
                        {
                            //getting terms
                            var termList = new List <TermItem>();
                            foreach (int item in RateCards.SelectMany(x => x.Terms.Select(t => t.Term)).Distinct())
                            {
                                termList.Add(new TermItem {
                                    IsSelected = false, Term = item, TermDisplay = item.ToString() + " months"
                                });
                            }
                            Terms = termList;
                            Terms.OrderBy(m => m.Term);

                            //getting maintenance types
                            MaintenanceTypes = RateCards.SelectMany(x => x.MaintenanceTypes).GroupBy(p => p.MaintenanceTypeDescription).Select(g => g.First()).ToList();

                            //getting purchase options
                            PurchaseOptions = RateCards.SelectMany(x => x.PurchaseOptions).GroupBy(p => p.PurchaseOptionDesc).Select(g => g.First()).ToList();

                            //getting advance payments
                            AdvancePayments = RateCards.SelectMany(x => x.AdvancePayments).GroupBy(p => p.AdvancePaymentDescription).Select(g => g.First()).ToList();

                            MaxPoints          = RateCards.Max(rc => rc.AvailablePoints);
                            MaxEquipmentAmount = RateCards.Max(rc => rc.MaximumAmount);
                            MinEquipmentAmount = RateCards.Min(rc => rc.MinimumAmount);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                _hudProvider.Dismiss();
            }

            return(true);
        }