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); }
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(); }
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(); }