public async Task <IActionResult> PutPromotionalAgencies(int id, PromotionalAgencies promotionalAgencies) { promotionalAgencies.Id = id; if (id <= 0) { return(BadRequest()); } _context.Entry(promotionalAgencies).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PromotionalAgenciesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSales(int id, Sales sales) { if (id != sales.Id) { return(BadRequest()); } _context.Entry(sales).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SalesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPeople(int id, People People) { People.Id = id; if (id <= 0) { return(BadRequest()); } _context.Entry(People).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PeopleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCountries([FromRoute] int id, [FromBody] Countries countries) { countries.Id = id; if (id <= 0) { return(BadRequest()); } _context.Entry(countries).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountriesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBrandCategory(int id, BrandCategory brandCategory) { brandCategory.Id = id; if (id <= 0) { return(BadRequest()); } _context.Entry(brandCategory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BrandCategoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }