Exemplo n.º 1
0
        public async Task <HttpResponseMessage> AddSavingDetails(Guid owner, SavingAccountIn account)
        {
            var input = new AccountAdd {
                CurrentAccount = Guid.Empty, Saving = account
            };

            return(await this.ProcessActionAsync(owner, input, this.accountService.AddSavingAccount));
        }
Exemplo n.º 2
0
        /// <summary>
        /// The add.
        /// </summary>
        /// <param name="owner">
        /// The owner.
        /// </param>
        /// <param name="currentAccount">
        /// The current account.
        /// </param>
        /// <param name="code">
        /// The code.
        /// </param>
        /// <param name="input">
        /// The input.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <int> Add(Guid owner, Guid currentAccount, Guid code, SavingAccountIn input)
        {
            var account = GetSavings(owner, currentAccount, code, input);

            this.context.Accounts.Add(account);

            var myint = await this.context.SaveChangesAsync();

            return(myint);
        }
Exemplo n.º 3
0
 /// <summary>
 /// The add loan details.
 /// </summary>
 /// <param name="owner">
 /// The owner.
 /// </param>
 /// <param name="currentAccount">
 /// The current account.
 /// </param>
 /// <param name="account">
 /// The account.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public Task <HttpResponseMessage> AddSavingDetails(Guid owner, Guid currentAccount, SavingAccountIn account)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
        /// <summary>
        /// The get savings.
        /// </summary>
        /// <param name="owner">
        /// The owner.
        /// </param>
        /// <param name="currentAccount">
        /// The current account.
        /// </param>
        /// <param name="code">
        /// The code.
        /// </param>
        /// <param name="input">
        /// The input.
        /// </param>
        /// <returns>
        /// The <see cref="SavingAccountEntity"/>.
        /// </returns>
        private static SavingAccountEntity GetSavings(Guid owner, Guid currentAccount, Guid code, SavingAccountIn input)
        {
            var output = new SavingAccountEntity
            {
                Code                   = code,
                Owner                  = owner,
                Holder                 = input.Holder,
                IsArchived             = input.IsArchived,
                Bank                   = input.Bank,
                Description            = input.Description,
                Amount                 = input.Amount,
                Currency               = input.Currency,
                Number                 = input.Number,
                StartDate              = input.StartDate,
                AutomaticRenovation    = input.AutomaticRenovation,
                InterestCapitalization = input.InterestCapitalization,
                InterestPayment        = input.InterestPayment,
                SavingEndDate          = input.SavingEndDate,
                SavingInterestRate     = input.SavingInterestRate
            };

            if (currentAccount != Guid.Empty)
            {
                output.SavingRelatedAccount = currentAccount;
            }

            return(output);
        }