public IHttpActionResult PutT_JobLog(int id, T_JobLog T_JobLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != T_JobLog.Id) { return(BadRequest()); } db.Entry(T_JobLog).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!T_JobLogExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetT_JobLog(int id) { T_JobLog T_JobLog = db.T_JobLog.Find(id); if (T_JobLog == null) { return(NotFound()); } return(Ok(T_JobLog)); }
public IHttpActionResult PostT_JobLog(T_JobLog T_JobLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.T_JobLog.Add(T_JobLog); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = T_JobLog.Id }, T_JobLog)); }
public IHttpActionResult DeleteT_JobLog(int id) { T_JobLog T_JobLog = db.T_JobLog.Find(id); if (T_JobLog == null) { return(NotFound()); } db.T_JobLog.Remove(T_JobLog); db.SaveChanges(); return(Ok(T_JobLog)); }