Exemple #1
0
        public IHttpActionResult Post(DTO_PRO_DonXinDanhGiaDaoDuc tbl_PRO_DonXinDanhGiaDaoDuc)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DTO_PRO_DonXinDanhGiaDaoDuc result = BS_PRO_DonXinDanhGiaDaoDuc.save_PRO_DonXinDanhGiaDaoDuc(db, tbl_PRO_DonXinDanhGiaDaoDuc, Username);

            if (result != null)
            {
                BS_HelperReference.PRO_DonXinDanhGiaDaoDuc_Update(db, tbl_PRO_DonXinDanhGiaDaoDuc.IDDeTai);
                return(CreatedAtRoute("get_PRO_DonXinDanhGiaDaoDuc", new { id = result.ID }, result));
            }
            return(Conflict());
        }
Exemple #2
0
        public IHttpActionResult Put(int id, DTO_PRO_DonXinDanhGiaDaoDuc tbl_PRO_DonXinDanhGiaDaoDuc)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            var result = BS_PRO_DonXinDanhGiaDaoDuc.save_PRO_DonXinDanhGiaDaoDuc(db, tbl_PRO_DonXinDanhGiaDaoDuc, Username);

            if (result != null)
            {
                BS_HelperReference.PRO_DonXinDanhGiaDaoDuc_Update(db, tbl_PRO_DonXinDanhGiaDaoDuc.IDDeTai);
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(NotFound());
            }
        }