コード例 #1
0
        private void populateFamilyNeed(familyNeed fNeed)
        {
            //txtReplacementIncome.Text = (fNeed.replacementIncomeRequired == null || fNeed.replacementIncomeRequired == "") ? "0" : fNeed.replacementIncomeRequired;

            familyIncPrNeeded.SelectedValue = fNeed.familyIncPrNeeded.ToString();
            mortgagePrNeeded.SelectedValue = fNeed.mortgageNeeded.ToString();

            if(fNeed.yearsOfSupportRequired == null || fNeed.yearsOfSupportRequired == "")
            {
                string yearsToSupport = getYearsToSupport(fNeed.caseId);
                txtYrsOfSupport.Text = yearsToSupport;
            }
            else
                txtYrsOfSupport.Text=fNeed.yearsOfSupportRequired;

            txtInflationAdjustedReturns.Text = (fNeed.inflationAdjustedReturns == null || fNeed.inflationAdjustedReturns == "") ? "0" : fNeed.inflationAdjustedReturns;
            txtLumpSumRequired.Text = (fNeed.lumpSumRequired == null || fNeed.lumpSumRequired == "") ? "0" : fNeed.lumpSumRequired;
            txtOtherLiabilities.Text = (fNeed.otherLiabilities == null || fNeed.otherLiabilities == "") ? "0" : fNeed.otherLiabilities;
            txtEmergencyFundsNeeded.Text = (fNeed.emergencyFundsNeeded == null || fNeed.emergencyFundsNeeded == "") ? "0" : fNeed.emergencyFundsNeeded;
            txtFinalExpenses.Text = (fNeed.finalExpenses == null || fNeed.finalExpenses == "") ? "0" : fNeed.finalExpenses;
            txtOtherFundingNeeds.Text = (fNeed.otherFundingNeeds == null || fNeed.otherFundingNeeds == "") ? "0" : fNeed.otherFundingNeeds;
            //txtotherComments.Text = (fNeed.otherComments == null || fNeed.otherComments == "") ? "0" : fNeed.otherComments;
            txtTotalRequired.Text = (fNeed.totalRequired == null || fNeed.totalRequired == "") ? "0" : fNeed.totalRequired;
            txtExistingLifeInsurance.Text = (fNeed.existingLifeInsurance == null || fNeed.existingLifeInsurance == "") ? "0" : fNeed.existingLifeInsurance;
            //txtExistingAssetsFamilyneeds.Text = (fNeed.existingAssetsFamilyneeds == null || fNeed.existingAssetsFamilyneeds == "") ? "0" : fNeed.existingAssetsFamilyneeds;
            txtTotalShortfallSurplus.Text = (fNeed.totalShortfallSurplus == null || fNeed.totalShortfallSurplus == "") ? "0" : fNeed.totalShortfallSurplus;
            hiddenTotalShortfallSurplus.Value = (fNeed.totalShortfallSurplus == null || fNeed.totalShortfallSurplus == "") ? "0" : fNeed.totalShortfallSurplus;

            txtMortgageProtectionOutstanding.Text = (fNeed.mortgageProtectionOutstanding == null || fNeed.mortgageProtectionOutstanding == "") ? "0" : fNeed.mortgageProtectionOutstanding;
               // txtMortgageProtectionInsurances.Text = (fNeed.mortgageProtectionInsurances == null || fNeed.mortgageProtectionInsurances == "") ? "0" : fNeed.mortgageProtectionInsurances;
            txtMortgageProtectionTotal.Text = (fNeed.mortgageProtectionTotal == null || fNeed.mortgageProtectionTotal == "") ? "0" : fNeed.mortgageProtectionTotal;

            float percentage= 70;

            IncomeExpenseDAO incomeExpenseDao = new IncomeExpenseDAO();
            incomeExpense incomeExpense= incomeExpenseDao.getIncomeExpenseForCase(fNeed.caseId);

            AssetAndLiabilityDAO assetLiabilityDao= new AssetAndLiabilityDAO();
            assetAndLiability assetAndLiability=assetLiabilityDao.getAssetLiabilityForCase(fNeed.caseId);

            if (fNeed.replacementIncomeRequired == null || fNeed.replacementIncomeRequired == "")
            {
                if(incomeExpense!=null)
                {
                    if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                    {
                        txtReplacementIncome.Text=Math.Round((float.Parse(incomeExpense.netMonthlyIncomeAfterCpf)*12*percentage*.01))+"";
                    }
                }
                else
                    txtReplacementIncome.Text="0";
            }
            else
                txtReplacementIncome.Text=fNeed.replacementIncomeRequired;

            if (fNeed.emergencyFundsNeeded == null || fNeed.emergencyFundsNeeded == "")
            {
                if(incomeExpense!=null)
                {
                    if (incomeExpense.emergencyFundsNeeded != null &&  incomeExpense.emergencyFundsNeeded == "")
                        txtEmergencyFundsNeeded.Text=incomeExpense.emergencyFundsNeeded;
                }
                else
                    txtEmergencyFundsNeeded.Text="0";
            }
            else
                txtEmergencyFundsNeeded.Text=fNeed.emergencyFundsNeeded;

            if(fNeed.otherLiabilities==null || fNeed.otherLiabilities=="")
            {

                if(assetAndLiability!=null)
                {
                    float liability=0;

                    if (assetAndLiability.vehicleLoan != null && assetAndLiability.vehicleLoan != "")
                    {
                        liability+=float.Parse(assetAndLiability.vehicleLoan);
                    }

                    if (assetAndLiability.cashLoan != null && assetAndLiability.cashLoan != "")
                    {
                        liability+=float.Parse(assetAndLiability.cashLoan);
                    }

                    if (assetAndLiability.creditCard != null && assetAndLiability.creditCard != "")
                    {
                        liability+=float.Parse(assetAndLiability.creditCard);
                    }

                    if(assetAndLiability.liabilityOthers!=null)
                    {
                        int count=assetAndLiability.liabilityOthers.Count;

                        EntitySet<liabilityOther> others = assetAndLiability.liabilityOthers;
                        for (int i = 0; i < count; i++)
                        {
                            if (others[i].cash != null && others[i].cash != "")
                                liability+= float.Parse(others[i].cash);
                        }
                    }

                    txtOtherLiabilities.Text=liability+"";
                }
                else
                    txtOtherLiabilities.Text="0";
            }

            float existLifeInsurance=0;

            if(fNeed.existingLifeInsurance ==null || fNeed.existingLifeInsurance=="")
            {
                if (incomeExpense != null)
                {
                    if (incomeExpense.DeathTermInsuranceSA != null && incomeExpense.DeathTermInsuranceSA != "")
                    {
                        existLifeInsurance += float.Parse(incomeExpense.DeathTermInsuranceSA);
                    }
                    if (incomeExpense.DeathWholeLifeInsuranceSA != null && incomeExpense.DeathWholeLifeInsuranceSA != "")
                    {
                        existLifeInsurance += float.Parse(incomeExpense.DeathWholeLifeInsuranceSA);
                    }
                    if (incomeExpense.lifeInsuranceSA != null && incomeExpense.lifeInsuranceSA != "")
                    {
                        existLifeInsurance += float.Parse(incomeExpense.lifeInsuranceSA);
                    }
                }

                 txtExistingLifeInsurance.Text=existLifeInsurance+"";
            }
            else
                txtExistingLifeInsurance.Text=fNeed.existingLifeInsurance;

            if(fNeed.mortgageProtectionOutstanding ==null || fNeed.mortgageProtectionOutstanding=="")
            {
                if(assetAndLiability!=null)
                {
                    if (assetAndLiability.homeMortgage != null && assetAndLiability.homeMortgage != "")
                    {
                        txtMortgageProtectionOutstanding.Text=assetAndLiability.homeMortgage;
                    }
                    else
                        txtMortgageProtectionOutstanding.Text="0";
                }
            }
            else
                txtMortgageProtectionOutstanding.Text=fNeed.mortgageProtectionOutstanding;

            if(fNeed.mortgageProtectionInsurances ==null || fNeed.mortgageProtectionInsurances=="")
            {
                if(incomeExpense!=null)
                {
                    if (incomeExpense.mortgageSA != null && incomeExpense.mortgageSA != "")
                    {
                        txtMortgageProtectionInsurances.Text=incomeExpense.mortgageSA;
                    }
                    else
                        txtMortgageProtectionInsurances.Text="0";
                }
                else
                   txtMortgageProtectionInsurances.Text="0";
            }
                else
                    txtMortgageProtectionInsurances.Text=fNeed.mortgageProtectionInsurances;

            if (fNeed.inflationAdjustedReturns == null || fNeed.inflationAdjustedReturns == "")
            {
                AssumptionDAO assumptionDao = new AssumptionDAO();
                txtInflationAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage+"";
            }
            else
                txtInflationAdjustedReturns.Text = fNeed.inflationAdjustedReturns;

            if (fNeed.familyNeedsAssets!=null)
                noofmembers.Value = fNeed.familyNeedsAssets.Count+"";
            else
                noofmembers.Value = "0";

            familyNeedsAssetList.DataSource = fNeed.familyNeedsAssets;
            familyNeedsAssetList.DataBind();

            if (fNeed.familyNeedsAssets != null)
            {
                ViewState["assetsSize"] = fNeed.familyNeedsAssets.Count;

                double sum = 0;
                txtExistingAssetsFamilyneeds.Text = sum.ToString();
            }
        }
