public IHttpActionResult Get(int id) { DTO_PRO_NCVKhac tbl_PRO_NCVKhac = BS_PRO_NCVKhac.get_PRO_NCVKhac(db, id); if (tbl_PRO_NCVKhac == null) { return(NotFound()); } return(Ok(tbl_PRO_NCVKhac)); }
public IHttpActionResult Post(DTO_PRO_NCVKhac tbl_PRO_NCVKhac) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DTO_PRO_NCVKhac result = BS_PRO_NCVKhac.post_PRO_NCVKhac(db, tbl_PRO_NCVKhac, Username); if (result != null) { return(CreatedAtRoute("get_PRO_NCVKhac", new { id = result.ID }, result)); } return(Conflict()); }
public IHttpActionResult Delete(int id) { bool check = BS_PRO_NCVKhac.check_PRO_NCVKhac_Exists(db, id); if (!check) { return(NotFound()); } bool result = BS_PRO_NCVKhac.delete_PRO_NCVKhac(db, id, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } return(Conflict()); }
public IHttpActionResult Put(int id, DTO_PRO_NCVKhac tbl_PRO_NCVKhac) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_PRO_NCVKhac.ID) { return(BadRequest()); } bool result = BS_PRO_NCVKhac.put_PRO_NCVKhac(db, id, tbl_PRO_NCVKhac, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } else { return(NotFound()); } }
public IQueryable <DTO_PRO_NCVKhac> Get() { return(BS_PRO_NCVKhac.get_PRO_NCVKhac(db, QueryStrings)); }
public IQueryable <DTO_PRO_NCVKhac> GetByDeTai(int deTaiId) { return(BS_PRO_NCVKhac.get_PRO_NCVKhacByDeTai(db, deTaiId)); }