예제 #1
0
        private void Add(IAccountRepository accountRepository, RepozytoriumDB.DTO.Account account)
        {
            var operation = new BankChargeOperation();

            operation.Amount  = -(decimal)_amount / 100;
            operation.Balance = account.Balance;
            operation.Account = account;
            operation.Date    = DateTime.Now;
            accountRepository.OperationRepository.Add(operation);
        }
예제 #2
0
        private async Task Save(IAccountRepository accountRepository, RepozytoriumDB.DTO.Account account)
        {
            var operation = new PayInOperation();

            operation.Amount  = (decimal)_amount / 100;
            operation.Balance = account.Balance;
            operation.Account = account;
            operation.Date    = DateTime.Now;
            accountRepository.OperationRepository.Add(operation);
            await accountRepository.OperationRepository.SaveAsync();
        }
예제 #3
0
        private async Task Save(IAccountRepository accountRepository, RepozytoriumDB.DTO.Account account)
        {
            var operation = new TransferReceiveOperation();

            operation.Title   = _transferModel.Title;
            operation.Amount  = _transferModel.GetAmount;
            operation.Balance = account.Balance;
            operation.Account = account;
            operation.Source  = NumberAccountHelper.ClearNumber(_transferModel.AccountFrom);
            operation.Date    = DateTime.Now;
            accountRepository.OperationRepository.Add(operation);
            await accountRepository.SaveAsync();
        }