Ejemplo n.º 1
0
        /// <summary>
        /// Opens new account with given information
        /// </summary>
        /// <param name="accountOwner">The owner of the account</param>
        /// <param name="accountType">The account type</param>
        /// <param name="numberCreateService">Service for creating unique account number</param>
        public void OpenAccount(string accountOwner, Interface.Entities.AccountType accountType, IAccountNumberCreateService numberCreateService)
        {
            string accountNumber = numberCreateService.GetNumber();

            Interface.Entities.Account account = new Interface.Entities.Account(accountNumber, accountOwner, accountType);

            _repository.OpenAccount(AccountMapper.MapToData(account));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets data later account type corresponding to business layer account type
 /// </summary>
 /// <param name="accountType">Business layer account type</param>
 /// <returns>Data layer account type</returns>
 public static DAL.Interface.DTO.AccountType GetDataAccountType(Interface.Entities.AccountType accountType)
 {
     return(typeMap.FirstOrDefault(t => t.Value == accountType).Key);
 }