Exemplo n.º 1
0
        public async Task <IActionResult> PuttbaVendedor([FromRoute] int id, [FromBody] tbaVendedor tbaVendedor)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbaVendedor.idVendedor)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Putmano_obra([FromRoute] int id, [FromBody] mano_obra mano_obra)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mano_obra.idmano)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutCatInsumo([FromRoute] short id, [FromBody] CatInsumo catInsumo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != catInsumo.idCatinsumo)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }