Exemplo n.º 1
0
        public int insert(Invoice invoice, int idUser, int idAccount)
        {
            CurrentAccountSystemController _currentAccountController = new CurrentAccountSystemController();
            CurrentAccountSystem           account = _currentAccountController.getOne(idAccount);

            if (invoice.ValorPago > 0)
            {
                account.Saldo += (invoice.ValorPago - invoice.Troco);
            }
            else
            {
                account.Saldo += 0;
            }
            _currentAccountController.update(account);
            return(_invoiceRep.insert(invoice));
        }