public IHttpActionResult PutIN_ProductLocation(int id, IN_ProductLocation iN_ProductLocation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iN_ProductLocation.ProductLocationID) { return(BadRequest()); } db.Entry(iN_ProductLocation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IN_ProductLocationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIN_ProductLocation(int id) { IN_ProductLocation iN_ProductLocation = db.IN_ProductLocation.Find(id); if (iN_ProductLocation == null) { return(NotFound()); } return(Ok(iN_ProductLocation)); }
public IHttpActionResult PostIN_ProductLocation(IN_ProductLocation iN_ProductLocation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IN_ProductLocation.Add(iN_ProductLocation); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iN_ProductLocation.ProductLocationID }, iN_ProductLocation)); }
public IHttpActionResult DeleteIN_ProductLocation(int id) { IN_ProductLocation iN_ProductLocation = db.IN_ProductLocation.Find(id); if (iN_ProductLocation == null) { return(NotFound()); } db.IN_ProductLocation.Remove(iN_ProductLocation); db.SaveChanges(); return(Ok(iN_ProductLocation)); }