예제 #1
0
파일: Seed.cs 프로젝트: blewater/gz
        private static void CreateUpdUserPortfolioSelection(ApplicationDbContext context, int custId)
        {
            var confRepo          = new ConfRepo(context);
            var custPortfolioRepo =
                new UserPortfolioRepo(
                    context,
                    confRepo,
                    new UserRepo(context));

            custPortfolioRepo.SetDbUserMonthsPortfolioMix(custId, RiskToleranceEnum.Low, 2015, 1, new DateTime(2015, 1, 1));
        }
예제 #2
0
        private void SetDbMonthlyPortfolioSelection(int monthsCnt, int userId, string startYearMonthStr)
        {
            var monthPortfolioRisk =
                monthsCnt % 3 == 0
                    ? RiskToleranceEnum.Low
                    : monthsCnt % 3 == 1
                        ? RiskToleranceEnum.Medium
                        : RiskToleranceEnum.High;

            // Create loss transaction for the month
            cpRepo.SetDbUserMonthsPortfolioMix(
                userId,
                monthPortfolioRisk,
                DbExpressions.GetYear(startYearMonthStr),
                DbExpressions.GetMonth(startYearMonthStr),
                DateTime.UtcNow);
        }