public IHttpActionResult Posttsaleorderdtl(tsaleorderdtl tsaleorderdtl) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tsaleorderdtl.Add(tsaleorderdtl); try { db.SaveChanges(); } catch (DbUpdateException) { if (tsaleorderdtlExists(tsaleorderdtl.SaleOrderNO)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tsaleorderdtl.SaleOrderNO }, tsaleorderdtl)); }
public IHttpActionResult Puttsaleorderdtl(string id, tsaleorderdtl tsaleorderdtl) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tsaleorderdtl.SaleOrderNO) { return(BadRequest()); } db.Entry(tsaleorderdtl).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tsaleorderdtlExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Gettsaleorderdtl(string id) { tsaleorderdtl tsaleorderdtl = db.tsaleorderdtl.Find(id); if (tsaleorderdtl == null) { return(NotFound()); } return(Ok(tsaleorderdtl)); }
public IHttpActionResult Deletetsaleorderdtl(string id) { tsaleorderdtl tsaleorderdtl = db.tsaleorderdtl.Find(id); if (tsaleorderdtl == null) { return(NotFound()); } db.tsaleorderdtl.Remove(tsaleorderdtl); db.SaveChanges(); return(Ok(tsaleorderdtl)); }