public IHttpActionResult PutInformeTecSE(int id, InformeTecSE informeTecSE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != informeTecSE.IDinforme) { return(BadRequest()); } db.Entry(informeTecSE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!InformeTecSEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetInformeTecSE(int id) { InformeTecSE informeTecSE = db.InformeTecSE.Find(id); if (informeTecSE == null) { return(NotFound()); } return(Ok(informeTecSE)); }
public IHttpActionResult PostInformeTecSE(InformeTecSE informeTecSE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.InformeTecSE.Add(informeTecSE); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = informeTecSE.IDinforme }, informeTecSE)); }
public IHttpActionResult DeleteInformeTecSE(int id) { InformeTecSE informeTecSE = db.InformeTecSE.Find(id); if (informeTecSE == null) { return(NotFound()); } db.InformeTecSE.Remove(informeTecSE); db.SaveChanges(); return(Ok(informeTecSE)); }
public List <InformeTecSE> GetEvent(int id) { var ani = db.InformeTecSE.OrderBy(x => x.IDServiceSE == id); List <InformeTecSE> list = new List <InformeTecSE>(); foreach (var item in ani) { var resp = new InformeTecSE() { IDinforme = item.IDinforme, Comentario = item.Comentario, Fecha = item.Fecha, IDServiceSE = item.IDServiceSE }; list.Add(resp); } return(list); }