コード例 #1
0
        public void TestEmail270()
        {
            const int emailNum = 270;

            var expectedQuoteHeader = new QuoteHeader(
                startIndex: 4,
                endIndex: 6,
                text: new List <string>
            {
                "On Tue, Jun 3, 2014 at 11:17 AM, asd asd <",
                "*****@*****.**> wrote:"
            }
                );

            var expectedInnerQuoteHeader = new QuoteHeader(
                startIndex: 4,
                endIndex: 5,
                text: new List <string>
            {
                "In reply to:"
            }
                );

            var content = Parser.Parse(GetResourceText(emailNum));

            Assert.Equal(expectedQuoteHeader, content.Header);
            Assert.Equal(expectedInnerQuoteHeader, content.Quote?.Header);
        }
コード例 #2
0
        private void Btn_AddQuote_Click(object sender, RoutedEventArgs e)
        {
            QuoteHeader headeritem = new QuoteHeader();

            headeritem.jobno   = txt_jobno.Text;
            headeritem.qt_date = txt_qtdate.Text;
            headeritem.cust    = txt_cust.Text;
            //headeritem.cust_contact = "NULL";
            //headeritem.cust_phone = "NULL";
            //headeritem.cust_email = "NULL";
            headeritem.loc            = txt_loc.Text;
            headeritem.salesman       = txt_salesman.Text;
            headeritem.days_est       = Int32.Parse(txt_daysest.Text);
            headeritem.status         = txt_status.Text;
            headeritem.jobtype        = txt_jobtype.Text;
            headeritem.pipe_line_size = txt_pipelinesize.Text;
            headeritem.pipe_length    = txt_pipelength.Text;
            headeritem.pressure       = txt_pressure.Text;
            headeritem.endclient      = txt_endclient.Text;
            headeritem.supervisor     = txt_supervisor.Text;
            //headeritem.est_start_date = DateTime.Parse(txt;
            //headeritem.est_stop_date = "NULL";
            headeritem.value = 0;
            main_repository.addNewQuoteHeaderItem(headeritem);
            main_vm.quote_headers = main_vm.LoadQuoteHeaderData();
            MessageBox.Show("Quote Added");
        }
コード例 #3
0
 protected void Check(int emailNum, QuoteHeader expectedQuoteHeader)
 {
     using (var stream = GetResourceStream(emailNum))
     {
         var content = _parser.Value.Parse(stream);
         Assert.Equal(expectedQuoteHeader, content.Header);
     }
 }
コード例 #4
0
        public void TestEmail(int emailNum, int startIndex, int endIndex, params string[] lines)
        {
            var text = lines.ToList();

            var expected = new QuoteHeader(startIndex, endIndex, text);

            Check(emailNum, expected);
        }
コード例 #5
0
        private void QHeader_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //Make the jobno column non editable
            QHeader.Columns[1].IsReadOnly = true;

            // Get selected Row
            if (QHeader.SelectedItem != null)
            {
                QuoteHeader temp = (QuoteHeader)QHeader.SelectedItem;
                //MessageBox.Show("QHeader Selection Changed...JobNo now: " + temp.jobno);

                // Get selected Row cell base on which the datagrid will be changed
                try
                {
                    this.jobno    = temp.jobno;
                    main_vm.Jobno = temp.jobno;
                    this.est_days = temp.days_est;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }


                //Check if everything is OK
                if (jobno == null || jobno == string.Empty)
                {
                    return;
                }
                else
                {
                    //Change QItems based on Row
                    //main_vm.updateQuoteItemsByJob(this.jobno);

                    //Get the number of Tab Items in the database
                    int tab_count_fromDB = main_vm.getCountOfTabItems(temp.jobno);
                    //MessageBox.Show("DB Tab Count: " + main_vm.getCountOfTabItems(temp.jobno));
                    //Remove all tabs except Day 1 and + Tab
                    if (tab_count_fromDB > 2)
                    {
                        //MessageBox.Show("Tab Matching" + tab_count_fromDB + " | " + (_tabItems.Count - 1));
                        while ((_tabItems.Count - 1) < tab_count_fromDB)
                        {
                            this.AddTabItem();
                        }
                        // bind tab control
                        //tabDynamic.DataContext = _tabItems;
                    }

                    //Change QItems based on Row
                    main_vm.updateQuoteItemsByJob(this.jobno);

                    // Update selected tab child
                    getTabItemGrid((TabItem)tabDynamic.SelectedItem, tabDynamic.SelectedIndex);
                }
            }
        }
コード例 #6
0
        public static Context.IBusinessLogic Get(QuoteHeader qHeader, IIQuoteConfiguration config)
        {
            System.Diagnostics.Debug.Assert(qHeader.SessionId > 0, "You need to have a session ID before you get an instance of the business logic because of the cache.");

            if (qHeader.FormCode == 3 || qHeader.FormCode == 2)
            {
                return GetBusinessLogic(qHeader);
            }
            return GetLegacyBusinessLogic(qHeader);
        }
コード例 #7
0
 private void QHeader_CurrentCellChanged(object sender, EventArgs e)
 {
     if (quoteHeaderBeingEdited != null)
     {
         //MessageBox.Show(quoteHeaderBeingEdited.jobno + " is now being updated in the database!");
         main_vm.UpdateHeaderItem(quoteHeaderBeingEdited.jobno);
         quoteHeaderBeingEdited = null;
         // MessageBox.Show("Quoted updated successfully!");
     }
 }
コード例 #8
0
        public object Delete(QuoteHeader deleted)
        {
            string msgError = "";
            bool   result   = repository.Remove(deleted, ref msgError);

            object json = new
            {
                success = result,
                message = msgError
            };

            return(json);
        }
コード例 #9
0
        public void UpdateHeaderItem(string jobno)
        {
            //Find QuoteHeader for that jobno
            QuoteHeader qh = new QuoteHeader();

            foreach (QuoteHeader header in quote_headers)
            {
                if (header.jobno == jobno)
                {
                    qh = header;
                    break;
                }
            }

            try
            {
                connection = new SQLiteConnection(connection_String);
                connection.Open();
                cmd = connection.CreateCommand();

                cmd.Parameters.Add(new SQLiteParameter("@jobno", jobno));
                cmd.Parameters.Add(new SQLiteParameter("@qt_date", qh.qt_date));
                cmd.Parameters.Add(new SQLiteParameter("@cust", qh.cust));
                cmd.Parameters.Add(new SQLiteParameter("@cust_contact", qh.cust_contact));
                cmd.Parameters.Add(new SQLiteParameter("@cust_phone", qh.cust_phone));
                cmd.Parameters.Add(new SQLiteParameter("@cust_email", qh.cust_email));
                cmd.Parameters.Add(new SQLiteParameter("@loc", qh.loc));
                cmd.Parameters.Add(new SQLiteParameter("@salesman", qh.salesman));
                cmd.Parameters.Add(new SQLiteParameter("@days_est", qh.days_est));
                cmd.Parameters.Add(new SQLiteParameter("@status", qh.status));
                cmd.Parameters.Add(new SQLiteParameter("@pipe_line_size", qh.pipe_line_size));
                cmd.Parameters.Add(new SQLiteParameter("@pipe_length", qh.pipe_length));
                cmd.Parameters.Add(new SQLiteParameter("@pressure", qh.pressure));
                cmd.Parameters.Add(new SQLiteParameter("@endclient", qh.endclient));
                cmd.Parameters.Add(new SQLiteParameter("@supervisor", qh.supervisor));
                cmd.Parameters.Add(new SQLiteParameter("@est_start_date", qh.est_start_date));
                cmd.Parameters.Add(new SQLiteParameter("@est_stop_date", qh.est_stop_date));

                cmd.CommandText = String.Format("UPDATE QTE_HDR SET qt_date=(@qt_date), cust=(@cust), cust_contact=(@cust_contact), cust_phone=(@cust_phone),cust_email=(@cust_email), loc=(@loc), salesman=(@salesman), days_est=(@days_est), status=(@status), pipe_line_size=(@pipe_line_size), pipe_length=(@pipe_length), pressure=(@pressure), endclient=(@endclient), supervisor=(@supervisor), est_start_date=(@est_start_date), est_stop_date=(@est_stop_date) WHERE jobno=(@jobno)");
                cmd.ExecuteNonQuery();
                connection.Close();

                quote_headers = LoadQuoteHeaderData();
            }
            catch (Exception Ex)
            {
                System.Windows.MessageBox.Show(Ex.Message);
            }
        }
コード例 #10
0
        public object Put(QuoteHeader updated)
        {
            object json;

            try
            {
                string      messageError = "";
                QuoteHeader putting      = repository.UpdateHeader(updated, ref messageError);

                if (putting != null)
                {
                    json = new
                    {
                        total   = 1,
                        data    = putting,
                        success = true
                    };
                }
                else
                {
                    json = new
                    {
                        message = messageError,
                        success = false
                    };
                }
            }
            catch (Exception ex)
            {
                ex = ExceptionExtensions.GetOriginalException(ex);

                LogManager.Write("ERROR:" + Environment.NewLine + "\tMETHOD = " + this.GetType().FullName + "." + MethodBase.GetCurrentMethod().Name + Environment.NewLine + "\tMESSAGE = " + ex.Message);

                json = new
                {
                    message = ex.Message,
                    success = false
                };
            };

            return(json);
        }
コード例 #11
0
        public object Post(QuoteHeader added)
        {
            object json;
            string messageError = "";

            try
            {
                QuoteHeader posted = repository.Add(added, ref messageError);

                if (posted != null)
                {
                    json = new
                    {
                        total   = 1,
                        data    = posted,
                        success = true
                    };
                }
                else
                {
                    json = new
                    {
                        message = messageError,
                        success = false
                    };
                };
            }
            catch (Exception ex)
            {
                LogManager.Write("ERROR:" + Environment.NewLine + "\tMETHOD = " + this.GetType().FullName + "." + MethodBase.GetCurrentMethod().Name + Environment.NewLine + "\tMESSAGE = " + ex.Message);

                object error = new { message = ex.Message };

                json = new
                {
                    message = ex.Message,
                    success = false
                };
            };

            return(json);
        }
コード例 #12
0
ファイル: RecTests.cs プロジェクト: feature23/QuoteParser.NET
        public void TestEmail6510()
        {
            const int emailNum = 6510;

            var expectedQuoteHeader1 = new QuoteHeader(
                startIndex: 2,
                endIndex: 3,
                text: new List <string>
            {
                "-----Original Message-----"
            }
                );

            var expectedQuoteHeader2 = new QuoteHeader(
                startIndex: 0,
                endIndex: 4,
                text: new List <string>
            {
                "From: \"text text (text)\" <*****@*****.**>",
                "Sent: Friday, February 13, 2015, 6:44:58 PM",
                "To: ",
                "Subject: [text] Update: [text-text text] text-123456"
            }
                );

            var expectedQuoteHeader3 = new QuoteHeader(
                startIndex: 4,
                endIndex: 5,
                text: new List <string>
            {
                "##- Please type your reply above this line -##  "
            }
                );

            using (var stream = GetResourceStream(emailNum))
            {
                var content = Parser.Parse(stream);
                Assert.Equal(expectedQuoteHeader1, content.Header);
                Assert.Equal(expectedQuoteHeader2, content.Quote?.Header);
                Assert.Equal(expectedQuoteHeader3, content.Quote?.Quote?.Header);
            }
        }
