コード例 #1
0
        public User(
            uint _currentAge = 0,
            EmploymentStatus _employmentStatus         = EmploymentStatus.None,
            uint _currentKiwisaverBalance              = 0,
            uint _voluntaryContributions               = 0,
            Frequency _voluntaryContributionsFrequency = Frequency.None,
            RiskProfile _RiskProfile      = RiskProfile.None,
            uint _savingsGoalAtRetirement = 0,
            KiwiMemberContribution _kiwiMemberContribution = KiwiMemberContribution.None,
            uint _salary     = 0,
            uint _projection = 0
            )
        {
            CurrentAge              = _currentAge;
            EmploymentStatus        = _employmentStatus;
            CurrentKiwiBalance      = _currentKiwisaverBalance;
            VoluntaryContributions  = _voluntaryContributions;
            VCFrequency             = _voluntaryContributionsFrequency;
            RiskProfile             = _RiskProfile;
            SavingsGoalAtRetirement = _savingsGoalAtRetirement;

            if (_employmentStatus == EmploymentStatus.Employed)
            {
                Salary = _salary;
                KiwiMemberContribution = _kiwiMemberContribution;
            }
            Projection = _projection;
        }
コード例 #2
0
        public void CreateRandomIndividual(
            uint _currentAge = 0,
            EmploymentStatus _employmentStatus         = EmploymentStatus.None,
            uint _currentKiwisaverBalance              = 0,
            uint _voluntaryContributions               = 0,
            Frequency _voluntaryContributionsFrequency = Frequency.None,
            RiskProfile _RiskProfile      = RiskProfile.None,
            uint _savingsGoalAtRetirement = 0,
            KiwiMemberContribution _kiwiMemberContribution = KiwiMemberContribution.None,
            uint _salary = 0
            )
        {
            CurrentAge              = _currentAge != 0 ? _currentAge : TestContext.CurrentContext.Random.NextUInt(18, 64);
            EmploymentStatus        = _employmentStatus != EmploymentStatus.None ? _employmentStatus : EmploymentStatus.Employed;
            CurrentKiwiBalance      = _currentKiwisaverBalance != 0 ? _currentKiwisaverBalance : TestContext.CurrentContext.Random.NextUInt();
            VoluntaryContributions  = _voluntaryContributions != 0 ? _voluntaryContributions : TestContext.CurrentContext.Random.NextUInt(1000);
            VCFrequency             = _voluntaryContributionsFrequency != Frequency.None ? _voluntaryContributionsFrequency : Frequency.Fortnightly;
            RiskProfile             = _RiskProfile != RiskProfile.None ? _RiskProfile : RiskProfile.Growth;
            SavingsGoalAtRetirement = _savingsGoalAtRetirement != 0 ? _savingsGoalAtRetirement : TestContext.CurrentContext.Random.NextUInt();

            if (_employmentStatus == EmploymentStatus.Employed)
            {
                Salary = _salary != 0 ? _salary : TestContext.CurrentContext.Random.NextUInt();
                KiwiMemberContribution = _kiwiMemberContribution != KiwiMemberContribution.None ? _kiwiMemberContribution : KiwiMemberContribution.ThreePercent;
            }
        }
コード例 #3
0
 internal static CalculateRiskProfileResponse Mapper(RiskProfile riskProfile)
 {
     return(new CalculateRiskProfileResponse()
     {
         Auto = riskProfile.LinesInusrance.First(x => x.Name == LineInsuranceName.Auto).ProcessResult(),
         Disability = riskProfile.LinesInusrance.First(x => x.Name == LineInsuranceName.Disability).ProcessResult(),
         Life = riskProfile.LinesInusrance.First(x => x.Name == LineInsuranceName.Life).ProcessResult(),
         Home = riskProfile.LinesInusrance.First(x => x.Name == LineInsuranceName.Home).ProcessResult()
     });
 }
