コード例 #1
0
        private Step InterpretCompleteQuoteFlag(QuoteHeader quoteHeader)
        {
            Step nextPageIndex;

            switch (quoteHeader.CompleteQuoteFlag)
            {
                case 1:
                    /* we are currently legally required to force all CA retrieves
                     * which didn't see the ITV question set back thru the quote flow */
                    if (this.BusinessLogic().QHeader.State.Equals("CA") &&
                        (this.BusinessLogic().QHeader.FormCode == 3) &&
                        (this.BusinessLogic().Structure.FoundationShape == null ||
                        this.BusinessLogic().Structure.FoundationShape == 0))
                    {
                        nextPageIndex = Step.IndicativeQuote;
                    }
                    else
                    {
                        nextPageIndex = Step.PremiumCustomization;
                    }
                    break;
                case 5:
                    nextPageIndex = Step.IndicativeQuote;
                    break;
                case 2:
                    nextPageIndex = Step.DNQ;
                    break;
                default:
                    {
                        UIServices uiSvc = new UIServices();
                        string partnerPhoneNumber = uiSvc.GetPartnerPhoneNumber(quoteHeader.PartnerId);

                        nextPageIndex = Step.InitialQuestions1;
                        this.ErrorMessage = "This quote cannot be retrieved at this time.  Please call " + partnerPhoneNumber + " to talk to a licensed " +
                                            "Customer Service Person and mention your Quote Number " + this.BusinessLogic().Quote.CompanysQuoteNumber + ".  We look forward to serving you.";
                    }
                    break;
            }

            return nextPageIndex;
        }
