public IHttpActionResult Post(DTO_PRO_ThuyetMinhDeTai tbl_PRO_ThuyetMinhDeTai)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            tbl_PRO_ThuyetMinhDeTai.A8_JSON_CoQuanPhoiHopThucHien          = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListCoQuanPhoiHop);
            tbl_PRO_ThuyetMinhDeTai.A9_JSON_NhanLucNghienCuu_ChuNhiemDeTai = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ChuNhiemDeTai);
            tbl_PRO_ThuyetMinhDeTai.A9_JSON_NhanLucNghienCuu      = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListNhanLucNghienCuu);
            tbl_PRO_ThuyetMinhDeTai.B2_JSON_GioiThieuChuyenGia    = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListGioiThieuChuyenGia);
            tbl_PRO_ThuyetMinhDeTai.B326_JSON_CacBienSoCanThuThap = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListBienSo);
            tbl_PRO_ThuyetMinhDeTai.B313_JSON_KeHoachThucHien     = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKeHoachThucHien);
            tbl_PRO_ThuyetMinhDeTai.B52_JSON_TongHopKinhPhi       = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiTongHop);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_NguyenVatLieu     = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiNguyenVatLieu);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_KhoanCongLaoDong  = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiCongLaoDong);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_ThietBi           = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiThietBi);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_ChiKhac           = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiKhac);

            DTO_PRO_ThuyetMinhDeTai result = BS_PRO_ThuyetMinhDeTai.post_PRO_ThuyetMinhDeTai(db, tbl_PRO_ThuyetMinhDeTai, Username);

            if (result != null)
            {
                BS_HelperReference.PRO_ThuyetMinhDeTai_Update(db, tbl_PRO_ThuyetMinhDeTai.IDDeTai);
                return(CreatedAtRoute("get_PRO_ThuyetMinhDeTai", new { id = result.ID }, result));
            }
            return(Conflict());
        }
        public IHttpActionResult Put(int id, DTO_PRO_ThuyetMinhDeTai tbl_PRO_ThuyetMinhDeTai)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            tbl_PRO_ThuyetMinhDeTai.A8_JSON_CoQuanPhoiHopThucHien          = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListCoQuanPhoiHop);
            tbl_PRO_ThuyetMinhDeTai.A9_JSON_NhanLucNghienCuu_ChuNhiemDeTai = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ChuNhiemDeTai);
            tbl_PRO_ThuyetMinhDeTai.A9_JSON_NhanLucNghienCuu      = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListNhanLucNghienCuu);
            tbl_PRO_ThuyetMinhDeTai.B2_JSON_GioiThieuChuyenGia    = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListGioiThieuChuyenGia);
            tbl_PRO_ThuyetMinhDeTai.B326_JSON_CacBienSoCanThuThap = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListBienSo);
            tbl_PRO_ThuyetMinhDeTai.B313_JSON_KeHoachThucHien     = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKeHoachThucHien);
            tbl_PRO_ThuyetMinhDeTai.B52_JSON_TongHopKinhPhi       = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiTongHop);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_NguyenVatLieu     = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiNguyenVatLieu);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_KhoanCongLaoDong  = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiCongLaoDong);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_ThietBi           = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiThietBi);
            tbl_PRO_ThuyetMinhDeTai.PhuLuc_JSON_ChiKhac           = Newtonsoft.Json.JsonConvert.SerializeObject(tbl_PRO_ThuyetMinhDeTai.ListKinhPhiKhac);

            bool result = BS_PRO_ThuyetMinhDeTai.put_PRO_ThuyetMinhDeTai(db, id, tbl_PRO_ThuyetMinhDeTai, Username);

            if (result)
            {
                BS_HelperReference.PRO_ThuyetMinhDeTai_Update(db, tbl_PRO_ThuyetMinhDeTai.IDDeTai);
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(NotFound());
            }
        }