コード例 #2
0
        private void populateFamilyNeedIfNoNeed(string caseId)
        {
            IncomeExpenseDAO incomeExpenseDao = new IncomeExpenseDAO();
            incomeExpense incomeExpense = incomeExpenseDao.getIncomeExpenseForCase(caseId);

            AssetAndLiabilityDAO assetLiabilityDao = new AssetAndLiabilityDAO();
            assetAndLiability assetAndLiability = assetLiabilityDao.getAssetLiabilityForCase(caseId);

            string yearsToSupport = getYearsToSupport(caseId);

            txtYrsOfSupport.Text = yearsToSupport;

            float percentage = 70;

            familyIncPrNeeded2.Selected = true;
            mortgagePrNeeded2.Selected = true;

            if (incomeExpense != null)
            {
                if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                {
                    txtReplacementIncome.Text = Math.Round((float.Parse(incomeExpense.netMonthlyIncomeAfterCpf) * 12 * percentage * .01)) + "";
                }
                else
                    txtReplacementIncome.Text = "0";
            }
            else
                txtReplacementIncome.Text = "0";

            if (incomeExpense != null)
            {
                if (incomeExpense.emergencyFundsNeeded != null && incomeExpense.emergencyFundsNeeded != "")
                    txtEmergencyFundsNeeded.Text = incomeExpense.emergencyFundsNeeded;
                else
                    txtEmergencyFundsNeeded.Text = "0";
            }
            else
                txtEmergencyFundsNeeded.Text = "0";

                AssumptionDAO assumptionDao = new AssumptionDAO();
                txtInflationAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage + "";

            if (assetAndLiability != null)
            {
                float liability = 0;

                if (assetAndLiability.vehicleLoan != null && assetAndLiability.vehicleLoan != "")
                {
                    liability += float.Parse(assetAndLiability.vehicleLoan);
                }

                if (assetAndLiability.cashLoan != null && assetAndLiability.cashLoan != "")
                {
                    liability += float.Parse(assetAndLiability.cashLoan);
                }

                if (assetAndLiability.creditCard != null && assetAndLiability.creditCard != "")
                {
                    liability += float.Parse(assetAndLiability.creditCard);
                }

                if (assetAndLiability.liabilityOthers != null)
                {
                    int count = assetAndLiability.liabilityOthers.Count;

                    EntitySet<liabilityOther> others = assetAndLiability.liabilityOthers;
                    for (int i = 0; i < count; i++)
                    {
                        if (others[i].cash != null && others[i].cash != "")
                            liability += float.Parse(others[i].cash);
                    }
                }

                txtOtherLiabilities.Text = liability + "";
            }
            else
                txtOtherLiabilities.Text = "0";

            float existLifeInsurance = 0;
            if (incomeExpense != null)
            {
                if (incomeExpense.DeathTermInsuranceSA != null && incomeExpense.DeathTermInsuranceSA != "")
                {
                    existLifeInsurance += float.Parse(incomeExpense.DeathTermInsuranceSA);
                }
                if (incomeExpense.DeathWholeLifeInsuranceSA != null && incomeExpense.DeathWholeLifeInsuranceSA != "")
                {
                    existLifeInsurance += float.Parse(incomeExpense.DeathWholeLifeInsuranceSA);
                }
                if (incomeExpense.lifeInsuranceSA != null && incomeExpense.lifeInsuranceSA != "")
                {
                    existLifeInsurance += float.Parse(incomeExpense.lifeInsuranceSA);
                }
            }

            txtExistingLifeInsurance.Text = existLifeInsurance + "";

            if (assetAndLiability != null)
            {
                if (assetAndLiability.homeMortgage != null && assetAndLiability.homeMortgage != "")
                {
                    txtMortgageProtectionOutstanding.Text = assetAndLiability.homeMortgage;
                }
                else
                    txtMortgageProtectionOutstanding.Text = "0";
            }
            else
                txtMortgageProtectionOutstanding.Text = "0";

            if (incomeExpense != null)
            {
                if (incomeExpense.mortgageSA != null && incomeExpense.mortgageSA != "")
                {
                    txtMortgageProtectionInsurances.Text = incomeExpense.mortgageSA;
                }
                else
                    txtMortgageProtectionInsurances.Text = "0";
            }
            else
                txtMortgageProtectionInsurances.Text = "0";
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AssumptionDAO dao = new AssumptionDAO();

            string shortfallString1 = Request.QueryString["shortfall"];
            string yrstoAccumulateString1= Request.QueryString["yrstoAccumulate"];
            string moduleNameString = Request.QueryString["moduleName"];

            float shortfall = 0;

            if (shortfallString1 != null && shortfallString1 != "" && shortfallString1 != "NaN")
            {
                shortfall = float.Parse(shortfallString1);
            }

            int yearsOfRetirement = 0;

            if (yrstoAccumulateString1 != null && yrstoAccumulateString1 != "" && yrstoAccumulateString1 != "NaN")
            {
                yearsOfRetirement = int.Parse(yrstoAccumulateString1);
            }

            shortfallString.Text = shortfall + "";
            yrstoAccumulateString.Text = yearsOfRetirement + "";

            int module = int.Parse(moduleNameString);

            double regularSumValue1 = 0;
            double regularSumValue2 = 0;
            double regularSumValue3 = 0;
            double regularSumValue4 = 0;

            double lumpSumValue1 = 0;
            double lumpSumValue2 = 0;
            double lumpSumValue3 = 0;
            double lumpSumValue4 = 0;

            float lowest = 0;
            float low = 0;
            float high = 0;
            float highest = 0;

            low = float.Parse(dao.getAssumptionById(6).percentage+"");
            lowest = float.Parse(dao.getAssumptionById(5).percentage+"");
            high = float.Parse(dao.getAssumptionById(7).percentage+"");
            highest = float.Parse(dao.getAssumptionById(8).percentage+"");

            switch (module)
            {
                case 1:
                    {
                        regularSumValue1 = calculateRegularSum(shortfall, lowest, yearsOfRetirement);
                        regularSumValue2 = calculateRegularSum(shortfall, low, yearsOfRetirement);
                        regularSumValue3 = calculateRegularSum(shortfall, high, yearsOfRetirement);
                        regularSumValue4 = calculateRegularSum(shortfall, highest, yearsOfRetirement);

                        lumpSumValue1 = calculateLumpSum(shortfall, lowest, yearsOfRetirement);
                        lumpSumValue2 = calculateLumpSum(shortfall, low, yearsOfRetirement);
                        lumpSumValue3 = calculateLumpSum(shortfall, high, yearsOfRetirement);
                        lumpSumValue4 = calculateLumpSum(shortfall, highest, yearsOfRetirement);
                    };
                    break;
                case 2:
                    {
                        regularSumValue1 = calculateRegularSumRetirement(shortfall, lowest, yearsOfRetirement);
                        regularSumValue2 = calculateRegularSumRetirement(shortfall, low, yearsOfRetirement);
                        regularSumValue3 = calculateRegularSumRetirement(shortfall, high, yearsOfRetirement);
                        regularSumValue4 = calculateRegularSumRetirement(shortfall, highest, yearsOfRetirement);

                        lumpSumValue1 = calculateLumpSumRetirement(shortfall, lowest, yearsOfRetirement);
                        lumpSumValue2 = calculateLumpSumRetirement(shortfall, low, yearsOfRetirement);
                        lumpSumValue3 = calculateLumpSumRetirement(shortfall, high, yearsOfRetirement);
                        lumpSumValue4 = calculateLumpSumRetirement(shortfall, highest, yearsOfRetirement);

                    };
                    break;
                case 3:
                    {
                        regularSumValue1 = calculateRegularSumEducationGoal(shortfall, lowest, yearsOfRetirement);
                        regularSumValue2 = calculateRegularSumEducationGoal(shortfall, low, yearsOfRetirement);
                        regularSumValue3 = calculateRegularSumEducationGoal(shortfall, high, yearsOfRetirement);
                        regularSumValue4 = calculateRegularSumEducationGoal(shortfall, highest, yearsOfRetirement);

                        lumpSumValue1 = calculateLumpSumEducationGoal(shortfall, lowest, yearsOfRetirement);
                        lumpSumValue2 = calculateLumpSumEducationGoal(shortfall, low, yearsOfRetirement);
                        lumpSumValue3 = calculateLumpSumEducationGoal(shortfall, high, yearsOfRetirement);
                        lumpSumValue4 = calculateLumpSumEducationGoal(shortfall, highest, yearsOfRetirement);
                    };
                    break;
                default:
                    break;
            }

            lowest1.Text = regularSumValue1 + "";
            low1.Text = regularSumValue2 + "";
            high1.Text = regularSumValue3 + "";
            highest1.Text = regularSumValue4 + "";

            lumpsumLowest1.Text = lumpSumValue1 + "";
            lumpsumLow1.Text = lumpSumValue2 + "";
            lumpsumHigh1.Text = lumpSumValue3 + "";
            lumpsumHighest1.Text = lumpSumValue4 + "";
        }
コード例 #4
0
        private void populateMyNeedIfNoNeed(string caseId)
        {
            IncomeExpenseDAO IncomeExpenseDAO = new IncomeExpenseDAO();
            incomeExpense incomeExpense = IncomeExpenseDAO.getIncomeExpenseForCase(caseId);

            AssetAndLiabilityDAO assetLiabilityDao = new AssetAndLiabilityDAO();
            assetAndLiability assetAndLiability = assetLiabilityDao.getAssetLiabilityForCase(caseId);

            float criticalIllnessPercentage = 100;
            float disabilityIncomePercentage = 75;

            criticalIllnessPr2.Selected = true;
            disabilityPr2.Selected = true;
            hospitalmedCoverNeeded2.Selected = true;
            accidentalHealthCoverNeeded2.Selected = true;

            if (incomeExpense != null)
            {
                if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                {
                    replacementIncomeRequired.Text = Math.Round((float.Parse(incomeExpense.netMonthlyIncomeAfterCpf) * 12 * criticalIllnessPercentage * .01)) + "";
                }
            }
            else
                replacementIncomeRequired.Text = "0";

            if (incomeExpense != null)
            {
                if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                {
                    disabilityProtectionReplacementIncomeRequired.Text = (float.Parse(incomeExpense.netMonthlyIncomeAfterCpf) * 12 * disabilityIncomePercentage * .01) + "";
                }
            }
            else
                disabilityProtectionReplacementIncomeRequired.Text = "0";

            if (incomeExpense != null)
            {
                if (incomeExpense.criticalIllnessSA != null && incomeExpense.criticalIllnessSA != "")
                {
                    txtCriticalIllnessInsurance.Text = incomeExpense.criticalIllnessSA;
                }
                else
                    txtCriticalIllnessInsurance.Text = "0";
            }
            else
                txtCriticalIllnessInsurance.Text = "0";

            if (incomeExpense != null)
            {
                if (incomeExpense.tpdcSA != null && incomeExpense.tpdcSA != "")
                {
                    disabilityInsurance.Text = incomeExpense.tpdcSA;
                }
                else
                    disabilityInsurance.Text = "0";
            }
            else
                disabilityInsurance.Text = "0";

            AssumptionDAO assumptionDao = new AssumptionDAO();
            inflationAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage + "";
            inflatedAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage + "";
            yearsOfSupportRequired.Text = getYearsToSupportCriticalIllness(caseId);
            disabilityYearsOfSupport.Text = getYearsToSupportDisabilityProtection(caseId);
        }
