public DataSet GetCustomerRTDetails(int CustomerID) { DataSet dsGetCustomerRTDetails = new DataSet(); CustomerGoalSetupDao RTDetails = new CustomerGoalSetupDao(); try { dsGetCustomerRTDetails = RTDetails.GetCustomerRTDetails(CustomerID); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerGoalSetupBo.cs:GetCustomerRTDetails()"); object[] objects = new object[0]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(dsGetCustomerRTDetails); }
/// <summary> /// It retuns Customer Retirement Goal description paragrapgh /// </summary> /// <param name="CustomerID"></param> /// <returns></returns> public string RTGoalDescriptionText(int CustomerID) { string GoalDescription = ""; DataSet dsGetCustomerRTDetails = new DataSet(); CustomerGoalSetupDao RTDetails = new CustomerGoalSetupDao(); try { string futureValueOncurrentInvestment = null; string futureValueOncurrentInvestment2 = null; string yearlySavingRequired = null; string gapvalues = null; dsGetCustomerRTDetails = RTDetails.GetCustomerRTDetails(CustomerID); if (dsGetCustomerRTDetails.Tables[0].Rows.Count > 0) { if (string.IsNullOrEmpty(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_FutureValueOnCurrentInvest"].ToString())) { futureValueOncurrentInvestment = "0"; } else { futureValueOncurrentInvestment = Math.Round(double.Parse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_FutureValueOnCurrentInvest"].ToString()), 2).ToString(); } if (string.IsNullOrEmpty(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_LumpsumInvestmentRequired"].ToString())) { futureValueOncurrentInvestment2 = "0"; } else { futureValueOncurrentInvestment2 = Math.Round(double.Parse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_LumpsumInvestmentRequired"].ToString()), 2).ToString(); } if (string.IsNullOrEmpty(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_YearlySavingsRequired"].ToString())) { yearlySavingRequired = "0"; } else { yearlySavingRequired = Math.Round(double.Parse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_YearlySavingsRequired"].ToString()), 2).ToString(); } if (string.IsNullOrEmpty(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_GapValues"].ToString())) { gapvalues = "0"; } else { gapvalues = Math.Round(double.Parse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_GapValues"].ToString()), 2).ToString(); } if (dsGetCustomerRTDetails.Tables[0].Rows.Count > 0) { double fvCostOfToday = 0; double currentInvestment = 0; double roiEarned = 0; double monthlySavingsRequired = 0; double.TryParse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_FVofCostToday"].ToString(), out fvCostOfToday); double.TryParse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_CurrentInvestment"].ToString(), out currentInvestment); double.TryParse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_ROIEarned"].ToString(), out roiEarned); double.TryParse(dsGetCustomerRTDetails.Tables[0].Rows[0]["CG_MonthlySavingsRequired"].ToString(), out monthlySavingsRequired); string StrRT1 = "We have done an extensive analysis of your" + " retirement goal needs and savings required per month to meet those " + "needs.Based on the inputs provided by you we have calculated that at " + "the time of your retirement you'll need a corpus of Rs." + Math.Round(fvCostOfToday, 2).ToString() + " to lead a financialy stable retired life."; string StrRT2 = "To meet the retirement goal you have already invested Rs." + Math.Round(currentInvestment, 2).ToString() + " which will grow at " + Math.Round(roiEarned, 2).ToString() + " % " + " and it's value at the time of your retirement will be Rs." + futureValueOncurrentInvestment + "."; string StrRT3 = "You have no investmensts attached to your retirement."; string StrRT4 = "For the gap of Rs." + gapvalues + " for your retirement goal, you need to start planning soon." + "You can opt for any of the following saving options to meet your retirement goal." + " Monthly savings required to meet the goal is Rs." + Math.Round(monthlySavingsRequired, 2).ToString() + ".Yearly savings required to meet the goal is Rs." + yearlySavingRequired + ".Lumpsum investment required is Rs." + futureValueOncurrentInvestment2 + ".We recommend you to start saving as per the retirement plan provided by us."; if (currentInvestment == 0) { GoalDescription = StrRT1 + StrRT3 + StrRT4; } else { GoalDescription = StrRT1 + StrRT2 + StrRT4; } } else { GoalDescription = ""; } } else { GoalDescription = ""; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerGoalSetupBo.cs:GetCustomerRTDetails()"); object[] objects = new object[0]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(GoalDescription); }