Ejemplo n.º 1
0
        public double SumSavingReq(int CustomerId, int ActiveFlag)
        {
            double SumSave = 0;
            List <GoalProfileSetupVo> GoalProfileList        = new List <GoalProfileSetupVo>();
            CustomerGoalSetupDao      customerGoalProfileDao = new CustomerGoalSetupDao();
            GoalProfileSetupVo        goalProfileSetupVo     = new GoalProfileSetupVo();

            GoalProfileList = customerGoalProfileDao.GetCustomerGoalProfile(CustomerId, ActiveFlag);

            try
            {
                for (int i = 0; i < GoalProfileList.Count; i++)
                {
                    SumSave += goalProfileSetupVo.MonthlySavingsReq;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerGoalSetupBo.cs:SumSavingReq()");
                object[] objects = new object[1];
                objects[0] = CustomerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(SumSave);
        }
Ejemplo n.º 2
0
        public List <GoalProfileSetupVo> GetCustomerGoalProfile(int CustomerId, int ActiveFlag)
        {
            List <GoalProfileSetupVo> GoalProfileList        = new List <GoalProfileSetupVo>();
            CustomerGoalSetupDao      customerGoalProfileDao = new CustomerGoalSetupDao();

            try
            {
                GoalProfileList = customerGoalProfileDao.GetCustomerGoalProfile(CustomerId, ActiveFlag);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerGoalSetupBo.cs:GetCustomerGoalProfile()");
                object[] objects = new object[1];
                objects[0] = CustomerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(GoalProfileList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// It retuns Customer Other Goals description paragrapgh
        /// </summary>
        /// <param name="CustomerId"></param>
        /// <returns></returns>
        public string OtherGoalDescriptionText(int CustomerId)
        {
            string GoalDescription = "";
            List <GoalProfileSetupVo> GoalProfileList        = new List <GoalProfileSetupVo>();
            CustomerGoalSetupDao      customerGoalProfileDao = new CustomerGoalSetupDao();

            try
            {
                double totalChildEducation = 0;
                double totalChildMarriage  = 0;
                double totalHome           = 0;
                double totalOther          = 0;

                string strMain           = "";
                string strChildEducation = "";
                string strChildMarriage  = "";
                string strHome           = "";
                string strOther          = "";
                string strTotal          = "";

                GoalProfileList = customerGoalProfileDao.GetCustomerGoalProfile(CustomerId, 1);
                if (GoalProfileList != null)
                {
                    for (int i = 0; i < GoalProfileList.Count; i++)
                    {
                        goalProfileSetupVo = new GoalProfileSetupVo();
                        goalProfileSetupVo = GoalProfileList[i];
                        if (goalProfileSetupVo.Goalcode == "BH")
                        {
                            totalHome = totalHome + goalProfileSetupVo.MonthlySavingsReq;
                        }
                        if (goalProfileSetupVo.Goalcode == "ED")
                        {
                            totalChildEducation = totalChildEducation + goalProfileSetupVo.MonthlySavingsReq;
                        }
                        if (goalProfileSetupVo.Goalcode == "MR")
                        {
                            totalChildMarriage = totalChildMarriage + goalProfileSetupVo.MonthlySavingsReq;
                        }
                        if (goalProfileSetupVo.Goalcode == "OT")
                        {
                            totalOther = totalOther + goalProfileSetupVo.MonthlySavingsReq;
                        }
                    }
                    double TotalCost = totalChildEducation + totalChildMarriage + totalHome + totalOther;

                    strMain = "Based on your inputs we have done an analysis of your life's major financial goals and savings required to achieve them.";
                    if (totalChildEducation != 0)
                    {
                        strChildEducation = "You need to save Rs." + Math.Round(totalChildEducation, 2).ToString() + " to meet your children's higher education expenses.";
                    }
                    if (totalChildMarriage != 0)
                    {
                        strChildMarriage = "Your monthly saving should be Rs." + Math.Round(totalChildMarriage, 2).ToString() + " to meet your children's marriage expeneses.";
                    }
                    if (totalHome != 0)
                    {
                        strHome = "For buying house you need to save Rs." + Math.Round(totalHome, 2).ToString() + " every month.";
                    }
                    if (totalOther != 0)
                    {
                        strOther = "For other Goals you need to save Rs." + Math.Round(totalOther, 2).ToString() + " every month.";
                    }

                    strTotal = "To meet all your major life goals other than retirement you need to save Rs." + Math.Round(TotalCost, 2).ToString() + " every month.";

                    GoalDescription = strMain + strChildEducation + strChildMarriage + strHome + strOther + strTotal;
                }
                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:GetCustomerGoalProfile()");
                object[] objects = new object[1];
                objects[0] = CustomerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(GoalDescription);
        }