Esempio n. 1
0
        public IHttpActionResult Get(int id)
        {
            DTO_PRO_NCVKhac tbl_PRO_NCVKhac = BS_PRO_NCVKhac.get_PRO_NCVKhac(db, id);

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

            return(Ok(tbl_PRO_NCVKhac));
        }
Esempio n. 2
0
        public IHttpActionResult Post(DTO_PRO_NCVKhac tbl_PRO_NCVKhac)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DTO_PRO_NCVKhac result = BS_PRO_NCVKhac.post_PRO_NCVKhac(db, tbl_PRO_NCVKhac, Username);

            if (result != null)
            {
                return(CreatedAtRoute("get_PRO_NCVKhac", new { id = result.ID }, result));
            }
            return(Conflict());
        }
Esempio n. 3
0
        public IHttpActionResult Delete(int id)
        {
            bool check = BS_PRO_NCVKhac.check_PRO_NCVKhac_Exists(db, id);

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

            bool result = BS_PRO_NCVKhac.delete_PRO_NCVKhac(db, id, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            return(Conflict());
        }
Esempio n. 4
0
        public IHttpActionResult Put(int id, DTO_PRO_NCVKhac tbl_PRO_NCVKhac)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            bool result = BS_PRO_NCVKhac.put_PRO_NCVKhac(db, id, tbl_PRO_NCVKhac, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(NotFound());
            }
        }
Esempio n. 5
0
 public IQueryable <DTO_PRO_NCVKhac> Get()
 {
     return(BS_PRO_NCVKhac.get_PRO_NCVKhac(db, QueryStrings));
 }
Esempio n. 6
0
 public IQueryable <DTO_PRO_NCVKhac> GetByDeTai(int deTaiId)
 {
     return(BS_PRO_NCVKhac.get_PRO_NCVKhacByDeTai(db, deTaiId));
 }