public IHttpActionResult PutLeadNotesTrack(int id, LeadNotesTrack leadNotesTrack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != leadNotesTrack.LeadNotesTrackID) { return(BadRequest()); } db.Entry(leadNotesTrack).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LeadNotesTrackExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetLeadNotesTrack(int id) { LeadNotesTrack leadNotesTrack = db.LeadNotesTracks.Find(id); if (leadNotesTrack == null) { return(NotFound()); } return(Ok(leadNotesTrack)); }
public IHttpActionResult PostLeadNotesTrack(LeadNotesTrack leadNotesTrack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LeadNotesTracks.Add(leadNotesTrack); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = leadNotesTrack.LeadNotesTrackID }, leadNotesTrack)); }
public IHttpActionResult DeleteLeadNotesTrack(int id) { LeadNotesTrack leadNotesTrack = db.LeadNotesTracks.Find(id); if (leadNotesTrack == null) { return(NotFound()); } db.LeadNotesTracks.Remove(leadNotesTrack); db.SaveChanges(); return(Ok(leadNotesTrack)); }