Exemplo n.º 1
0
        public async Task <IActionResult> PutProductoCuota(int id, PCProductoCuota pCProductoCuota)
        {
            if (id != pCProductoCuota.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <PCProductoCuota> > PostProductoCuota(PCProductoCuota pCProductoCuota)
        {
            _context.PCProductoCuota.Add(pCProductoCuota);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProductoCuota", new { id = pCProductoCuota.Id }, pCProductoCuota));
        }
Exemplo n.º 3
0
        public async Task <HttpResponseMessage> UpdateProductoCuotaAsync(int id, PCProductoCuota pCProductoCuota)
        {
            var client = new HttpClient();

            return(await client.PutAsync($"{baseUrl}api/ProductoCuota/{id}", getStringContentFromObject(pCProductoCuota)));
        }
Exemplo n.º 4
0
        public async Task <HttpResponseMessage> InsertProductoCuotaAsync(PCProductoCuota pCProductoCuota)
        {
            var client = new HttpClient();

            return(await client.PostAsync($"{baseUrl}api/ProductoCuota", getStringContentFromObject(pCProductoCuota)));
        }