コード例 #13
0
        private void QHeader_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Get selected Row
            //DataRowView row = (DataRowView) QHeader.SelectedItem;
            //MessageBox.Show(row.Row["jobno"].ToString());
            if (QHeader.SelectedItem != null)
            {
                QuoteHeader temp = (QuoteHeader)QHeader.SelectedItem;
                //MessageBox.Show("QHeader Selection Changed...JobNo now: " + temp.jobno);

                // Get selected Row cell base on which the datagrid will be changed
                try
                {
                    this.jobno    = temp.jobno;
                    this.cust     = temp.cust;
                    this.est_days = temp.days_est;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }


                //Check if everything is OK
                if (jobno == null || jobno == string.Empty)
                {
                    return;
                }
                else
                {
                    //Change QItems based on Row
                    // OUTDATED ---GetQuoteItemsData(this.jobno);
                    main_vm.updateQuoteItemsByJob(this.jobno);

                    // Update tab child
                    //  MessageBox.Show(this.tabDynamic.GetChildObjects().ToString());
                    getTabItemGrid((TabItem)tabDynamic.SelectedItem, tabDynamic.SelectedIndex);
                }
            }
        }
コード例 #14
0
        public AjaxResponse ReCalculate(QuoteHeader qHeader, QuoteData qData)
        {
            this.QHeader = qHeader;
            this.QData = qData;

            // This is to fix an issue where walmart validates email and user changes it.
            if (this.QHeader.PartnerId.Equals(2319))
            {
                QuoteServices quoteServices = new QuoteServices();
                if (!quoteServices.ValidateEmailVerificationCode(this.QHeader.QuoteNumber, QData.cvgPartnerDiscount))
                {

                    if (QData.cvgPartnerDiscount != null)
                    {
                        this.QHeader.OLSStatus = OlsStatusPaperlessStoredId;
                        this.QData.cvgPartnerDiscount = String.Empty;
                    }
                    else
                    {
                        this.QHeader.OLSStatus = OlsStatusPaperlessStoredIdNegative;
                    }
                }
            }

            switch (QHeader.FormCode)
            {
                case 3:
                    if (QData.cvgDeductible != null)
                    {
                        UpdateWindHailOrHurricaneValues(QData.cvgDeductible);
                    }
                    break;
                case 4:
                    if (QData.propertyCoverageDeductible != null)
                    {
                        UpdateWindHailOrHurricaneValues(QData.propertyCoverageDeductible);
                    }
                    break;
            }

            this.DataBinder.BindCoverageData();

            this.BusinessLogic().Quote.ApexBillingOption = this.QHeader.ApexBillingOption;
            this.BusinessLogic().Quote.Save();
            // do rating
            this.ServiceInterface.CallRatingService();

            //call logging ITR#5549
            LogRateChangeEvent(2);

            DoCompleteQuoteSave();

            // return response
            AjaxResponse response = new AjaxResponse();

            //ITR#8181 Apex
            if (qHeader.IsApexState)
            {
                response.WindoidContentList = QuoteServices.GetQuoteSummary(this.BusinessLogic().Header, this.BusinessLogic().Quote, this.BusinessLogic().Coverage);
                response.WindoidContent = QuoteServices.GetQuoteSummaryFromList(response.WindoidContentList, quote.ApexBillingOption);
            }
            else
            {
                response.WindoidContent = QuoteServices.GetQuoteSummary(this.BusinessLogic().Header, this.BusinessLogic().Quote, this.BusinessLogic().Coverage, this.BusinessLogic().Structure.PropertyType, this.BusinessLogic().QHeader.H04Ui_V2);
            }
            response.quoteHeader = this.BusinessLogic().QHeader;
            response.NextPanel = AjaxPanel.Coverage;

            return response;
        }
コード例 #15
0
        /// <summary>
        /// Because a Policy Number is created and stored in the database (HomesiteWeb..hs_quote) when the purchase button is clicked but before
        /// the purchase is successful, we cannot use only the existence of a Policy Number as indication of a purchased policy.  QuoteStatus of
        /// 6 will indicate a successful purchase.  Both will be checked in order to verify that this quote has a purchased policy.
        /// Ref. ITR#9394
        /// 4 is Early Cash successful and also indicates purchased policy while Batch is running
        /// </summary>
        /// <param name="qHeader">QuoteHeader with a populated SessionId property</param>
        /// <returns></returns>
        public bool PurchasedPolicy(QuoteHeader qHeader)
        {
            this.BusinessLogic().Quote =
                Quote.GetQuote(this.BusinessLogic().QHeader.SessionId);

            if (((this.BusinessLogic().Quote.QuoteStatus != 4)
                && (this.BusinessLogic().Quote.QuoteStatus != 6)) // ITR#9394 Adding this. Quote Status of 6 means successful purchase
                || (string.IsNullOrEmpty(this.BusinessLogic().Quote.CompanysPolicyNumber))) // May have Policy Number without successful purchase
                return false;
            else
                return true;
        }
コード例 #16
0
        public AjaxResponse SavePurchaseInfo(QuoteHeader qHeader, PurchaseData pData)
        {
            #region Legacy Business Logic Ported code
            this.PData = pData;
            this.PurchaseProcessor.SavePhoneNumber();
            this.PurchaseProcessor.SaveMailingAddress();
            this.PurchaseProcessor.SaveMortgageInfo();
            this.PurchaseProcessor.SaveConsentToRate(out this.ErrorMessage);
            this.PurchaseProcessor.SavexWind(out this.ErrorMessage); // ITR#7684
            this.PurchaseProcessor.SaveConsentToRateAndxWind(out this.ErrorMessage); // ITR#7684
            this.PurchaseProcessor.SavePaymentDetails();
            this.DataBinder.SaveDataObjects();
            #endregion

            this.Log("SavePurchaseInfo - before saving Quote... Inspection Result value = " + this.BusinessLogic().Quote.InspectionResult.ToString());
            return this.SaveQuote();
        }
コード例 #17
0
        private void CheckExpiredQuote(QuoteHeader quoteHeader, ref Step nextPageIndex)
        {
            var policyEffectiveDate = DateTime.Parse(this.BusinessLogic().Coverage.PolicyEffDate);
            var expirationDate = (DateTime)this.BusinessLogic().Quote.ExpirationDt;

            var today = DateTime.Today;
            var ts1 = expirationDate - today;
            var ts2 = policyEffectiveDate - today;

            if ((ts1.Days <= 0) || (ts2.Days <= 0))
            {
                var sessionAdapter = new Homesite.IQuote.Data.SessionDataProviderTableAdapters.Session();

                try
                {
                    sessionAdapter.UpdateExpiredQuote(quoteHeader.SessionId);
                }
                catch (Exception ex)
                {
                    throw new SystemException("Error updating expired quote.", ex);
                }

                if (this.BusinessLogic().AdditionalCoverage.Ho0015Flag != null &&
                    this.BusinessLogic().AdditionalCoverage.Ho0015Flag == 1)
                {
                    var hshohhFlagProvider =
                        new Homesite.IQuote.Data.ISODataProviderTableAdapters.TUScoreRateTableAdapter();

                    // RI Mitigation -- added the issue date parameter
                    int? grandFatherFlagHooo15 = 0;
                    int? avlForSelectHooo15 = 0;
                    hshohhFlagProvider.GetHSHOHHFlags(quoteHeader.State, "HO0015", Convert.ToDateTime(quoteHeader.OriginalQuoteDate), ref grandFatherFlagHooo15, ref avlForSelectHooo15);
                    //There is no need to check grandfather flag as it is expired quote
                    if (avlForSelectHooo15 == 1)
                    {
                        this.BusinessLogic().AdditionalCoverage.Ho0015Flag = 1;
                        this.BusinessLogic().AdditionalCoverage.HH0015Flag = 0;
                    }
                    else
                    {
                        this.BusinessLogic().AdditionalCoverage.Ho0015Flag = 0;
                        this.BusinessLogic().AdditionalCoverage.HH0015Flag = 1;
                    }
                }

                if (quoteHeader.State.Equals("CA"))
                    SetCAEndoresementsOnRetrieve(quoteHeader);

                nextPageIndex = Step.InitialQuestions2;
                quoteHeader.ExpiredQuote = true;

                if (qHeader.FormCode == 1)
                {
                    this.BusinessLogic().Header.FormNumber = 4;
                    this.BusinessLogic().Quote.FormNumber = "4";
                    this.BusinessLogic().Header.Save();
                    this.BusinessLogic().Quote.Save();
                }
            }
        }
コード例 #18
0
        public object GetAll()
        {
            try
            {
                var queryValues = Request.RequestUri.ParseQueryString();

                int page  = Convert.ToInt32(queryValues["page"]);
                int start = Convert.ToInt32(queryValues["start"]);
                int limit = Convert.ToInt32(queryValues["limit"]);
                int id    = Convert.ToInt32(queryValues["id"]);
                int orden = Convert.ToInt32(queryValues["orden"]);

                string filterDateField = queryValues["FilterDateField"];
                string strDateFrom     = queryValues["DateFrom"];
                string strDateTo       = queryValues["DateTo"];
                int    roleId          = Convert.ToInt32(queryValues["Role"]);

                string  strFilterBalance = queryValues["FilterBalance"];
                Decimal filterBalance    = String.IsNullOrEmpty(strFilterBalance) ? 0 : Convert.ToDecimal(strFilterBalance);

                string FilterShowWithInvoice = queryValues["FilterShowWithInvoice"];

                FilterShowWithInvoice = !String.IsNullOrEmpty(FilterShowWithInvoice) ? FilterShowWithInvoice : "All";

                #region Configuramos el orden de la consulta si se obtuvo como parametro
                string strOrder = !string.IsNullOrWhiteSpace(queryValues["sort"]) ? queryValues["sort"] : "";
                strOrder = strOrder.Replace('[', ' ');
                strOrder = strOrder.Replace(']', ' ');

                Sort sort;

                if (!string.IsNullOrWhiteSpace(strOrder))
                {
                    sort = JsonConvert.DeserializeObject <Sort>(strOrder);
                }
                else
                {
                    sort = new Sort();
                }
                #endregion

                #region Configuramos el filtro de la consulta si se obtuvo como parametro
                string strFilter = !string.IsNullOrWhiteSpace(queryValues["filter"]) ? queryValues["filter"] : "";
                strFilter = strFilter.Replace('[', ' ');
                strFilter = strFilter.Replace(']', ' ');

                Filter filter;

                if (!string.IsNullOrWhiteSpace(strFilter))
                {
                    filter = JsonConvert.DeserializeObject <Filter>(strFilter);
                }
                else
                {
                    filter = new Filter();
                }
                #endregion Configuramos el filtro de la consulta si se obtuvo como parametro

                string query = !string.IsNullOrWhiteSpace(queryValues["query"]) ? queryValues["query"] : "";

                int totalRecords = 0;

                if (id == 0)
                {
                    object json;
                    string msgError = "";
                    var    lista    = repository.GetList(query, filter, sort, page, start, limit, ref totalRecords, ref msgError);

                    json = new
                    {
                        total   = totalRecords,
                        data    = lista,
                        success = true
                    };

                    return(json);
                }
                else
                {
                    string      msgError = "";
                    QuoteHeader estatus  = repository.Get(id, ref msgError);

                    object json = new
                    {
                        data    = estatus,
                        success = true,
                        message = msgError
                    };

                    return(json);
                }
            }
            catch (Exception ex)
            {
                LogManager.Write("ERROR:" + Environment.NewLine + "\tMETHOD = " + this.GetType().FullName + "." + MethodBase.GetCurrentMethod().Name + Environment.NewLine + "\tMESSAGE = " + ex.Message);

                object error = new { message = ex.Message };

                object json = new
                {
                    message = ex.Message,
                    success = false
                };

                return(json);
            }
        }
コード例 #19
0
        public void TestEmail(int emailNum, int startIndex, int endIndex)
        {
            var expected = new QuoteHeader(startIndex, endIndex, new List <string>());

            Check(emailNum, expected);
        }
コード例 #20
0
 public static Context.IBusinessLogic Get(QuoteHeader qHeader)
 {
     System.Diagnostics.Debug.Assert(qHeader.SessionId > 0, "You need to have a session ID before you get an instance of the business logic.");
     return GetBusinessLogic(qHeader);
 }
コード例 #21
0
 private void SetCompleteQuoteFlagForRetrieve(QuoteHeader qHeader)
 {
     #region complete quote flag switching
     // Fix for KMT Ticket 5564
     if (qHeader.CompleteQuoteFlag == 1) //Complete Quote
         this.BusinessLogic().Quote.CompleteQuoteFlag = 1;
     else if (qHeader.CompleteQuoteFlag == 2) //DNQ
         this.BusinessLogic().Quote.CompleteQuoteFlag = 2;
     else if (qHeader.CompleteQuoteFlag == 5) //Incomplete Quote
         this.BusinessLogic().Quote.CompleteQuoteFlag = -1;
     #endregion
 }
コード例 #22
0
        private void SetCAEndoresementsOnRetrieve(QuoteHeader qHeader)
        {
            Homesite.IQuote.Data.ISODataProviderTableAdapters.TUScoreRateTableAdapter hshohhFlagProvider = new Homesite.IQuote.Data.ISODataProviderTableAdapters.TUScoreRateTableAdapter();

            // RI Mitigation
            //System.Nullable<byte> grandFatherFlag = 0, avlForSelect = 0;
            System.Nullable<int> grandFatherFlag = 0, avlForSelect = 0;
            hshohhFlagProvider.GetHSHOHHFlags(qHeader.State, "HH0015", Convert.ToDateTime(qHeader.OriginalQuoteDate), ref grandFatherFlag, ref avlForSelect);
            if (avlForSelect == 1)
            {
                this.BusinessLogic().AdditionalCoverage.HH0015Flag = 1;
                this.BusinessLogic().AdditionalCoverage.Ho0015Flag = 0;
                // set flag to 2 in CA table.

                Homesite.IQuote.Data.ISODataProviderTableAdapters.TUScoreRateTableAdapter CAHH0015QueryAdapter = new Homesite.IQuote.Data.ISODataProviderTableAdapters.TUScoreRateTableAdapter();
                CAHH0015QueryAdapter.SetCAPackageQuoteFlag(qHeader.QuoteNumber, null);
            }
        }
コード例 #23
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;
        }
コード例 #24
0
        private void InitializeSessionHeaderForRetrieve(QuoteHeader qHeader)
        {
            //BusinessLogicSessionDataBinder data = new BusinessLogicSessionDataBinder();
            //this.Accept<BusinessLogicSessionDataBinder>(data);

            // set up the header in the session DB
            this.BusinessLogic().Header.RetrieveDateOfBirth = qHeader.RetrieveDateOfBirth;
            this.BusinessLogic().Header.RetrieveZipCode = qHeader.Zip;
            this.BusinessLogic().Header.PartnerID = qHeader.PartnerId;
            this.BusinessLogic().Header.QuoteNumber = qHeader.QuoteNumber;
            this.BusinessLogic().Header.isRetrieve = true;
            this.BusinessLogic().Header.ProgramType = 0;
            this.BusinessLogic().Header.UnderwritingNumber = 0;
            this.BusinessLogic().Header.RatingVersion = 0;
            this.BusinessLogic().Header.SubProgramType = 0;
            this.BusinessLogic().Header.RetroFlag = 0;
            this.BusinessLogic().Header.Last_PageVisit_ID = 6;
            this.BusinessLogic().Header.IsApexState = false;
            this.BusinessLogic().Header.IsXWindState = false;
            this.BusinessLogic().Header.Save();
        }
コード例 #25
0
        /// <summary>
        /// Creates a ControlDataSource object containing the values of the wind/hail/hurricane options. This is used in multirate
        /// process so each deductible can be calculated with the correct default selection.
        /// 
        /// The logic of local variable "ATerritoryOrBCEG" was duplicated from CoveragesDataSourceProvider.cs, which is the origination
        /// of the "GetWindHailDropdown" logic.
        /// </summary>
        /// <param name="quoteHeader">User-value container</param>
        /// <param name="coverage">coverage data value container</param>
        /// <param name="abOutputs">address broker value container</param>
        /// <returns>ControlDataSource - only to be used w/in ProcessMultirate()</returns>
        private ControlDataSource GetWindHailDataSource(QuoteHeader quoteHeader, Coverage coverage, AddressBrokerOutput abOutputs)
        {
            short? ATerritoryOrBCEG = (quoteHeader.State == "GA") && (abOutputs.BuildingCodeEffectivenessGradeCd != null)
                    ? (short?)Convert.ToInt32(abOutputs.BuildingCodeEffectivenessGradeCd)
                    : abOutputs.ATerritory;

            DataTable dtWindHail = DirectWebDAC.GetWindHailDropdown(
                quoteHeader.State,
                quoteHeader.ProgramType,
                quoteHeader.FormCode,
                abOutputs.WindPool,
                quoteHeader.RatingVersion,
                (int) abOutputs.ShoreLineDistance,
                ATerritoryOrBCEG,
                Convert.ToInt32(abOutputs.RatingTerritory),
                coverage.PolicyEffDate,
                string.IsNullOrEmpty(quoteHeader.OriginalQuoteDate) == false ? DateTime.Parse(quoteHeader.OriginalQuoteDate) : DateTime.Now,
                abOutputs.LandSlide,
                null,
                (decimal) coverage.CovAAmount, Convert.ToInt32(abOutputs.GridId ?? 0));

            if (dtWindHail != null)
            {
                return new ControlDataSource(dtWindHail, "Deductible", "Deductible");
            }

            return null;
        }
コード例 #26
0
 public ConsumerWebBusinessLogic(QuoteHeader qHeader, QuoteData qData)
     : this(qHeader)
 {
     this.qData = qData;
 }
コード例 #27
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;
        }
