Ejemplo n.º 1
0
        public ActionResult UpdateRiskProfile(RiskProfileBindingModel model)
        {
            if (model == null)
            {
                ModelState.AddModelError("", "Model is not entered");
                return(View(model));
            }

            if (ModelState.IsValid)
            {
                //clientRepo.AddOrUpdateRiskProfile(model);
                //clientRepo.Save();
                TempData["success"] = "Profile has been successfully updated";
            }
            return(View(model));
        }
Ejemplo n.º 2
0
        public PartialViewResult CompletePersonProfile()
        {
            var userId      = User.Identity.GetUserId();
            var client      = edisRopo.GetClientSync(userId, DateTime.Now);
            var riskProfile = edisRopo.getRiskProfileForClient(client.Id);
            RiskProfileBindingModel riskModel = null;

            if (riskProfile != null)
            {
                riskModel = new RiskProfileBindingModel {
                    capitalLossAttitude    = riskProfile.CapitalLossAttitude,
                    clientId               = riskProfile.ClientID,
                    comments               = riskProfile.Comments,
                    incomeSource           = riskProfile.IncomeSource,
                    retirementAge          = riskProfile.RetirementAge.ToString(),
                    riskAttitude           = riskProfile.RiskAttitude,
                    shortTermEquityPercent = riskProfile.ShortTermEquityPercent,
                    shortTermAssetPercent  = riskProfile.ShortTermAssetPercent,
                    investmentKnowledge    = riskProfile.InvestmentKnowledge,
                    investmentObjective1   = riskProfile.InvestmentObjective1,
                    investmentObjective2   = riskProfile.InvestmentObjective2,
                    investmentObjective3   = riskProfile.InvestmentObjective3,
                    investmentProfile      = riskProfile.InvestmentProfile,
                    investmentTimeHorizon  = riskProfile.InvestmentTimeHorizon,
                    longTermGoal1          = riskProfile.LongTermGoal1,
                    longTermGoal2          = riskProfile.LongTermGoal2,
                    longTermGoal3          = riskProfile.LongTermGoal3,
                    medTermGoal1           = riskProfile.MedTermGoal1,
                    medTermGoal2           = riskProfile.MedTermGoal2,
                    medTermGoal3           = riskProfile.MedTermGoal3,
                    profileId              = riskProfile.RiskProfileID,
                    retirementIncome       = riskProfile.RetirementIncome,
                    shortTermGoal1         = riskProfile.ShortTermGoal1,
                    shortTermGoal2         = riskProfile.ShortTermGoal2,
                    shortTermGoal3         = riskProfile.ShortTermGoal3,
                    shortTermTrading       = riskProfile.ShortTermTrading
                };
            }

            ClientPersonCompleteProfileBinding model = new ClientPersonCompleteProfileBinding {
                UserId      = userId,
                FirstName   = client.FirstName,
                MiddleName  = client.MiddleName,
                LastName    = client.LastName,
                Phone       = client.Phone,
                Mobile      = client.Mobile,
                DOB         = client.Dob,
                Fax         = client.Fax,
                Gender      = client.Gender,
                riskProfile = riskModel
            };



            if (!string.IsNullOrEmpty(client.Address))
            {
                string[] address = client.Address.Split(' ');
                model.PostCode = address[address.Length - 1];
                model.Country  = address[address.Length - 2];
                model.State    = address[address.Length - 3];
                model.Suburb   = address[address.Length - 4];
                for (int i = 0; i < address.Length - 4; i++)
                {
                    model.line1 += address[i] + " ";
                }
            }



            return(PartialView(model));
        }