public IHttpActionResult PutRegistroMercadeo(int id, RegistroMercadeo registroMercadeo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != registroMercadeo.RegistroMercadeoID) { return(BadRequest()); } db.Entry(registroMercadeo).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!RegistroMercadeoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetRegistroMercadeo(int id) { RegistroMercadeo registroMercadeo = db.RegistrosMercadeo.Find(id); if (registroMercadeo == null) { return(NotFound()); } return(Ok(registroMercadeo)); }
public IHttpActionResult PostRegistroMercadeo(RegistroMercadeo registroMercadeo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.RegistrosMercadeo.Add(registroMercadeo); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = registroMercadeo.RegistroMercadeoID }, registroMercadeo)); }
public IHttpActionResult DeleteRegistroMercadeo(int id) { RegistroMercadeo registroMercadeo = db.RegistrosMercadeo.Find(id); if (registroMercadeo == null) { return(NotFound()); } db.RegistrosMercadeo.Remove(registroMercadeo); db.SaveChanges(); return(Ok(registroMercadeo)); }