static public void loadFieldValues(Claim claim) { Leads lead = claim.LeadPolicy.Leads; LeadPolicy policy = claim.LeadPolicy; Carrier carrier = policy.Carrier; Client portal = portal = lead.Client; PolicyLienholder lienHolder = policy.PolicyLienholder as PolicyLienholder; //PolicyLienholder lienHolder = policy.PolicyLienholder as PolicyLienholder; List <vw_ClaimLimit> limits = null; limits = ClaimLimitManager.GetAll(claim.ClaimID, LimitType.LIMIT_TYPE_PROPERTY); if (limits != null && limits.Count == 0) { limits = primePropertyLimits(); } List <vw_ClaimLimit> limitsCasuality = ClaimLimitManager.GetAll(claim.ClaimID, LimitType.LIMIT_TYPE_CASUALTY); if (limitsCasuality != null && limitsCasuality.Count == 0) { limitsCasuality = primeCasualtyLimits(); } //decimal p= limits[0].Depreciation??0; string policy_number = null; string claim_number = null; string insurance_company = null; string insurance_address = null; string insurance_address2 = null; string insurance_city = null; string insurance_state = null; string insurance_zipcode = null; string insurance_phone_number = null; decimal recovDepreA = 0; decimal recovDepreB = 0; decimal recovDepreC = 0; decimal recovDepreTotal = 0; decimal nonRecovDepreA = 0; decimal nonRecovDepreB = 0; decimal nonRecovDepreC = 0; decimal nonRecovDepreTotal = 0; decimal deductibleA = 0; decimal deductibleB = 0; decimal deductibleC = 0; decimal deductibleTotal = 0; decimal limitA = 0; decimal limitB = 0; decimal limitC = 0; decimal limitD = 0; decimal limitE = 0; decimal limitF = 0; decimal lossAmountRCVA = 0; decimal lossAmountRCVB = 0; decimal lossAmountRCVC = 0; decimal lossAmountRCVD = 0; decimal totalLossAmountRCVAThruD = 0; decimal lossAmountACVA = 0; decimal lossAmountACVB = 0; decimal lossAmountACVC = 0; decimal lossAmountACVD = 0; decimal lossAmountACVE = 0; decimal lossAmountACVF = 0; decimal totalLossAmountACVAThruD = 0; decimal totalLossAmountACVEThruF = 0; CityMaster cityMaster = null; StateMaster stateMaster = null; string loss_date = null; string dateOpenReported = string.Empty; string dateContacted = string.Empty; string dateInspectionCompleted = string.Empty; if (limits.Count >= 4) { recovDepreA = limits[0].Depreciation ?? 0; recovDepreB = limits[1].Depreciation ?? 0; recovDepreC = limits[2].Depreciation ?? 0; recovDepreTotal = recovDepreA + recovDepreB + recovDepreC; nonRecovDepreA = limits[0].NonRecoverableDepreciation ?? 0; nonRecovDepreB = limits[1].NonRecoverableDepreciation ?? 0; nonRecovDepreC = limits[2].NonRecoverableDepreciation ?? 0; nonRecovDepreTotal = nonRecovDepreA + nonRecovDepreB + nonRecovDepreC; deductibleA = limits[0].LimitDeductible ?? 0; deductibleB = limits[1].LimitDeductible ?? 0; deductibleC = limits[2].LimitDeductible ?? 0; deductibleTotal = deductibleA + deductibleB + deductibleC; limitA = limits[0].LimitAmount ?? 0; limitB = limits[1].LimitAmount ?? 0; limitC = limits[2].LimitAmount ?? 0; limitD = limits[3].LimitAmount ?? 0; lossAmountRCVA = limits[0].LossAmountRCV ?? 0; lossAmountRCVB = limits[1].LossAmountRCV ?? 0; lossAmountRCVC = limits[2].LossAmountRCV ?? 0; lossAmountRCVD = limits[3].LossAmountRCV ?? 0; totalLossAmountRCVAThruD = lossAmountRCVA + lossAmountRCVB + lossAmountRCVC + lossAmountRCVD; lossAmountACVA = limits[0].LossAmountACV ?? 0; lossAmountACVB = limits[1].LossAmountACV ?? 0; lossAmountACVC = limits[2].LossAmountACV ?? 0; lossAmountACVD = limits[3].LossAmountACV ?? 0; totalLossAmountACVAThruD = lossAmountACVA + lossAmountACVB + lossAmountACVC + lossAmountACVD; } if (limitsCasuality.Count >= 2) { limitE = limitsCasuality[0].LimitAmount ?? 0; limitF = limitsCasuality[1].LimitAmount ?? 0; lossAmountACVE = limitsCasuality[0].LossAmountACV ?? 0; lossAmountACVF = limitsCasuality[1].LossAmountACV ?? 0; totalLossAmountACVEThruF = lossAmountACVE + lossAmountACVF; } // policy info policy_number = policy.PolicyNumber; if (carrier != null) { insurance_company = carrier.CarrierName; insurance_address = carrier.AddressLine1; insurance_address2 = carrier.AddressLine2; cityMaster = carrier.CityMaster; insurance_city = cityMaster == null ? "" : cityMaster.CityName; stateMaster = carrier.StateMaster; insurance_state = stateMaster == null ? "" : stateMaster.StateName; insurance_zipcode = carrier.ZipCode; } // claim info claim_number = claim.AdjusterClaimNumber; if (claim.LossDate != null) { loss_date = string.Format("{0:MM-dd-yyyy}", claim.LossDate); } if (claim.DateOpenedReported != null) { dateOpenReported = string.Format("{0:MM-dd-yyyy}", claim.DateOpenedReported); } if (claim.DateContacted != null) { dateContacted = string.Format("{0:MM-dd-yyyy}", claim.DateContacted); } if (claim.DateInspectionCompleted != null) { dateInspectionCompleted = string.Format("{0:MM-dd-yyyy}", claim.DateInspectionCompleted); } // remove existing fields mergeFields.Clear(); mergeFields.Add(new mergeField("TODAYS_DATE", DateTime.Now.ToShortDateString())); mergeFields.Add(new mergeField("CLAIMANT_FIRST_NAME", lead.ClaimantFirstName)); mergeFields.Add(new mergeField("CLAIMANT_LAST_NAME", lead.ClaimantLastName)); ///// mergeFields.Add(new mergeField("LOSS_ADDRESS", lead.LossAddress)); mergeFields.Add(new mergeField("LOSS_ADDRESS 2", lead.LossAddress2)); mergeFields.Add(new mergeField("LOSS_STATE", lead.StateName)); mergeFields.Add(new mergeField("LOSS_CITY", lead.CityName)); mergeFields.Add(new mergeField("LOSS_ZIPCODE", lead.Zip)); ///// mergeFields.Add(new mergeField("CLAIMANT_MAILING_ADDRESS", lead.MailingAddress)); mergeFields.Add(new mergeField("CLAIMANT_MAILING_STATE", lead.MailingState)); mergeFields.Add(new mergeField("CLAIMANT_MAILING_CITY", lead.MailingCity)); mergeFields.Add(new mergeField("CLAIMANT_MAILING_ZIPCODE", lead.MailingZip)); mergeFields.Add(new mergeField("CLAIMANT_PHONE_NUMBER", lead.PhoneNumber)); mergeFields.Add(new mergeField("CLAIMANT_EMAIL", lead.EmailAddress)); mergeFields.Add(new mergeField("POLICY_NO", policy_number)); mergeFields.Add(new mergeField("CLAIM_NUMBER", claim_number)); mergeFields.Add(new mergeField("INSURANCE_CO", insurance_company)); mergeFields.Add(new mergeField("INSURANCE_ADDRESS", insurance_address)); mergeFields.Add(new mergeField("INSURANCE_ADDRESS2", insurance_address2)); mergeFields.Add(new mergeField("INSURANCE_CITY", insurance_city)); mergeFields.Add(new mergeField("INSURANCE_STATE", insurance_state)); mergeFields.Add(new mergeField("INSURANCE_ZIPCODE", insurance_zipcode)); mergeFields.Add(new mergeField("INSURANCE_PHONE", insurance_phone_number)); mergeFields.Add(new mergeField("HOMEOWNER_POLICY_NO", policy_number)); mergeFields.Add(new mergeField("COMMERCIAL_POLICY_NO", policy_number)); mergeFields.Add(new mergeField("FLOOD_POLICY_NO", policy_number)); mergeFields.Add(new mergeField("EARTHQUAKE_POLICY_NO", policy_number)); mergeFields.Add(new mergeField("HOMEOWNER_CLAIM_NUMBER", claim_number)); mergeFields.Add(new mergeField("COMMERCIAL_CLAIM_NUMBER", claim_number)); mergeFields.Add(new mergeField("FLOOD_CLAIM_NUMBER", claim_number)); mergeFields.Add(new mergeField("EARTHQUAKE_CLAIM_NUMBER", claim_number)); mergeFields.Add(new mergeField("HOMEOWNER_INSURANCE_CO", insurance_company)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_ADDRESS", insurance_address)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_ADDRESS2", insurance_address2)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_CITY", insurance_city)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_STATE", insurance_state)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_ZIPCODE", insurance_zipcode)); mergeFields.Add(new mergeField("HOMEONWER_INSURANCE_PHONE", insurance_phone_number)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_CO", insurance_company)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_ADDRESS", insurance_address)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_CITY", insurance_city)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_STATE", insurance_state)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_ZIPCODE", insurance_zipcode)); mergeFields.Add(new mergeField("COMMERCIAL_INSURANCE_PHONE", insurance_phone_number)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_CO", insurance_company)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_ADDRESS", insurance_address)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_CITY", insurance_city)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_STATE", insurance_state)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_ZIPCODE", insurance_zipcode)); mergeFields.Add(new mergeField("FLOOD_INSURANCE_PHONE", insurance_phone_number)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_CO", insurance_company)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_ADDRESS", insurance_address)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_CITY", insurance_city)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_STATE", insurance_state)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_ZIPCODE", insurance_zipcode)); mergeFields.Add(new mergeField("EARTHQUAKE_INSURANCE_PHONE", insurance_phone_number)); mergeFields.Add(new mergeField("LOSS_DATE", loss_date)); if (!string.IsNullOrEmpty(claim.CauseOfLoss)) { string[] causeOfLossDescriptions = TypeofDamageManager.GetDescriptions(claim.CauseOfLoss); mergeFields.Add(new mergeField("DAMAGE_CAUSE", string.Join(",", causeOfLossDescriptions))); } if (portal != null) { mergeFields.Add(new mergeField("OFFICE_NAME", portal.BusinessName)); mergeFields.Add(new mergeField("FEDERAL_ID_NO", portal.FederalIDNo)); mergeFields.Add(new mergeField("OFFICE_ADDRESS", portal.StreetAddress1 ?? "" + " " + lead.Client.StreetAddress2 ?? "")); mergeFields.Add(new mergeField("OFFICE_CITY", portal.CityMaster == null ? "" : lead.Client.CityMaster.CityName)); mergeFields.Add(new mergeField("OFFICE_STATE", portal.StateMaster == null ? "" : lead.Client.StateMaster.StateName)); if (portal.ZipCode != null) { mergeFields.Add(new mergeField("OFFICE_ZIPCODE", getZipCode(portal.ZipCode))); } } ///// ADD BY CHETU TEAM mergeFields.Add(new mergeField("INSURED_NAME", lead.InsuredName)); mergeFields.Add(new mergeField("INSURER_CLAIM_NUMBER", claim.InsurerClaimNumber)); mergeFields.Add(new mergeField("ESTIMATOR_NAME", claim.AdjusterMaster.AdjusterName)); mergeFields.Add(new mergeField("ESTIMATOR_CELL_PHONE", claim.AdjusterMaster.PhoneNumber)); mergeFields.Add(new mergeField("ESTIMATOR_EMAIL", claim.AdjusterMaster.email)); mergeFields.Add(new mergeField("TYPE_OF_LOSS", claim.TypeofLoss)); string carrierExaminer = ClaimsManager.GetContactByContactID(claim.ManagerID ?? 0); mergeFields.Add(new mergeField("CARRIER_EXAMINER", carrierExaminer)); mergeFields.Add(new mergeField("RECOVERABLEDEPRECIATION", Convert.ToString(claim.Depreciation))); mergeFields.Add(new mergeField("NONRECOVERABLEDEPRECIATION", Convert.ToString(claim.NonRecoverableDepreciation))); mergeFields.Add(new mergeField("MORTGAGEENAME", Convert.ToString(lienHolder.Mortgagee.MortageeName))); mergeFields.Add(new mergeField("LOANNUMBER", Convert.ToString(lienHolder.LoanNumber))); ///////////// mergeFields.Add(new mergeField("RECOVERABLEDEPRECIATION_A", Convert.ToString(recovDepreA))); mergeFields.Add(new mergeField("RECOVERABLEDEPRECIATION_B", Convert.ToString(recovDepreB))); mergeFields.Add(new mergeField("RECOVERABLEDEPRECIATION_C", Convert.ToString(recovDepreC))); mergeFields.Add(new mergeField("RECOVERABLEDEPRECIATION_TOTAL", Convert.ToString(recovDepreTotal))); mergeFields.Add(new mergeField("NONRECOVERABLEDEPRECIATION_A", Convert.ToString(nonRecovDepreA))); mergeFields.Add(new mergeField("NONRECOVERABLEDEPRECIATION_B", Convert.ToString(nonRecovDepreB))); mergeFields.Add(new mergeField("NONRECOVERABLEDEPRECIATION_C", Convert.ToString(nonRecovDepreC))); mergeFields.Add(new mergeField("NONRECOVERABLEDEPRECIATION_Total", Convert.ToString(nonRecovDepreTotal))); mergeFields.Add(new mergeField("DEDUCTIBLE_A", Convert.ToString(deductibleA))); mergeFields.Add(new mergeField("DEDUCTIBLE_B", Convert.ToString(deductibleB))); mergeFields.Add(new mergeField("DEDUCTIBLE_C", Convert.ToString(deductibleC))); mergeFields.Add(new mergeField("DEDUCTIBLE_Total", Convert.ToString(deductibleTotal))); mergeFields.Add(new mergeField("LIMIT_A", Convert.ToString(limitA))); mergeFields.Add(new mergeField("LIMIT_B", Convert.ToString(limitB))); mergeFields.Add(new mergeField("LIMIT_C", Convert.ToString(limitC))); mergeFields.Add(new mergeField("LIMIT_D", Convert.ToString(limitD))); mergeFields.Add(new mergeField("LOSSAMOUNT_RCV_A", Convert.ToString(lossAmountRCVA))); mergeFields.Add(new mergeField("LOSSAMOUNT_RCV_B", Convert.ToString(lossAmountRCVB))); mergeFields.Add(new mergeField("LOSSAMOUNT_RCV_C", Convert.ToString(lossAmountRCVC))); mergeFields.Add(new mergeField("LOSSAMOUNT_RCV_D", Convert.ToString(lossAmountRCVD))); mergeFields.Add(new mergeField("TOTAL_LOSS_AMOUNT_A_THRU_DRCV", Convert.ToString(totalLossAmountRCVAThruD))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_A", Convert.ToString(lossAmountACVA))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_B", Convert.ToString(lossAmountACVB))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_C", Convert.ToString(lossAmountACVC))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_D", Convert.ToString(lossAmountACVD))); mergeFields.Add(new mergeField("TOTAL_LOSS_AMOUNT_A_THRU_DACV", Convert.ToString(totalLossAmountACVAThruD))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_E", Convert.ToString(lossAmountACVE))); mergeFields.Add(new mergeField("LOSSAMOUNT_ACV_F", Convert.ToString(lossAmountACVF))); mergeFields.Add(new mergeField("TOTAL_LOSS_AMOUNT_E_THRU_FACV", Convert.ToString(totalLossAmountACVAThruD))); mergeFields.Add(new mergeField("DATEOPEN_REPORTED", dateOpenReported)); mergeFields.Add(new mergeField("DATE_CONTACTED", dateContacted)); mergeFields.Add(new mergeField("DATE_INSPECTION_COMPLETED", dateInspectionCompleted)); mergeFields.Add(new mergeField("EFFECTIVE_DATE", "")); mergeFields.Add(new mergeField("EXPIRY_DATE", "")); // build field name arrays fieldNames = mergeFields.Select(x => x.fieldName).ToArray(); // build field value arrays fieldValues = mergeFields.Select(x => x.fieldValue).ToArray(); }
static protected void exportDemographics(Leads lead, Claim claim) { Stream imageStream = null; string cityName = null; string stateName = null; string zipCode = null; string[] damageType = null; string imagePath = null; if (lead == null) { return; } PdfPTable tblHeader = new PdfPTable(new float[] { 30, 60 }); tblHeader.WidthPercentage = 90; PdfPCell headerCell = new PdfPCell(new Phrase("Policyholder Information")); headerCell.Colspan = 2; headerCell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; tblHeader.AddCell(headerCell); doc.Add(tblHeader); PdfPTable ptable = new PdfPTable(new float[] { 30, 60 }); addTableCell(ptable, "Insured Name"); addTableCell(ptable, lead.InsuredName); addTableCell(ptable, "First Name"); addTableCell(ptable, lead.ClaimantFirstName); addTableCell(ptable, "Last Name"); addTableCell(ptable, lead.ClaimantLastName); addTableCell(ptable, "Business Name"); addTableCell(ptable, lead.BusinessName); addTableCell(ptable, "Phone"); addTableCell(ptable, lead.PhoneNumber); addTableCell(ptable, " "); addTableCell(ptable, lead.SecondaryPhone); addTableCell(ptable, "Email"); addTableCell(ptable, lead.EmailAddress); addTableCell(ptable, " "); addTableCell(ptable, lead.SecondaryEmail); addTableCell(ptable, "Loss Address"); addTableCell(ptable, lead.LossAddress); addTableCell(ptable, " "); addTableCell(ptable, lead.LossAddress2); cityName = lead.CityName ?? " "; stateName = lead.StateName ?? " "; zipCode = lead.Zip ?? " "; addTableCell(ptable, " "); addTableCell(ptable, cityName + ", " + stateName + " " + zipCode); addTableCell(ptable, "Type of Loss"); if (!string.IsNullOrEmpty(claim.CauseOfLoss)) { string[] causeOfLossDescriptions = TypeofDamageManager.GetDescriptions(claim.CauseOfLoss); string typeOfLoss = string.Join(",", causeOfLossDescriptions); addTableCell(ptable, typeOfLoss); } //addTableCell(ptable, "Lead Source"); //addTableCell(ptable, lead.LeadSourceMaster == null ? " " : lead.LeadSourceMaster.LeadSourceName); doc.Add(ptable); //if (lead.Latitude != null && lead.Longitude != null) { // imageStream = bingMapHelper.getMapImage(lead.Latitude, lead.Longitude); // // add areal map to pdf // if (imageStream != null) { // Image img = iTextSharp.text.Image.GetInstance(imageStream); // PdfPTable maptable = new PdfPTable(new float[] { 90 }); // maptable.WidthPercentage = 90; // PdfPCell filler = new PdfPCell(new Phrase(" ")); // filler.Border = 0; // maptable.AddCell(filler); // PdfPCell imageHeader = new PdfPCell(new Phrase("Loss Map")); // imageHeader.HorizontalAlignment = PdfPCell.ALIGN_CENTER; // imageHeader.VerticalAlignment = PdfPCell.ALIGN_CENTER; // //imageHeader.PaddingBottom = 10f; // //imageHeader.PaddingTop = 10f; // maptable.AddCell(imageHeader); // img.ScaleToFit(500f, 400f); // PdfPCell cellp = new PdfPCell(img, false); // cellp.HorizontalAlignment = PdfPCell.ALIGN_MIDDLE; // cellp.VerticalAlignment = PdfPCell.ALIGN_TOP; // cellp.Padding = 2f; // //cellp.PaddingBottom = 2; // //cellp.PaddingRight = 2; // cellp.BorderWidthLeft = 1f; // cellp.BorderWidthRight = 1f; // cellp.BorderWidthTop = 1f; // cellp.BorderWidthBottom = 1f; // maptable.AddCell(cellp); // doc.Add(maptable); // } //} }