public IHttpActionResult Save(DTO_PRO_BangKiemLuaChonQuyTrinhXXDD tbl_PRO_BangKiemLuaChonQuyTrinhXXDD)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DTO_PRO_BangKiemLuaChonQuyTrinhXXDD result = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.save_PRO_BangKiemLuaChonQuyTrinhXXDD(db, tbl_PRO_BangKiemLuaChonQuyTrinhXXDD, Username);


            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
        public IHttpActionResult Post(DTO_PRO_BangKiemLuaChonQuyTrinhXXDD tbl_PRO_BangKiemLuaChonQuyTrinhXXDD)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DTO_PRO_BangKiemLuaChonQuyTrinhXXDD result = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.post_PRO_BangKiemLuaChonQuyTrinhXXDD(db, tbl_PRO_BangKiemLuaChonQuyTrinhXXDD, Username);


            if (result != null)
            {
                return(CreatedAtRoute("get_PRO_BangKiemLuaChonQuyTrinhXXDD", new { id = result.ID }, result));
            }
            return(Conflict());
        }
        public IHttpActionResult Delete(int id)
        {
            bool check = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.check_PRO_BangKiemLuaChonQuyTrinhXXDD_Exists(db, id);

            if (!check)
            {
                return(NotFound());
            }

            bool result = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.delete_PRO_BangKiemLuaChonQuyTrinhXXDD(db, id, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            return(Conflict());
        }
        public IHttpActionResult Put(int id, DTO_PRO_BangKiemLuaChonQuyTrinhXXDD tbl_PRO_BangKiemLuaChonQuyTrinhXXDD)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbl_PRO_BangKiemLuaChonQuyTrinhXXDD.ID)
            {
                return(BadRequest());
            }

            bool result = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.put_PRO_BangKiemLuaChonQuyTrinhXXDD(db, id, tbl_PRO_BangKiemLuaChonQuyTrinhXXDD, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(NotFound());
            }
        }
        public IHttpActionResult GetCustom(int idDeTai, bool?isInput = false)
        {
            DTO_PRO_BangKiemLuaChonQuyTrinhXXDD tbl_PRO_BangKiemLuaChonQuyTrinhXXDD = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.get_PRO_BangKiemLuaChonQuyTrinhXXDDCustom(db, idDeTai);
            //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/BangKiemLuaChonQuyTrinhXXDD.html")))
            {
                htmlPrint = r.ReadToEnd();
            }
            tbl_PRO_BangKiemLuaChonQuyTrinhXXDD.HTMLPrint = html;
            using (System.IO.StreamReader r = new System.IO.StreamReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/FormTemplate/BangKiemLuaChonQuyTrinhXXDD_Input.html")))
            {
                html = r.ReadToEnd();
            }
            tbl_PRO_BangKiemLuaChonQuyTrinhXXDD.HTML      = html;
            tbl_PRO_BangKiemLuaChonQuyTrinhXXDD.HTMLPrint = htmlPrint;
            //}

            return(Ok(tbl_PRO_BangKiemLuaChonQuyTrinhXXDD));
        }
        public IHttpActionResult Get(int id)
        {
            DTO_PRO_BangKiemLuaChonQuyTrinhXXDD tbl_PRO_BangKiemLuaChonQuyTrinhXXDD = BS_PRO_BangKiemLuaChonQuyTrinhXXDD.get_PRO_BangKiemLuaChonQuyTrinhXXDD(db, id);

            if (tbl_PRO_BangKiemLuaChonQuyTrinhXXDD == null)
            {
                return(NotFound());
            }

            return(Ok(tbl_PRO_BangKiemLuaChonQuyTrinhXXDD));
        }
 public IQueryable <DTO_PRO_BangKiemLuaChonQuyTrinhXXDD> Get()
 {
     return(BS_PRO_BangKiemLuaChonQuyTrinhXXDD.get_PRO_BangKiemLuaChonQuyTrinhXXDD(db, QueryStrings));
 }