コード例 #2
0
        public AjaxResponse LoadQuoteFromHorizon(QuoteHeader quoteHeader)
        {
            ErrorMessage = string.Empty;
            InfoMessage = string.Empty;

            var response = new AjaxResponse { quoteHeader = quoteHeader };

            InitializeSessionHeaderForRetrieve(quoteHeader);

            this.QHeader.QualityGroup = QuoteServices.GetQualityGroup(qHeader, this.BusinessLogic().PropertyAddress.PostalCode);

            var quoteStatus = GetCompanysPolicyNumber(quoteHeader);

            //ITR#9394 - When Credit Card Authorization Failed, the user should be able to retrieve the quote
            // to continue to purchase the quote despite having a policy number assigned.
            if (DirectWebDAC.AllowRetrieveAfterDeclinedTransaction(qHeader.QuoteNumber))
            {
                quoteStatus = 0;
            }

            Step nextPageIndex;

            var retrieveStatus = ServiceInterface.CallRetrieveIQuoteService();
            if (quoteStatus != -1 && (retrieveStatus == 0 || retrieveStatus == -8))
            {
                DataBinder.RefreshDataObjects();

                nextPageIndex = InterpretCompleteQuoteFlag(quoteHeader);

                UpdateAgeOfClaimForRetrieve();

                SetCompleteQuoteFlagForRetrieve(quoteHeader);

                this.BusinessLogic().Quote.CompleteQuoteFlag = (short)quoteHeader.CompleteQuoteFlag;

                response.quoteHeader.TrackingId = DirectWebDAC.GetTrackingId(quoteHeader.QuoteNumber);

                DataBinder.SaveDataObjects();

                ServiceInterface.CallValidateAddressServiceForRetrieve();

                // check address dnqs again & make sure horizon didn't dnq this quote
                if (!RetrieveDNQ() && this.BusinessLogic().Quote.CompleteQuoteFlag != 2)
                {
                    RestoreQuoteHeader(response);
                    //ITR#8945 - Check Contact Customer Care Logic & Redirect to Page for complete quote flag.
                    if (!RetrieveContactCustomerCare())
                    {
                        DataBinder.SaveDefaultAddress();

                        ServiceInterface.CallCreditService();
                        ServiceInterface.CallDefaultService();
                        if(PartnerConfiguration != null)
                        {
                            DataBinder.SaveMarketingInfo(null, PartnerConfiguration);

                        }
                        else
                        {
                            DataBinder.SaveMarketingInfo();
                        }

                        DataBinder.SaveDataObjects();

                        this.BusinessLogic().Quote.PartnerId = qHeader.PartnerId;
                        this.BusinessLogic().Quote.RetrieveFlag = true;
                        this.BusinessLogic().Quote.AddressValidatedFlag = true;
                        this.BusinessLogic().Quote.PolicyEffectiveDate = Convert.ToDateTime(response.quoteHeader.PolicyEffectiveDate);
                        this.BusinessLogic().Quote.Save();

                        CheckExpiredQuote(quoteHeader, ref nextPageIndex);

                        //ITR#9651 Good Driver
                        //Set the AutoClaimsRequestID null in order to make a new call to auto claims service
                        if (quoteHeader.ExpiredQuote)
                        {
                            this.BusinessLogic().PrimaryPerson.AutoClaimsRequestID = null;
                            this.BusinessLogic().PrimaryPerson.Save();
                        }

                        GetUpdatedTRSInfoOnRetrieve();

                        ServiceInterface.CallRatingService();

                        ServiceInterface.FixIPropPhone();

                        if (ControlData.Count > 0)
                        {
                            foreach (var t in ControlData)
                            {
                                response.DataSource.Add(t);
                            }
                        }

                        ControlData.Clear();

                    }
                    else
                    {
                        response.NextPanel = AjaxPanel.ContactCustomerCare;
                        response.RedirectURL = "ContactCustomerCare.aspx";
                    }

                }
                else
                {
                    response.NextPanel = AjaxPanel.DNQ;
                }
            }
            else if (quoteStatus == -1 || retrieveStatus == 1)
            {
                var uiSvc = new UIServices();
                var partnerPhoneNumber = uiSvc.GetPartnerPhoneNumber(quoteHeader.PartnerId);

                nextPageIndex = Step.InitialQuestions1;
                ErrorMessage = "This quote cannot be retrieved at this time.  Please call " + partnerPhoneNumber + " to talk to a licensed " +
                               "Customer Service Person and mention your Quote Number " + this.BusinessLogic().Quote.CompanysQuoteNumber + ".  We look forward to serving you.";
            }
            else // horizon returned a random error code.
            {
                nextPageIndex = Step.InitialQuestions1;
                ErrorMessage = "There was a problem processing your request.  Please try again later.";
            }

            if (!string.IsNullOrEmpty(ErrorMessage))
            {
                if (nextPageIndex == Step.InitialQuestions2)
                {
                    response.NextPanel = AjaxPanel.Your_Address;
                    response.quoteHeader.LandingStep = "Your_Address";
                    response.RedirectURL = "BeginQuote.aspx";
                }
                else if (nextPageIndex == Step.InitialQuestions1)
                {
                    response.RedirectURL = "Welcome.aspx";
                }
                else
                {
                    response.RedirectURL = "BeginQuote.aspx";
                }

                response.errorMessage = ErrorMessage;
                response.errorOccured = true;
            }
            else
            {
                AjaxPanel nextPanel;

                switch (nextPageIndex)
                {
                    case Step.PremiumCustomization:
                        //ITR#8945 - Is ContactCustomerCare
                        if (quoteHeader.FormCode == 3 && IsContactCustomerCare)
                        {
                            nextPanel = AjaxPanel.ContactCustomerCare;
                        }
                        else
                        {
                            nextPanel = AjaxPanel.Coverage;
                        }
                        break;
                    case Step.DNQ:
                        nextPanel = AjaxPanel.DNQ;
                        break;
                    default:
                        if (quoteHeader.FormCode == 3)
                        {
                            nextPanel = AjaxPanel.Your_Address;
                        }
                        else if (quoteHeader.FormCode == 4)
                        {
                            nextPanel = AjaxPanel.About_You;
                        }
                        else if (quoteHeader.H06Ui_V2)
                        {
                            nextPanel = AjaxPanel.Condo_Information;
                        }
                        else if (quoteHeader.H04Ui_V2)
                        {
                            nextPanel = AjaxPanel.About_You;
                        }
                        else
                        {
                            throw new BusinessLogicException("Unknown starting point.");
                        }

                        break;
                }

                response.NextPanel = nextPanel;

            }

            response.quoteHeader.LandingStep = response.NextPanel.ToString();
            return response;
        }