コード例 #5
0
        private void populateMyNeed(myNeed mNeed)
        {
            IncomeExpenseDAO IncomeExpenseDAO = new IncomeExpenseDAO();
            incomeExpense incomeExpense= IncomeExpenseDAO.getIncomeExpenseForCase(mNeed.caseId);

            AssetAndLiabilityDAO assetLiabilityDao = new AssetAndLiabilityDAO();
            assetAndLiability assetAndLiability = assetLiabilityDao.getAssetLiabilityForCase(mNeed.caseId);

            float criticalIllnessPercentage = 100;
            float disabilityIncomePercentage = 75;

            if (mNeed.criticalIllnessPrNeeded != null)
            {
                criticalIllnessPr.SelectedValue = mNeed.criticalIllnessPrNeeded.ToString();
            }
            else
            {
                criticalIllnessPr2.Selected = true;
            }

            if (mNeed.disabilityPrNeeded != null)
            {
                disabilityPr.SelectedValue = mNeed.disabilityPrNeeded.ToString();
            }
            else
            {
                disabilityPr2.Selected = true;
            }

            if (mNeed.hospitalmedCoverNeeded != null)
            {
                hospitalmedCoverNeeded.SelectedValue = mNeed.hospitalmedCoverNeeded.ToString();
            }
            else
            {
                hospitalmedCoverNeeded2.Selected = true;
            }

            if (mNeed.accidentalhealthCoverNeeded != null)
            {
                accidentalHealthCoverNeeded.SelectedValue = mNeed.accidentalhealthCoverNeeded.ToString();
            }
            else
            {
                accidentalHealthCoverNeeded2.Selected = true;
            }

            if (mNeed.replacementIncomeRequired == null || mNeed.replacementIncomeRequired == "")
            {
                if (incomeExpense != null)
                {
                    if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                    {
                        replacementIncomeRequired.Text = Math.Round((float.Parse(incomeExpense.netMonthlyIncomeAfterCpf) * 12 * criticalIllnessPercentage * .01)) + "";
                    }
                }
                else
                    replacementIncomeRequired.Text = "0";
            }
            else
                replacementIncomeRequired.Text = mNeed.replacementIncomeRequired;

            if (mNeed.disabilityProtectionReplacementIncomeRequired == null || mNeed.disabilityProtectionReplacementIncomeRequired == "")
            {
                if (incomeExpense != null)
                {
                    if (incomeExpense.netMonthlyIncomeAfterCpf != null && incomeExpense.netMonthlyIncomeAfterCpf != "")
                    {
                        disabilityProtectionReplacementIncomeRequired.Text = (float.Parse(incomeExpense.netMonthlyIncomeAfterCpf) * 12 * disabilityIncomePercentage * .01) + "";
                    }
                }
                else
                    disabilityProtectionReplacementIncomeRequired.Text = "0";
            }
            else
                disabilityProtectionReplacementIncomeRequired.Text = mNeed.disabilityProtectionReplacementIncomeRequired;

            if (mNeed.criticalIllnessInsurance == null || mNeed.criticalIllnessInsurance == "")
            {
                if (incomeExpense != null)
                {
                    if (incomeExpense.criticalIllnessSA != null && incomeExpense.criticalIllnessSA != "")
                    {
                        txtCriticalIllnessInsurance.Text = incomeExpense.criticalIllnessSA;
                    }
                    else
                        txtCriticalIllnessInsurance.Text = "0";
                }
                else
                    txtCriticalIllnessInsurance.Text = "0";
             }
            else
                txtCriticalIllnessInsurance.Text = mNeed.criticalIllnessInsurance;

            if (mNeed.disabilityInsurance == null || mNeed.disabilityInsurance == "")
            {
                if (incomeExpense != null)
                {
                    if (incomeExpense.tpdcSA != null && incomeExpense.tpdcSA != "")
                    {
                        disabilityInsurance.Text = incomeExpense.tpdcSA;
                    }
                    else
                        disabilityInsurance.Text = "0";
                }
                else
                    disabilityInsurance.Text = "0";
            }
            else
                disabilityInsurance.Text = mNeed.disabilityInsurance;

            string yearsToSupportCriticalIllness = getYearsToSupportCriticalIllness(mNeed.caseId);
            string yearsToSupportDisabilityProtection = getYearsToSupportDisabilityProtection(mNeed.caseId);

            if (mNeed.yearsOfSupportRequired == null || mNeed.yearsOfSupportRequired == "")
            {
                yearsOfSupportRequired.Text = yearsToSupportCriticalIllness;
            }
            else
                yearsOfSupportRequired.Text = mNeed.yearsOfSupportRequired;

            if (mNeed.disabilityYearsOfSupport == null || mNeed.disabilityYearsOfSupport == "")
            {
                disabilityYearsOfSupport.Text = yearsToSupportDisabilityProtection;
            }
            else
                disabilityYearsOfSupport.Text = mNeed.disabilityYearsOfSupport;

            //inflatedAdjustedReturns.Text = (mNeed.inflatedAdjustedReturns == null || mNeed.inflatedAdjustedReturns == "") ? "0" : mNeed.inflatedAdjustedReturns;
            replacementAmountRequired.Text = (mNeed.replacementAmountRequired == null || mNeed.replacementAmountRequired == "") ? "0" : mNeed.replacementAmountRequired;
            disabilityReplacementAmountRequired.Text = (mNeed.disabilityReplacementAmountRequired == null || mNeed.disabilityReplacementAmountRequired == "") ? "0" : mNeed.disabilityReplacementAmountRequired;
            //disabilityInsurance.Text = (mNeed.disabilityInsurance == null || mNeed.disabilityInsurance == "") ? "0" : mNeed.disabilityInsurance;
            //inflationAdjustedReturns.Text = (mNeed.inflationAdjustedReturns == null || mNeed.inflationAdjustedReturns == "") ? "0" : mNeed.inflationAdjustedReturns;

            if (mNeed.inflationAdjustedReturns == null || mNeed.inflationAdjustedReturns == "")
            {
                AssumptionDAO assumptionDao = new AssumptionDAO();
                inflationAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage + "";
            }
            else
                inflationAdjustedReturns.Text = mNeed.inflationAdjustedReturns;

            if (mNeed.inflatedAdjustedReturns == null || mNeed.inflatedAdjustedReturns == "")
            {
                AssumptionDAO assumptionDao = new AssumptionDAO();
                inflatedAdjustedReturns.Text = assumptionDao.getAssumptionById(4).percentage + "";
            }
            else
                inflatedAdjustedReturns.Text = mNeed.inflatedAdjustedReturns;

            txtlumpSumRequiredForTreatment.Text = (mNeed.lumpSumRequiredForTreatment == null || mNeed.lumpSumRequiredForTreatment == "") ? "0" : mNeed.lumpSumRequiredForTreatment;
            //txtCriticalIllnessInsurance.Text = (mNeed.criticalIllnessInsurance == null || mNeed.criticalIllnessInsurance == "") ? "0" : mNeed.criticalIllnessInsurance;
            txtExistingAssetsMyNeedsCritical.Text = (mNeed.existingAssetsMyneeds == null || mNeed.existingAssetsMyneeds == "") ? "0" : mNeed.existingAssetsMyneeds;
            txtExistingAssetsMyneedsDisability.Text = (mNeed.existingAssetsMyneedsDisability == null || mNeed.existingAssetsMyneedsDisability == "") ? "0" : mNeed.existingAssetsMyneedsDisability;
            ddlHospitalTypeList.SelectedValue = (mNeed.typeOfHospitalCoverage == null || mNeed.typeOfHospitalCoverage == "") ? "" : mNeed.typeOfHospitalCoverage;

            if (mNeed.anyExistingPlans != null)
            {
                ddlExistingPlanList.SelectedValue = mNeed.anyExistingPlans == true ? "1" : "0";
            }
            else
            {
                ddlExistingPlanList.SelectedValue = "";
            }
            ViewState["anyExPl"] = ddlExistingPlanList.SelectedValue;

            if (mNeed.typeOfRoomCoverage != null)
            {
                ddlRoomTypeList.SelectedValue = mNeed.typeOfRoomCoverage.ToString();
            }
            else
            {
                ddlRoomTypeList.SelectedValue = "";
            }

            if (mNeed.coverageOldageYesNo != null)
            {
                ddlCoverageOldageYesNo.SelectedValue = mNeed.coverageOldageYesNo == true ? "1" : "0";
            }
            else
                ddlCoverageOldageYesNo.SelectedValue = "";

            if (mNeed.coverageOutpatientMedExp != null)
            {
                coverageOutpatientMedExp.SelectedValue = mNeed.coverageOutpatientMedExp == true ? "1" : "0";
            }
            else
            {
                coverageOutpatientMedExp.SelectedValue = "";
            }

            if (mNeed.coverageLossOfIncome != null)
            {
                coverageLossOfIncome.SelectedValue = mNeed.coverageLossOfIncome == true ? "1" : "0";
            }
            else
            {
                coverageLossOfIncome.SelectedValue = "";
            }

            if (mNeed.coverageOldageDisabilities != null)
            {
                coverageOldageDisabilities.SelectedValue = mNeed.coverageOldageDisabilities == true ? "1" : "0";
            }
            else
            {
                coverageOldageDisabilities.SelectedValue = "";
            }

            if (mNeed.coverageDentalExp != null)
            {
                coverageDentalExp.SelectedValue = mNeed.coverageDentalExp == true ? "1" : "0";
            }
            else
            {
                coverageDentalExp.SelectedValue = "";
            }

            //ddlEpOldageYesNo.SelectedValue = mNeed.epOldageYesNo == true ? "1" : "0";

            if (mNeed.epOldageYesNo != null)
            {
                ddlEpOldageYesNo.SelectedValue = mNeed.epOldageYesNo == true ? "1" : "0";
            }
            else
            {
                ddlEpOldageYesNo.SelectedValue = "";
            }
            ViewState["oldageExPl"] = ddlEpOldageYesNo.SelectedValue;

            //ddlCoveragePersonalYesNo.SelectedValue = mNeed.coveragePersonalYesNo == true ? "1" : "0";

            if (mNeed.coveragePersonalYesNo != null)
            {
                ddlCoveragePersonalYesNo.SelectedValue = mNeed.coveragePersonalYesNo == true ? "1" : "0";
            }
            else
                ddlCoveragePersonalYesNo.SelectedValue = "";

            //ddlEpPersonalYesNo.SelectedValue = mNeed.epPersonalYesNo == true ? "1" : "0";

            if (mNeed.epPersonalYesNo != null)
            {
                ddlEpPersonalYesNo.SelectedValue = mNeed.epPersonalYesNo == true ? "1" : "0";
            }
            else
            {
                ddlEpPersonalYesNo.SelectedValue = "";
            }
            ViewState["personalExPl"] = ddlEpPersonalYesNo.SelectedValue;

            if (mNeed.epOutpatientMedExp != null)
            {
                epOutpatientMedExp.SelectedValue = mNeed.epOutpatientMedExp == true ? "1" : "0";
            }
            else
            {
                epOutpatientMedExp.SelectedValue = "";
            }
            ViewState["epOutpatientMedExp"] = epOutpatientMedExp.SelectedValue;

            if (mNeed.epLossOfIncome != null)
            {
                epLossOfIncome.SelectedValue = mNeed.epLossOfIncome == true ? "1" : "0";
            }
            else
            {
                epLossOfIncome.SelectedValue = "";
            }
            ViewState["epLossOfIncome"] = epLossOfIncome.SelectedValue;

            if (mNeed.epOldageDisabilities != null)
            {
                epOldageDisabilities.SelectedValue = mNeed.epOldageDisabilities == true ? "1" : "0";
            }
            else
            {
                epOldageDisabilities.SelectedValue = "";
            }
            ViewState["epOldageDisabilities"] = epOldageDisabilities.SelectedValue;

            if (mNeed.epDentalExp != null)
            {
                epDentalExp.SelectedValue = mNeed.epDentalExp == true ? "1" : "0";
            }
            else
            {
                epDentalExp.SelectedValue = "";
            }
            ViewState["epDentalExp"] = epDentalExp.SelectedValue;

            if (mNeed.existingPlansDetail != null)
            {
                DetailsOfExistingPlans.Text = mNeed.existingPlansDetail.ToString();
            }
            else
                DetailsOfExistingPlans.Text = "";

            myNeedsCriticalAssetList.DataSource = mNeed.myNeedsCriticalAssets;
            myNeedsCriticalAssetList.DataBind();

            if (mNeed.myNeedsCriticalAssets != null)
            {
                ViewState["noofcriticalassets"] = mNeed.myNeedsCriticalAssets.Count;

                double sum = 0;
                txtTotalShortfallSurplusMyNeeds.Text = sum.ToString();
            }

            myNeedsDisabilityAssetList.DataSource = mNeed.myNeedsDisabilityAssets;
            myNeedsDisabilityAssetList.DataBind();

            if (mNeed.myNeedsDisabilityAssets != null)
            {
                ViewState["noofdisablityassets"] = mNeed.myNeedsDisabilityAssets.Count;
            }
        }
