コード例 #1
0
        public async Task <IActionResult> PutOutraConta(int id, OutraConta outraConta)
        {
            if (id != outraConta.ID)
            {
                return(BadRequest());
            }

            _context.Entry(outraConta).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OutraContaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutRetornoLote(int id, RetornoLote retornoLote)
        {
            if (id != retornoLote.ID)
            {
                return(BadRequest());
            }

            _context.Entry(retornoLote).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RetornoLoteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #3
0
        public async Task <IActionResult> PutUsuarios(int id, Usuario usuario)
        {
            return(Forbid());

            if (id.ToString() != usuario.Id)
            {
                return(BadRequest());
            }

            _context.Entry(usuario).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UsuarioExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #4
0
        public async Task <IActionResult> PutContasMigracaoMigradas(int id, ContasMigracaoMigradas contasMigracaoMigradas)
        {
            if (id != contasMigracaoMigradas.ID)
            {
                return(BadRequest());
            }

            _context.Entry(contasMigracaoMigradas).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ContasMigracaoMigradasExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #5
0
        public async Task <IActionResult> PutImposto(int id, Imposto imposto)
        {
            if (id != imposto.ID)
            {
                return(BadRequest());
            }

            _context.Entry(imposto).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ImpostoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #6
0
        public async Task <IActionResult> PutFornecedor(int id, Fornecedor fornecedor)
        {
            if (id != fornecedor.ID)
            {
                return(BadRequest());
            }

            _context.Entry(fornecedor).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FornecedorExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }