public IHttpActionResult PutCategorie(int id, Categorie categorie) { if (id != categorie.ID) { return(BadRequest()); } db.Entry(categorie).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CategorieExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPromotion(int id, Promotion promotion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != promotion.ID) { return(BadRequest()); } db.Entry(promotion).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PromotionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Putligne_de_commande(int id, ligne_de_commande ligne_de_commande) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ligne_de_commande.Qauntity) { return(BadRequest()); } db.Entry(ligne_de_commande).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ligne_de_commandeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }