Пример #1
0
        private static bool IsAnEarlyWithdrawal(string vintageYearMonthStr, GzConfiguration confRow)
        {
            const int nominalWithdrawalMonths = 3;

            var vintageMonthDate = DbExpressions.GetDtYearMonthStrTo1StOfMonth(vintageYearMonthStr);

            var futureUnleashDay = vintageMonthDate.AddMonths(nominalWithdrawalMonths); // locking months + 1

            var retValue = futureUnleashDay > DateTime.Today;

            return(retValue);
        }
Пример #2
0
        /// <summary>
        /// Insert or Update the gzConfiguration Constants in a single row
        /// </summary>
        /// <param name="context"></param>
        private static void CreateUpdConfiguationRow(ApplicationDbContext context)
        {
            var dbConf = new GzConfiguration();

            context.GzConfigurations.AddOrUpdate(
                c => c.Id,
                new GzConfiguration {
                // Essentially write out the defaults in a single row
                Id = 1,
                COMMISSION_PCNT          = dbConf.COMMISSION_PCNT,
                CREDIT_LOSS_PCNT         = dbConf.CREDIT_LOSS_PCNT,
                FUND_FEE_PCNT            = dbConf.FUND_FEE_PCNT,
                LOCK_IN_NUM_DAYS         = dbConf.LOCK_IN_NUM_DAYS,
                FIRST_PORTFOLIO_RISK_VAL = RiskToleranceEnum.Medium,
                CONSERVATIVE_RISK_ROI    = 3f,
                MEDIUM_RISK_ROI          = 6f,
                AGGRESSIVE_RISK_ROI      = 10f
            }
                );

            context.SaveChanges();
        }