Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetLeadNotesTrack(int id)
        {
            LeadNotesTrack leadNotesTrack = db.LeadNotesTracks.Find(id);

            if (leadNotesTrack == null)
            {
                return(NotFound());
            }

            return(Ok(leadNotesTrack));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }