/// <summary> /// Updates the argued QuoteSummary object with MultiRate data. /// </summary> /// <param name="header">BusinessLogic.Header</param> /// <param name="quote">BusinessLogic.Quote</param> /// <param name="coverage">BusinessLogic.Coverage</param> /// <param name="qSummary">reference of the QuoteSummary object to update</param> private static void BindMultiRateForForm3(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary) { DataTable table = DirectWebDAC.GetMultirate(header.SessionID); for (var i = 0; i < table.Rows.Count; i++) { string totalPremium = table.Rows[i]["PolicyPremiumAmt"].ToString().Trim().Replace("$", ""); string deductible = table.Rows[i]["Deductible"].ToString().Trim(); string windHailOrHurricane = (table.Rows[i]["WindHailOrHurricane"] == null) ? string.Empty : table.Rows[i]["WindHailOrHurricane"].ToString().Trim(); decimal? covEAmount = (table.Rows[i]["CovEAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovEAmount"]; decimal? covFAmount = (table.Rows[i]["CovFAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovFAmount"]; decimal? covCAmount = (table.Rows[i]["CovCAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovCAmount"]; decimal? covAAmount = (table.Rows[i]["CovAAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovAAmount"]; decimal? increasedCovAAmount = (table.Rows[i]["IncreasedCovAAmount"] == null) ? 0 : (decimal?)table.Rows[i]["IncreasedCovAAmount"]; int coveredPerils = (table.Rows[i]["coveredPerils"] == null) ? 0 : (int)table.Rows[i]["coveredPerils"]; string multirateOptions = table.Rows[i]["MultirateOptions"].ToString().Trim(); DateTime ratingDate = DirectWebDAC.GetRatingDate(DateTime.Parse(coverage.PolicyEffDate), quote.InitialQuoteRequestDt.HasValue ? quote.InitialQuoteRequestDt.Value : DateTime.Now, header.State); DataSet premiumDisplay = DirectWebDAC.GetPremiumDisplay( Convert.ToInt32(table.Rows[i]["RatingCaseNumber"]), header.PartnerID ?? -1, header.State ?? "", ratingDate, (int)header.UnderwritingNumber); var premiumDiscounts = (ISODataProvider.GetPremiumDiscountsDataTable)premiumDisplay.Tables["GetPremiumDiscounts"]; var discounts = new ControlDataSource(premiumDiscounts, "display", "premium", "Discounts"); double totalDiscount = 0; foreach (var discount in discounts.Items) { if (discount.Value == "" || discount.Key == "Total Discounts and Surcharges" || discount.Key == "ACV Roof Loss Settlement (Wind/Hail) for roofs older than 10 years") { continue; } double val = Convert.ToDouble(discount.Value); if (val < 0) { totalDiscount = totalDiscount - val; } } DirectWebDAC.InsertOrUpdateMultirate(header.SessionID, deductible, (Convert.ToInt32(table.Rows[i]["IsDeductibleSelected"]) == 1) ? 1 : 0, table.Rows[i]["RatingCaseNumber"].ToString().Trim(), totalPremium, windHailOrHurricane, totalDiscount.ToString(), covEAmount, covFAmount, multirateOptions, covCAmount, covAAmount, Convert.ToInt32(coveredPerils), string.Empty, 0, 0, 0, increasedCovAAmount); switch (multirateOptions) { case "Option1": qSummary.TotalPremium1 = totalPremium; qSummary.Deductible1 = deductible; qSummary.TotalDiscount1 = totalDiscount.ToString("f2"); qSummary.CovEAmount1 = covEAmount.ToString(); qSummary.CovFAmount1 = covFAmount.ToString(); qSummary.CovCAmount1 = covCAmount.ToString(); qSummary.CovAAmount1 = covAAmount.ToString(); qSummary.IncreasedCovAAmount1 = increasedCovAAmount.ToString(); qSummary.MultirateOption1 = multirateOptions; qSummary.coveredPerils1 = (coveredPerils == 0) ? "standard" : "extended"; break; case "Option2": qSummary.TotalPremium2 = totalPremium; qSummary.Deductible2 = deductible; qSummary.TotalDiscount2 = totalDiscount.ToString("f2"); qSummary.CovEAmount2 = covEAmount.ToString(); qSummary.CovFAmount2 = covFAmount.ToString(); qSummary.CovCAmount2 = covCAmount.ToString(); qSummary.CovAAmount2 = covAAmount.ToString(); qSummary.IncreasedCovAAmount2 = increasedCovAAmount.ToString(); qSummary.MultirateOption2 = multirateOptions; qSummary.coveredPerils2 = (coveredPerils == 0) ? "standard" : "extended"; break; case "Option3": qSummary.TotalPremium3 = totalPremium; qSummary.Deductible3 = deductible; qSummary.TotalDiscount3 = totalDiscount.ToString("f2"); qSummary.CovEAmount3 = covEAmount.ToString(); qSummary.CovFAmount3 = covFAmount.ToString(); qSummary.CovCAmount3 = covCAmount.ToString(); qSummary.CovAAmount3 = covAAmount.ToString(); qSummary.IncreasedCovAAmount3 = increasedCovAAmount.ToString(); qSummary.MultirateOption3 = multirateOptions; qSummary.coveredPerils3 = (coveredPerils == 0) ? "standard" : "extended"; break; } } qSummary.CovAAmount = coverage.CovAAmount; qSummary.MedicalPaymentLimit = coverage.MedicalPaymentLimit; qSummary.PersonalLiabilityLimit = coverage.PersonalLiabilityLimit; }
/// <summary> /// Updates the argued QuoteSummary object with MultiRate data. This is only used in ConsumerWeb - HO4 /// </summary> /// <param name="header">BusinessLogic.Header</param> /// <param name="quote">BusinessLogic.Quote</param> /// <param name="coverage">BusinessLogic.Coverage</param> /// <param name="qSummary">reference of the QuoteSummary object to update</param> private static void BindMultiRateForForm4(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary) { DataTable table = DirectWebDAC.GetMultirate(header.SessionID); for (var i = 0; i < table.Rows.Count; i++) { var totalPremium = table.Rows[i]["PolicyPremiumAmt"].ToString().Trim().Replace("$", ""); var deductible = table.Rows[i]["Deductible"].ToString().Trim(); var covCAmount = (table.Rows[i]["CovCAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovCAmount"]; var covEAmount = (table.Rows[i]["CovEAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovEAmount"]; var covFAmount = (table.Rows[i]["CovFAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovFAmount"]; var multirateOptions = table.Rows[i]["MultirateOptions"].ToString().Trim(); DateTime ratingDate = DirectWebDAC.GetRatingDate(DateTime.Parse(coverage.PolicyEffDate), quote.InitialQuoteRequestDt.HasValue ? quote.InitialQuoteRequestDt.Value : DateTime.Now, header.State); var premiumDisplay = DirectWebDAC.GetPremiumDisplay( Convert.ToInt32(table.Rows[i]["RatingCaseNumber"].ToString()), header.PartnerID ?? -1, header.State ?? "", ratingDate, (int)header.UnderwritingNumber); var premiumDiscounts = (ISODataProvider.GetPremiumDiscountsDataTable)premiumDisplay.Tables["GetPremiumDiscounts"]; var discounts = new ControlDataSource(premiumDiscounts, "display", "premium", "Discounts"); double totalDiscount = 0; foreach (var discount in discounts.Items) { if (discount.Value == "" || discount.Key == "Total Discounts and Surcharges" || discount.Key == "ACV Roof Loss Settlement (Wind/Hail) for roofs older than 10 years") { continue; } double val = Convert.ToDouble(discount.Value); if (val < 0) { totalDiscount = totalDiscount - val; } } var EftStateFee = header.State == "AL" ? "$2.60" : header.State == "KY" ? "$2.50" : header.State == "NC" ? "$0.00" : header.State == "TN" ? "$0.00" : header.State.Equals("FL") ? "$1.00" : "$3.00"; string totalPrice = (Convert.ToDouble(totalPremium) + totalDiscount).ToString(); string monthlyPaymentPlan; string downPayment; int numInstallments; Structure structure = Structure.GetStructure(header.SessionID); int propertyType = 0; if (!String.IsNullOrEmpty(structure.PropertyType)) { propertyType = Convert.ToInt32(structure.PropertyType); } QuoteServices.ProcessMonthlyPremiumData(header.State, quote.CompanysQuoteNumber, ((DateTime)ratingDate).ToString("MM/dd/yyyy"), totalPremium, propertyType, out monthlyPaymentPlan, out downPayment, out numInstallments); DirectWebDAC.InsertOrUpdateMultirate(header.SessionID, deductible, (Convert.ToInt32(table.Rows[i]["IsDeductibleSelected"]) == 1) ? 1 : 0, table.Rows[i]["RatingCaseNumber"].ToString().Trim(), totalPremium, string.Empty, totalDiscount.ToString(), covEAmount, covFAmount, multirateOptions, 0, 0, 0, totalPrice, Convert.ToDecimal(monthlyPaymentPlan.Trim().Replace("$", "")), Convert.ToDecimal(downPayment.Trim().Replace("$", "")), numInstallments, 0); switch (multirateOptions) { case "Option1": qSummary.TotalPremium1 = totalPremium; qSummary.Deductible1 = deductible; qSummary.TotalDiscount1 = totalDiscount.ToString("f2"); qSummary.CovCAmount1 = covCAmount.ToString(); qSummary.CovEAmount1 = covEAmount.ToString(); qSummary.CovFAmount1 = covFAmount.ToString(); qSummary.MultirateOption1 = multirateOptions; qSummary.TotalPrice1 = totalPrice; qSummary.MonthlyPayPlan1 = monthlyPaymentPlan; qSummary.Downpayment1 = downPayment; qSummary.NumInstallments1 = numInstallments; break; case "Option2": qSummary.TotalPremium2 = totalPremium; qSummary.Deductible2 = deductible; qSummary.TotalDiscount2 = totalDiscount.ToString("f2"); qSummary.CovCAmount2 = covCAmount.ToString(); qSummary.CovEAmount2 = covEAmount.ToString(); qSummary.CovFAmount2 = covFAmount.ToString(); qSummary.MultirateOption2 = multirateOptions; qSummary.TotalPrice2 = totalPrice; qSummary.MonthlyPayPlan2 = monthlyPaymentPlan; qSummary.Downpayment2 = downPayment; qSummary.NumInstallments2 = numInstallments; break; case "Option3": qSummary.TotalPremium3 = totalPremium; qSummary.Deductible3 = deductible; qSummary.TotalDiscount3 = totalDiscount.ToString("f2"); qSummary.CovCAmount3 = covCAmount.ToString(); qSummary.CovEAmount3 = covEAmount.ToString(); qSummary.CovFAmount3 = covFAmount.ToString(); qSummary.MultirateOption3 = multirateOptions; qSummary.TotalPrice3 = totalPrice; qSummary.MonthlyPayPlan3 = monthlyPaymentPlan; qSummary.Downpayment3 = downPayment; qSummary.NumInstallments3 = numInstallments; break; } } qSummary.MedicalPaymentLimit = coverage.MedicalPaymentLimit; qSummary.PersonalLiabilityLimit = coverage.PersonalLiabilityLimit; }
/// <summary> /// Updates the argued QuoteSummary object with MultiRate data. This is only used in ConsumerWeb. /// </summary> /// <param name="header">BusinessLogic.Header</param> /// <param name="quote">BusinessLogic.Quote</param> /// <param name="coverage">BusinessLogic.Coverage</param> /// <param name="qSummary">reference of the QuoteSummary object to update</param> public static void UpdateMultiRateToQuoteSummary(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary) { switch (header.FormNumber) { case 3: BindMultiRateForForm3(header, quote, coverage, ref qSummary); break; case 4: BindMultiRateForForm4(header, quote, coverage, ref qSummary); break; } }