public void bindData(int claimID)
        {
            List <vw_ClaimLimit> limits = ClaimLimitManager.GetAll(claimID, LimitType.LIMIT_TYPE_CASUALTY);

            if (limits != null && limits.Count == 0)
            {
                //limits = primeCasualtyLimits();
            }

            //gvLimits.DataSource = limits;
            //gvLimits.DataBind();
            lblNoRecordFound.Visible = false;
            if (limits.Count > 0)
            {
                if (limits[0].IsStatic != false)
                {
                    gvLimits.DataSource = limits;
                    gvLimits.DataBind();

                    gvLimits2.DataSource = null;
                    gvLimits2.DataBind();
                }
                else
                {
                    gvLimits.DataSource = null;
                    gvLimits.DataBind();
                    gvLimits2.DataSource = limits;
                    gvLimits2.DataBind();
                }
            }
            else
            {
                lblNoRecordFound.Visible = true;
            }
        }
Exemplo n.º 2
0
        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();
        }