コード例 #4
0
ファイル: RiskScoreMapper.cs プロジェクト: mahitosh/HRA4
 public static RiskScore ToRiskScore(this RiskProfile RP)
 {
     return(new RiskScore()
     {
         RSRiskOfBRCA1andBRCA2 = new RiskOfBRCA1andBRCA2()
         {
             riskOfBRCA1andBRCA2 = RP.RiskProfile_BrcaPro_1_2_Mut_Prob,
             MyRaid = RP.RiskProfile_Myriad_Brca_1_2,
             Tyrer_Cuzick = RP.RiskProfile_TyrerCuzick_Brca_1_2,
             Tyrer_Cuzick_v7 = RP.RiskProfile_TyrerCuzick_v7_Brca_1_2
         },
         RSBreastCancerRisk = new BreastCancerRisk()
         {
             BRCAPro_5yearsRisk = RP.RiskProfile_BrcaPro_5Year_Breast,
             BRCAPro_LifetimeRisk = RP.RiskProfile_BrcaPro_Lifetime_Breast,
             Claus_5yearsRisk = RP.RiskProfile_Claus_5Year_Breast,
             Claus_LifetimeRisk = RP.RiskProfile_Claus_Lifetime_Breast,
             Gail_5yearsRisk = RP.RiskProfile_Gail_5Year_Breast,
             Gail_LifetimeRisk = RP.RiskProfile_Gail_Lifetime_Breast,
             Tyrer_Cuzick_5yearsRisk = RP.RiskProfile_TyrerCuzick_5Year_Breast,
             Tyrer_Cuzick_LifetimeRisk = RP.RiskProfile_TyrerCuzick_Lifetime_Breast,
             Tyrer_Cuzick_v7_5yearsRisk = RP.RiskProfile_TyrerCuzick_v7_5Year_Breast,
             Tyrer_Cuzick_v7_LifetimeRisk = RP.RiskProfile_TyrerCuzick_v7_Lifetime_Breast
         },
         RSOvarianCancerRisk = new OvarianCancerRisk()
         {
             BRCAPro_5yearsRisk = RP.RiskProfile_BrcaPro_5Year_Ovary,
             BRCAPro_LifetimeRisk = RP.RiskProfile_BrcaPro_Lifetime_Ovary
         },
         RSRiskofLynchSyndromeMutation = new RiskofLynchSyndromeMutation()
         {
             MMRPRO = RP.MmrPro_1_2_6_Mut_Prob,
             PREMM2 = (RP.PREMM2 != null) ? RP.RiskProfile_PREMM2 : RP.RiskProfile_PREMM
         },
         RSColonCancerRisk = new ColonCancerRisk()
         {
             MMRPRO_5yearsRisk = RP.MmrPro_5Year_Colon,
             MMRPRO_LifetimeRisk = RP.MmrPro_Lifetime_Colon,
             CCRAT_5yearsRisk = RP.CCRATModel.Details.CCRAT_FiveYear_CRC,
             CCRAT_LifetimeRisk = RP.CCRATModel.Details.CCRAT_Lifetime_CRC
         },
         RSEndometrialRisk = new EndometrialRisk()
         {
             MMRPRO_5yearsRisk = RP.MmrPro_5Year_Colon,
             MMRPRO_LifetimeRisk = RP.MmrPro_Lifetime_Colon
         }
     });
 }
コード例 #5
0
        public void SetRiskProfile(RiskProfile value)
        {
            var path = "//*[@id='radio-option";

            switch (value)
            {
            case RiskProfile.Defensive:
                Driver.FindElement(By.XPath($"{path}-013']")).Click();
                break;

            case RiskProfile.Conservative:
                Driver.FindElement(By.XPath($"{path}-016']")).Click();
                break;

            case RiskProfile.Balanced:
                Driver.FindElement(By.XPath($"{path}-019']")).Click();
                break;

            case RiskProfile.Growth:
                Driver.FindElement(By.XPath($"{path}-01C']")).Click();
                break;
            }
        }
        public void WhenTheRisksProfileIsCalculated()
        {
            var custumer = _custumerBuilder.Build();

            _riskProfile = _calculateRiskProfileService.Calculate(custumer);
        }
コード例 #7
0
        public ActionResult CompleteEntityProfile(ClientEntityCompleteProfileBinding model)
        {
            var userId = User.Identity.GetUserId();

            if (userId != model.UserID)
            {
                ModelState.AddModelError("", "Invalid user id provided");
            }
            if (ModelState.IsValid)
            {
                ClientRegistration clientRegistration = new ClientRegistration()
                {
                    ClientNumber = model.UserID,
                    Address      = model.line1 + " " + model.line2 + " " + model.line3 + " " + model.Suburb + " " + model.State + " " + model.Country + " " + model.PostCode,
                    EntityName   = model.EntityName,
                    EntityType   = model.EntityType,
                    ABN          = model.ABN,
                    ACN          = model.ACN,
                    Phone        = model.Phone,
                    Fax          = model.Fax
                };

                edisRopo.UpdateClientSync(clientRegistration);


                #region create risk profile if present
                if (model.riskProfile != null)
                {
                    var         riskProfile = model.riskProfile;
                    RiskProfile profile     = new RiskProfile {
                        CapitalLossAttitude    = riskProfile.capitalLossAttitude,
                        ClientID               = edisRopo.GetClientSync(model.UserID, DateTime.Now).Id,
                        Comments               = riskProfile.comments,
                        DateCreated            = DateTime.Now,
                        DateModified           = DateTime.Now,
                        IncomeSource           = riskProfile.incomeSource,
                        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,
                        RetirementAge          = string.IsNullOrEmpty(riskProfile.retirementAge) ? (int?)null : Convert.ToInt32(riskProfile.retirementAge),
                        RetirementIncome       = riskProfile.retirementIncome,
                        RiskAttitude           = riskProfile.riskAttitude,
                        ShortTermAssetPercent  = riskProfile.shortTermAssetPercent,
                        ShortTermEquityPercent = riskProfile.shortTermEquityPercent,
                        ShortTermGoal1         = riskProfile.shortTermGoal1,
                        ShortTermGoal2         = riskProfile.shortTermGoal2,
                        ShortTermGoal3         = riskProfile.shortTermGoal3,
                        ShortTermTrading       = riskProfile.shortTermTrading,
                        //riskLevel = (int)RiskLevels.NotSet
                    };
                    if (edisRopo.getRiskProfileForClient(edisRopo.GetClientSync(model.UserID, DateTime.Now).Id) != null)
                    {
                        edisRopo.UpdateRiskProfile(profile);
                    }
                    else
                    {
                        edisRopo.CreateRiskProfileForClient(profile);
                    }
                }
                #endregion

                UserManager.RemoveFromRole(userId, AuthorizationRoles.Role_Preclient);
                UserManager.AddToRole(userId, AuthorizationRoles.Role_Client);

                //redirect to client dashboard here
                //return RedirectToAction("Index", "Client");
                //TempData["message"] = "Your profile has been successfully updated";
                //return JavaScript("document.location.replace('" + Url.Action("showMessage") + "');");
                return(JavaScript("document.location.replace('" + Url.Action("Index", "Client") + "');"));
            }
            else
            {
                return(PartialView(model));
            }
        }
コード例 #8
0
        /// <summary>
        /// Cache Risk Profile
        /// </summary>
        void CacheRiskProfile()
        {
            RiskProfile profile = new RiskProfile()
            {
                Description    = "Conservative",
                EquityMinValue = 0.05d,
                EquityMaxValue = 0.2d,

                PropertyMinValue = 0d,
                PropertyMaxValue = 0.2d,

                BondsMinValue = 0.2d,
                BondsMaxValue = 0.3d,

                CashMinValue = 0.4d,
                CashMaxValue = 0.6d
            };

            //Save object
            Save <RiskProfile>(profile, transaction);

            profile = new RiskProfile()
            {
                Description    = "Moderately Conservative",
                EquityMinValue = 0.3d,
                EquityMaxValue = 0.4d,

                PropertyMinValue = 0d,
                PropertyMaxValue = 0.2d,

                BondsMinValue = 0.2d,
                BondsMaxValue = 0.3d,

                CashMinValue = 0.2d,
                CashMaxValue = 0.4d
            };

            //Save object
            Save <RiskProfile>(profile, transaction);

            profile = new RiskProfile()
            {
                Description    = "Moderate",
                EquityMinValue = 0.45d,
                EquityMaxValue = 0.55d,

                PropertyMinValue = 0d,
                PropertyMaxValue = 0.2d,

                BondsMinValue = 0.2d,
                BondsMaxValue = 0.3d,

                CashMinValue = 0.15d,
                CashMaxValue = 0.25d
            };

            //Save object
            Save <RiskProfile>(profile, transaction);

            profile = new RiskProfile()
            {
                Description    = "Moderately Aggressive",
                EquityMinValue = 0.60d,
                EquityMaxValue = 0.75d,

                PropertyMinValue = 0d,
                PropertyMaxValue = 0.2d,

                BondsMinValue = 0.1d,
                BondsMaxValue = 0.2d,

                CashMinValue = 0.5d,
                CashMaxValue = 0.15d
            };

            Save <RiskProfile>(profile, transaction);

            profile = new RiskProfile()
            {
                Description    = "Aggressive",
                EquityMinValue = 0.75d,
                EquityMaxValue = 0.95d,

                PropertyMinValue = 0d,
                PropertyMaxValue = 0.2d,

                BondsMinValue = 0d,
                BondsMaxValue = 0.1d,

                CashMinValue = 0d,
                CashMaxValue = 0.1d
            };

            //Save object
            Save <RiskProfile>(profile, transaction);
        }