コード例 #6
0
        private string getYearsToSupportDisabilityProtection(string caseId)
        {
            PersonalDetailsDAO dao = new PersonalDetailsDAO();
            personaldetail detail = dao.getPersonalDetail(caseId);
            AssumptionDAO assumptionDao = new AssumptionDAO();
            string yearsOfSupport = "0";
            if (detail != null)
            {
                string dob = detail.datepicker;
                if (dob != null && dob != "")
                {
                    DateTime now = DateTime.Today;
                    DateTime parsedDobDate = Convert.ToDateTime(getDateInProperFormat(dob));
                    int age = now.Year - parsedDobDate.Year;
                    if (now.Month < parsedDobDate.Month)
                    {
                        age = age - 1;
                    }
                    if (now.Month == parsedDobDate.Month)
                    {
                        if (now.Day < parsedDobDate.Day)
                        {
                            age = age - 1;
                        }
                    }
                    if (age < 62)
                        yearsOfSupport = (62 - age) + "";
                }
            }

            return yearsOfSupport;
        }
コード例 #7
0
 private string getYearsToSupportCriticalIllness(string caseId)
 {
     AssumptionDAO assumptionDao = new AssumptionDAO();
     string yearsOfSupport = assumptionDao.getAssumptionById(12).percentage + "";
     return yearsOfSupport;
 }