public IHttpActionResult Get(int id) { DTO_PRO_SYLL tbl_PRO_SYLL = BS_PRO_SYLL.get_PRO_SYLL(db, id); if (tbl_PRO_SYLL == null) { return(NotFound()); } return(Ok(tbl_PRO_SYLL)); }
public IHttpActionResult Save(DTO_PRO_SYLL tbl_PRO_SYLL) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DTO_PRO_SYLL result = BS_PRO_SYLL.save_PRO_SYLL(db, tbl_PRO_SYLL, Username); if (result != null) { return(Ok(result)); } return(BadRequest()); }
public IHttpActionResult Post(DTO_PRO_SYLL tbl_PRO_SYLL) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DTO_PRO_SYLL result = BS_PRO_SYLL.post_PRO_SYLL(db, tbl_PRO_SYLL, Username); if (result != null) { return(CreatedAtRoute("get_PRO_SYLL", new { id = result.ID }, result)); } return(Conflict()); }
public IHttpActionResult Delete(int id) { bool check = BS_PRO_SYLL.check_PRO_SYLL_Exists(db, id); if (!check) { return(NotFound()); } bool result = BS_PRO_SYLL.delete_PRO_SYLL(db, id, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } return(Conflict()); }
public IHttpActionResult GetCustom(int idDeTai, int idNhanSu, bool isChuNhiem, bool?isInput = false) { DTO_PRO_SYLL tbl_PRO_SYLL = BS_PRO_SYLL.get_PRO_SYLLCustom(db, idDeTai, idNhanSu); //if (tbl_PRO_LLKH.ID == 0) //{ string html = ""; string htmlPrint = ""; if (isChuNhiem) { using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuSYLL_ChuNhiemDeTai.html"))) { htmlPrint = r.ReadToEnd(); } } else { using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuSYLL.html"))) { htmlPrint = r.ReadToEnd(); } } if (isChuNhiem) { using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuSYLL_ChuNhiemDeTai_Input.html"))) { html = r.ReadToEnd(); } } else { using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/NhanSuSYLL_Input.html"))) { html = r.ReadToEnd(); } } tbl_PRO_SYLL.HTML = html; tbl_PRO_SYLL.HTMLPrint = htmlPrint; //} return(Ok(tbl_PRO_SYLL)); }
public IHttpActionResult Put(int id, DTO_PRO_SYLL tbl_PRO_SYLL) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_PRO_SYLL.ID) { return(BadRequest()); } bool result = BS_PRO_SYLL.put_PRO_SYLL(db, id, tbl_PRO_SYLL, Username); if (result) { return(StatusCode(HttpStatusCode.NoContent)); } else { return(NotFound()); } }
public IQueryable <DTO_PRO_SYLL> Get() { return(BS_PRO_SYLL.get_PRO_SYLL(db, QueryStrings)); }