public IHttpActionResult Get(int id) { DTO_PRO_LLKH tbl_PRO_LLKH = BS_PRO_LLKH.get_PRO_LLKH(db, id); if (tbl_PRO_LLKH == null) { return(NotFound()); } return(Ok(tbl_PRO_LLKH)); }
public IHttpActionResult Save(DTO_PRO_LLKH tbl_PRO_LLKH) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DTO_PRO_LLKH result = BS_PRO_LLKH.save_PRO_LLKH(db, tbl_PRO_LLKH, Username); if (result != null) { return(Ok(result)); } return(BadRequest()); }
public IHttpActionResult Post(DTO_PRO_LLKH tbl_PRO_LLKH) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DTO_PRO_LLKH result = BS_PRO_LLKH.post_PRO_LLKH(db, tbl_PRO_LLKH, Username); if (result != null) { return(CreatedAtRoute("get_PRO_LLKH", new { id = result.ID }, result)); } return(Conflict()); }
public IHttpActionResult Delete(int id) { bool check = BS_PRO_LLKH.check_PRO_LLKH_Exists(db, id); if (!check) { return(NotFound()); } bool result = BS_PRO_LLKH.delete_PRO_LLKH(db, id, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } return(Conflict()); }
public IHttpActionResult Put(int id, DTO_PRO_LLKH tbl_PRO_LLKH) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_PRO_LLKH.ID) { return(BadRequest()); } bool result = BS_PRO_LLKH.put_PRO_LLKH(db, id, tbl_PRO_LLKH, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } else { return(NotFound()); } }
public IHttpActionResult GetCustom(int idDeTai, int idNhanSu, bool?isReset = false, bool?isInput = false) { DTO_PRO_LLKH tbl_PRO_LLKH = BS_PRO_LLKH.get_PRO_LLKHCustom(db, idDeTai, idNhanSu, isReset); //if (tbl_PRO_LLKH.ID == 0) //{ string html = ""; string htmlPrint = ""; using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuLLKH.html"))) { htmlPrint = r.ReadToEnd(); } using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuLLKH_Input.html"))) { html = r.ReadToEnd(); } tbl_PRO_LLKH.HTML = html; tbl_PRO_LLKH.HTMLPrint = htmlPrint; //} return(Ok(tbl_PRO_LLKH)); }
public IQueryable <DTO_PRO_LLKH> Get() { return(BS_PRO_LLKH.get_PRO_LLKH(db, QueryStrings)); }