コード例 #1
0
ファイル: repos.cs プロジェクト: travism26/csharp_refresh
        public int CreateAccount(IAccountType accountType)
        {
            int accountNumber = getNextID(this.accountDB);

            this.accountDB.Add(accountNumber, accountType);
            return(accountNumber);
        }
コード例 #2
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context = context;
     cs       = new EmailServiceRepository();
     ct       = new AccountRepository(context);
     cv       = new AccountTypeRepository(context);
 }
コード例 #3
0
ファイル: CommRuleGeneric.cs プロジェクト: kiquenet/B4F
        public CommRuleGeneric(IModel ModelPortfolio, IAccountType AccountType, 
			string CommRuleName, FeeTypes FeeType, Fees.Calculations.CommCalc CommCalculation)
            : base(CommRuleName, FeeType, CommCalculation)
        {
            this.ModelPortfolio = ModelPortfolio;
            this.AccountType = AccountType;
        }
コード例 #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);
        }
コード例 #5
0
 public BankAccount(ulong newId, Person newOwner,
                    IAccountType accType, double newBalance = 0)
 {
     id          = newId;
     owner       = newOwner;
     balance     = newBalance;
     accountType = accType;
     bonuses     = 0;
 }
コード例 #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);
     }
 }
コード例 #7
0
ファイル: CommRuleSpecific.cs プロジェクト: kiquenet/B4F
        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;
        }
コード例 #8
0
ファイル: Account.cs プロジェクト: repakkun/Module25
 public void GetAccType(IAccountType accountType)
 {
     accountType.AccType();
 }
コード例 #9
0
 public PersonalAccount(Person accountOwnerIn, IAccountType accountTypeIn)
 {
     this.accountOwner = accountOwnerIn;
     this.accountType  = accountTypeIn;
 }
コード例 #10
0
ファイル: TPBank.cs プロジェクト: quyenuaena/GoF
 public TPBank(IAccountType accountType) : base(accountType)
 {
 }
コード例 #11
0
ファイル: Agribank.cs プロジェクト: quyenuaena/GoF
 public Agribank(IAccountType accountType) : base(accountType)
 {
 }
コード例 #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;
 }
コード例 #13
0
ファイル: Bank.cs プロジェクト: quyenuaena/GoF
 public Bank(IAccountType accountType)
 {
     this.accountType = accountType;
 }