Esempio n. 1
0
        public int CreateAccount(IAccountType accountType)
        {
            int accountNumber = getNextID(this.accountDB);

            this.accountDB.Add(accountNumber, accountType);
            return(accountNumber);
        }
Esempio n. 2
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context = context;
     cs       = new EmailServiceRepository();
     ct       = new AccountRepository(context);
     cv       = new AccountTypeRepository(context);
 }
Esempio n. 3
0
        public CommRuleGeneric(IModel ModelPortfolio, IAccountType AccountType, 
			string CommRuleName, FeeTypes FeeType, Fees.Calculations.CommCalc CommCalculation)
            : base(CommRuleName, FeeType, CommCalculation)
        {
            this.ModelPortfolio = ModelPortfolio;
            this.AccountType = AccountType;
        }
Esempio n. 4
0
        /// <summary>
        /// Determines if account type is valid
        /// </summary>
        /// <param name="accountType">Given account type</param>
        /// <returns>True, if account type is valid</returns>
        internal static bool IsAccountTypeValid(IAccountType accountType)
        {
            if (accountType == null)
            {
                return(false);
            }

            return(true);
        }
 public BankAccount(ulong newId, Person newOwner,
                    IAccountType accType, double newBalance = 0)
 {
     id          = newId;
     owner       = newOwner;
     balance     = newBalance;
     accountType = accType;
     bonuses     = 0;
 }
Esempio n. 6
0
 /// <summary>
 /// Calculates bonus points
 /// </summary>
 /// <param name="accountType">Given account type</param>
 /// <param name="isDeposit">True if need to calculate for deposit, false if need to calculate for withdrawal</param>
 /// <returns>Calculated bonus points</returns>
 public int CalculateBonusPoints(IAccountType accountType, bool isDeposit)
 {
     if (isDeposit)
     {
         return(accountType.DepositCost);
     }
     else
     {
         return(accountType.BalanceCost / 2);
     }
 }
Esempio n. 7
0
        public CommRuleSpecific(OrderActionTypes actionType, bool applyToAllAccounts, 
			IAccountType accountType, IModel modelPortfolio, 
			IAccount account, IInstrument instrument, ISecCategory ruleSecCategory,
			IExchange exchange, string commRuleName, FeeTypes feeType,
			CommRuleOpenClose openClose, CommRuleBuySell buySell,
			Fees.Calculations.CommCalc commCalculation)
            : base(commRuleName, feeType, commCalculation)
        {
            this.actionType = actionType;
            this.ApplyToAllAccounts = applyToAllAccounts;
            this.AccountType = accountType;
            this.ModelPortfolio = modelPortfolio;
            this.Account = account;
            this.Instrument = instrument;
            this.RuleSecCategory = ruleSecCategory;
            this.Exchange = exchange;
            this.OpenClose = openClose;
            this.BuySell = buySell;
        }
Esempio n. 8
0
 public void GetAccType(IAccountType accountType)
 {
     accountType.AccType();
 }
Esempio n. 9
0
 public PersonalAccount(Person accountOwnerIn, IAccountType accountTypeIn)
 {
     this.accountOwner = accountOwnerIn;
     this.accountType  = accountTypeIn;
 }
Esempio n. 10
0
 public TPBank(IAccountType accountType) : base(accountType)
 {
 }
Esempio n. 11
0
 public Agribank(IAccountType accountType) : base(accountType)
 {
 }
Esempio n. 12
0
 /// <summary>
 /// Parametrized constructor
 /// </summary>
 /// <param name="id">Given id</param>
 /// <param name="firstName">Given first name</param>
 /// <param name="lastName">Given last name</param>
 /// <param name="balance">Given balance</param>
 /// <param name="bonusPoints">Given bonus points</param>
 /// <param name="accountType">Given account type</param>
 /// <param name="bonusPointsCalculator">Given bonus points calculator</param>
 public BankAccount(int id, string firstName, string lastName, decimal balance, int bonusPoints, IAccountType accountType, IBonusPointsCalculator bonusPointsCalculator)
 {
     this.Id                    = id;
     this.FirstName             = firstName;
     this.LastName              = lastName;
     this.Balance               = balance;
     this.BonusPoints           = bonusPoints;
     this.AccountType           = accountType;
     this.BonusPointsCalculator = bonusPointsCalculator;
 }
Esempio n. 13
0
 public Bank(IAccountType accountType)
 {
     this.accountType = accountType;
 }