public async Task <IActionResult> PutCuotaVentas(int id, PCCuotaVentas pCCuotaVentas) { if (id != pCCuotaVentas.Id) { return(BadRequest()); } _context.Entry(pCCuotaVentas).State = EntityState.Modified; try { await _context.SaveChangesAsync(); _context.Database.ExecuteSqlCommand("PCSpActualizaCuotaVentas @p0, @p1", pCCuotaVentas.Año, pCCuotaVentas.Mes); } catch (DbUpdateConcurrencyException) { if (!CuotaVentasExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PCCuotaVentas> > PostCuotaventas(PCCuotaVentas pCCuotaVentas) { _context.PCCuotaVentas.Add(pCCuotaVentas); await _context.SaveChangesAsync(); _context.Database.ExecuteSqlCommand("PCSpActualizaCuotaVentas @p0, @p1", pCCuotaVentas.Año, pCCuotaVentas.Mes); return(CreatedAtAction("GetCuotaVentas", new { id = pCCuotaVentas.Id }, pCCuotaVentas)); }
public async Task <HttpResponseMessage> UpdateCuotaVentasAsync(int id, PCCuotaVentas pCCuotaVentas) { var client = new HttpClient(); return(await client.PutAsync($"{baseUrl}api/CuotaVentas/{id}", getStringContentFromObject(pCCuotaVentas))); }
public async Task <HttpResponseMessage> InsertCuotaVentasAsync(PCCuotaVentas pCCuotaVentas) { var client = new HttpClient(); return(await client.PostAsync($"{baseUrl}api/CuotaVentas", getStringContentFromObject(pCCuotaVentas))); }