コード例 #28
0
        public QuoteData GetValuesFromSession(QuoteHeader qHeader)
        {
            this.BusinessLogic().QHeader = qHeader;

            return this.DataBinder.SessionDatabaseToQuoteData();
        }
コード例 #29
0
 public static Context.IBusinessLogic Get(QuoteHeader qHeader, QuoteData qData)
 {
     return GetBusinessLogic(qHeader, qData);
 }
コード例 #30
0
        //private void GetUpdatedTUInfoOnRetrieve()
        //{
        //    //Check to see if TU record available in the rating DB,
        //    Homesite.IQuote.ISOBroker.ISOProvider ISORating = new Homesite.IQuote.ISOBroker.ISOProvider();
        //    int RequestSeqNumber = 0;
        //    string CreditScore = "";
        //    int Noofmatches = 0;
        //    int requestId = this.IQuote().PrimaryPerson.TransUnionRequestID == null ? 0 : (int)this.IQuote().PrimaryPerson.TransUnionRequestID;
        //    //try
        //    //{
        //        // ITR#3855 Product Template 2010 change of signature
        //        // All calls to StoreTUScoreInRatingDB and GetLatestTUInfo are being commented out
        //        // as per Gaurav's directive because the logic has been moved elsewhere
        //        //string reasonCode1 = String.Empty;
        //        //string reasonCode2 = String.Empty;
        //        //string reasonCode3 = String.Empty;
        //        //string reasonCode4 = String.Empty;
        //        //ISORating.GetLatestTUInfo(requestId, out RequestSeqNumber, out CreditScore, out Noofmatches, out reasonCode1, out reasonCode2, out reasonCode3, out reasonCode4);
        //    //}
        //    //catch (Exception ex)
        //    //{
        //    //    this.ErrorMessage = "There was a problem processing your request.  Please try again later.";
        //    //}
        //    if (CreditScore.Trim().Equals(""))
        //        CreditScore = "0";
        //    //try
        //    //{
        //        // ITR#3855 Product Template 2010 change of signature
        //        // All calls to StoreTUScoreInRatingDB and GetLatestTUInfo are being commented out
        //        // as per Gaurav's directive because the logic has been moved elsewhere
        //    //    string reasoncode1 = String.Empty;
        //    //    string reasoncode2 = String.Empty;
        //    //    string reasoncode3 = String.Empty;
        //    //    string reasoncode4 = String.Empty;
        //    //    ISORating.StoreTUScoreInRatingDB(requestId, int.Parse(CreditScore), Noofmatches, reasoncode1, reasoncode2, reasoncode3, reasoncode4);
        //    //}
        //    //catch (Exception ex)
        //    //{
        //    //    this.ErrorMessage = "There was a problem processing your request.  Please try again later.";
        //    //}
        //}
        private static System.Nullable<short> GetCompanysPolicyNumber(QuoteHeader qHeader)
        {
            System.Nullable<short> intQuoteStatus = 0;
            Homesite.IQuote.Data.LookupDataProviderTableAdapters.QueriesTableAdapter qtd =
                new Homesite.IQuote.Data.LookupDataProviderTableAdapters.QueriesTableAdapter();

            qtd.GetCompanysPolicyNumber(qHeader.QuoteNumber, ref intQuoteStatus);
            return intQuoteStatus;
        }
コード例 #31
0
        protected void Check(int emailNum, QuoteHeader expectedQuoteHeader)
        {
            var content = _parser.Value.Parse(GetResourceText(emailNum));

            Assert.Equal(expectedQuoteHeader, content.Header);
        }
コード例 #32
0
 public string GetScheduleDetails(QuoteHeader QHeader)
 {
     return this.PurchaseProcessor.GetInstallmentSchedule(QHeader);
 }
コード例 #33
0
        public ConsumerWebBusinessLogic(QuoteHeader qHeader, IQuoteConfiguration config)
        {
            this.qHeader = qHeader;
            this.controlData = new List<ControlDataSource>();

            DataBinder = new BusinessLogicSessionDataBinder();
            DNQInterface = new BusinessLogicDNQInterface();
            ServiceInterface = new BusinessLogicServiceInterface();
            PurchaseProcessor = new BusinessLogicPurchaseProcessor();
            ABTestInterface = new BusinessLogicABTestInterface();
            ContactCustomerCareProcessor = new BusinessLogicCustCareProcessor();
            MultiRateProcessor = new BusinessLogicMultirateProcessor(ServiceInterface, false);
            PartnerConfiguration = config;

            this.Accept(DataBinder);
            this.Accept(DNQInterface);
            this.Accept(ServiceInterface);
            this.Accept(PurchaseProcessor);
            this.Accept(ABTestInterface);
            this.Accept(ContactCustomerCareProcessor);
            this.Accept(MultiRateProcessor);
        }
コード例 #34
0
 private static Context.IBusinessLogic GetBusinessLogic(QuoteHeader qHeader)
 {
     TimerCache.StaticCollection.SaveSessionDateTime(qHeader.SessionId);
     return BusinessLogicCache.StaticCollection.GetSessionBusinessLogic(qHeader);
 }
コード例 #35
0
 private void QHeader_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
 {
     quoteHeaderBeingEdited = e.Row.Item as QuoteHeader;
 }
コード例 #36
0
 private static Context.IBusinessLogic GetLegacyBusinessLogic(QuoteHeader qHeader)
 {
     return new LegacyConsumerBusinessLogic<ProgressiveBusinessLogic>(qHeader);
 }
コード例 #37
0
 public QuoteData GetDefaultValues(QuoteHeader qHeader)
 {
     throw new NotImplementedException();
 }
コード例 #38
0
        public AjaxResponse Purchase(QuoteHeader qHeader, PurchaseData pData)
        {
            //ITR#7841 Horison Audits - Web 2.0 Time-out
            AjaxResponse response = new AjaxResponse();
            if (Convert.ToDateTime(DataBinder.QHeader.PolicyEffectiveDate) <= DateTime.Today)
            {

                response.quoteHeader = qHeader;
                response.quoteHeader.SystemDate = DateTime.Today.ToString();
                response.quoteHeader.ExpiredQuote = true;
                response.quoteHeader.IsRetrieve = false;
                if (qHeader.FormCode == 3)
                {
                    response.NextPanel = AjaxPanel.Your_Address;
                    response.quoteHeader.LandingStep = "Your_Address";
                    response.RedirectURL = "BeginQuote.aspx";
                }
                else if (qHeader.FormCode == 6)
                {
                    response.NextPanel = AjaxPanel.Condo_Information;
                    response.RedirectURL = "iQuote.aspx";
                }
                else if (qHeader.FormCode == 4)
                {
                    response.NextPanel = AjaxPanel.About_You;
                    response.RedirectURL = "iQuote.aspx";
                }

            }
            else
            {

                // ITR#7455 Adding Logging for DwellingUseCd and EstimatedReplCost.
                string logDwellingMessage;
                if (this.DataBinder.Structure.DwellingUseCd == null)
                {
                    logDwellingMessage = "DwellingUseCd was Null prior to the refresh, ";
                }
                else
                {
                    logDwellingMessage = "DwellingUseCd was " + this.DataBinder.Structure.DwellingUseCd.ToString() +
                                         " prior to the refresh, ";
                }

                string logReplacementCostMessage;
                if (this.DataBinder.Coverage.EstimatedReplCostAmt == null)
                {
                    logReplacementCostMessage = "EstimatedReplCostAmt was Null prior to the refresh, ";
                }
                else
                {
                    logReplacementCostMessage = "EstimatedReplCostAmt was " +
                                                this.DataBinder.Coverage.EstimatedReplCostAmt.ToString() +
                                                " prior to the refresh, ";
                }

                // Refresh the DataBinder so that if we are coming from a different server we have the latest from the database.
                this.DataBinder.RefreshDataObjects();

                this.Log("Processing Purchase - Start... Inspection Result value = " +
                         this.BusinessLogic().Quote.InspectionResult.ToString());
                //this.quote = null;  //Added For inspection
                this.BusinessLogic().Quote = null;
                this.Log("Processing Purchase - After refreshing the quote object... Inspection Result value = " +
                         this.BusinessLogic().Quote.InspectionResult.ToString());

                this.ErrorMessage = string.Empty;

                //AjaxResponse response = new AjaxResponse();

                #region Legacy Business Logic Ported code

                this.PData = pData;

                this.PurchaseProcessor.SaveConsentToRate(out this.ErrorMessage);

                this.PurchaseProcessor.SavexWind(out this.ErrorMessage); // ITR#7684

                this.PurchaseProcessor.SaveConsentToRateAndxWind(out this.ErrorMessage); // ITR#7684

                if (string.IsNullOrEmpty(this.ErrorMessage))
                {
                    this.PurchaseProcessor.SavePhoneNumber();
                    this.PurchaseProcessor.SaveMailingAddress();
                    this.PurchaseProcessor.SaveMortgageInfo();

                    if (pData.routingNumber != null && !PurchaseProcessor.ValidateEFT(pData.routingNumber))
                    {

                        this.ErrorMessage =
                            "<strong>There is a problem with your answers below. We may have some missing or inaccurate information. Please check the following field(s):</strong><a href='#RoutingNumber'>Routing Number</a>";

                        this.Log("Processing Purchase - Payment = AutoCheck... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());
                    }
                    if (string.IsNullOrEmpty(ErrorMessage))
                    {
                        this.PurchaseProcessor.SavePaymentDetails();
                        // ITR#7455 Added logging for the Early Cash issue
                        if (this.DataBinder.Structure.DwellingUseCd == null)
                        {
                            logDwellingMessage += "and DwellingUseCd was Null after to the refresh.";
                        }
                        else
                        {
                            logDwellingMessage += "and DwellingUseCd was " +
                                                  this.DataBinder.Structure.DwellingUseCd.ToString() +
                                                  " after to the refresh.";
                        }

                        if (this.DataBinder.Coverage.EstimatedReplCostAmt == null)
                        {
                            logReplacementCostMessage += "and EstimatedReplCostAmt was Null after to the refresh,";
                        }
                        else
                        {
                            logReplacementCostMessage += "and EstimatedReplCostAmt was " +
                                                         this.DataBinder.Coverage.EstimatedReplCostAmt.ToString() +
                                                         " after to the refresh";
                        }

                        // Log the above results
                        this.Log(logDwellingMessage);
                        this.Log(logReplacementCostMessage);

                        this.DataBinder.SaveDataObjects();

                        this.Log("Processing Purchase - Data Objects Saved... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());

                        if (this.BusinessLogic().Quote.APLUSStatus == null)
                        {
                            this.BusinessLogic().Quote.APLUSStatus = 2;
                            this.BusinessLogic().Quote.Save();
                            this.Log("Processing Purchase - Quote Saved... Inspection Result value = " +
                                     this.BusinessLogic().Quote.InspectionResult.ToString());
                        }

                    }

                #endregion

                    #region Legacy Progressive Business Logic Ported Code
                }

                if (string.IsNullOrEmpty(this.ErrorMessage))
                {
                    this.DataBinder.RefreshDataObjects();

                    if (!this.ServiceInterface.CallSaveQuoteService())
                    {
                        response.errorOccured = true;
                        response.errorMessage = "Error processing payment details. (save quote)";
                        response.NextPanel = AjaxPanel.Purchase;
                        this.Log("Processing Purchase - CallSaveQuoteService() = False... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());
                        return response;
                    }

                    if (quote.APLUSStatus != 1)
                    {
                        //bool convertEnabled = this.PurchaseProcessor.ConvertEnabled();
                        //if (convertEnabled)
                        this.ServiceInterface.CallConvertService();
                        this.Log("PartnerId: " + this.BusinessLogic().QHeader.PartnerId + " CompanyPolicyNumber: " +
                                 quote.CompanysPolicyNumber + " OLSStatus: " + this.BusinessLogic().QHeader.OLSStatus);
                        if (this.BusinessLogic().QHeader.PartnerId == 2319 &&
                            !string.IsNullOrEmpty(quote.CompanysPolicyNumber) &&
                            this.BusinessLogic().QHeader.OLSStatus == OlsStatusPasswordVerified)
                        {
                            EnrollmentServiceClient enrollmentService = null;
                            try
                            {
                                this.Log("Enrollment Service Being called");
                                string email =
                                    DirectWebDAC.GetOLSEnrollmentValues(qHeader.QuoteNumber).Rows[0]["EmailAddress"].
                                        ToString();
                                enrollmentService = new EnrollmentServiceClient();
                                EnrollForSelfServiceRequest request = new EnrollForSelfServiceRequest();
                                request.PolicyNumber = quote.CompanysPolicyNumber;
                                request.Channel = EnrollmentChannel.ConsumerWeb;
                                PasswordProvider provider = new PasswordProvider();
                                provider.LoginId = email;
                                provider.Password = this.BusinessLogic().PData.password;
                                request.Authentication = provider;
                                request.RequestId =
                                    DirectWebDAC.GetOLSEnrollmentValues(qHeader.QuoteNumber).Rows[0]["Token"].ToString();
                                request.RequestType = OLSService.ValidationRequestType.Token;
                                request.TransactionID = Guid.NewGuid();
                                var result = enrollmentService.EnrollForSelfService(request);
                                if (result.Result)
                                {
                                    this.Log("Enrollment into OLS was sucessful. Policy Number: " +
                                             this.BusinessLogic().Quote.CompanysPolicyNumber);
                                    this.BusinessLogic().QHeader.OLSStatus = OlsStatusReadyToEnroll;
                                }
                                else
                                {
                                    this.Log("Enrollment into OLS was unsucessful. Error Message: " +
                                             result.ErrorMessage);
                                }

                            }
                            catch (Exception e)
                            {
                                this.Log("Error with enrollmentservice: " + e.Message);
                            }
                            finally
                            {
                                if (enrollmentService != null)
                                    enrollmentService.Close();
                                this.Log("Enrollment Service ended OLSStatus: " + this.BusinessLogic().QHeader.OLSStatus);
                            }

                        }
                        this.Log("Processing Purchase - After CallConvertService... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());
                    }
                    else
                    {
                        throw new Exception("Fix Me.");

                    }
                }

                    #endregion

                this.DataBinder.RefreshDataObjects();
                this.Log("Processing Purchase - After RefreshDataObjects... Inspection Result value = " +
                         this.BusinessLogic().Quote.InspectionResult.ToString());

                // interpret results...
                if (this.ErrorMessage.Length == 0 && this.ServiceInterface.ErrorMessage.Length == 0 &&
                    this.PurchaseProcessor.ErrorMessage.Length == 0)
                {
                    response.NextPanel = AjaxPanel.Thank_You;
                    this.Log("Processing Purchase - Thank You... Inspection Result value = " +
                             this.BusinessLogic().Quote.InspectionResult.ToString());
                }
                else
                {
                    response.NextPanel = AjaxPanel.Purchase;

                    if (this.ErrorMessage.Length != 0)
                        response.errorMessage = this.ErrorMessage;
                    else if (this.ServiceInterface.ErrorMessage.Length != 0)
                        response.errorMessage = this.ServiceInterface.ErrorMessage;
                    else if (this.PurchaseProcessor.ErrorMessage.Length != 0)
                        response.errorMessage = this.PurchaseProcessor.ErrorMessage;

                    response.errorOccured = true;
                    this.Log("Processing Purchase - Error... Inspection Result value = " +
                             this.BusinessLogic().Quote.InspectionResult.ToString());
                    if (response.errorMessage.Trim().Length > 0)
                        this.Log("Processing Purchase - Error Description : " + response.errorMessage.Trim());

                }

                // check for policy servicing redirect after successful purchase
                if (response.NextPanel == AjaxPanel.Thank_You)
                {
                    IQuoteConfiguration configuration = IQuoteConfiguration.GetConfigurationInstance();

                    // If user OLS Status == 5 then user is enrolled in OLS
                    // this is for Walmart Associate
                    if (qHeader.OLSStatus == OlsStatusReadyToEnroll && !(DirectWebDAC.IsBatchRunning()))
                    {
                        this.Log("Processing Purchase - OnlineServicingEnabled... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());
                        if (this.PurchaseProcessor.WritePolicyServicingTransferData())
                        {
                            this.Log(
                                "Processing Purchase - WritePolicyServicingTransferData() = True... Inspection Result value = " +
                                this.BusinessLogic().Quote.InspectionResult.ToString());
                            //Redirect to OLSEnrolled page instead of OnlineServicing thank you page
                            StringBuilder redirUrl = this.PurchaseProcessor.BuildOLSEnrolledRedirectUrl();
                            response.RedirectURL = redirUrl.ToString();
                        }

                    }
                    else if (configuration.FunctionalityEnabled("OnlineServicingEnabled") && !(DirectWebDAC.IsBatchRunning()))
                    {
                        this.Log("Processing Purchase - OnlineServicingEnabled... Inspection Result value = " +
                                 this.BusinessLogic().Quote.InspectionResult.ToString());
                        if (this.PurchaseProcessor.WritePolicyServicingTransferData())
                        {
                            this.Log(
                                "Processing Purchase - WritePolicyServicingTransferData() = True... Inspection Result value = " +
                                this.BusinessLogic().Quote.InspectionResult.ToString());
                            StringBuilder redirUrl = this.PurchaseProcessor.BuildOnlineServicingRedirectUrl();
                            response.RedirectURL = redirUrl.ToString();
                        }
                    }
                }

                this.Log("Processing Purchase - End of Purchase... Inspection Result value = " +
                         this.BusinessLogic().Quote.InspectionResult.ToString());
            }

            return response;
        }