コード例 #1
0
        public IHttpActionResult Get(int id)
        {
            DTO_CAT_Tags tbl_CAT_Tags = BS_CAT_Tags.get_CAT_Tags(db, id);

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

            return(Ok(tbl_CAT_Tags));
        }
コード例 #2
0
        public IHttpActionResult Post(DTO_CAT_Tags tbl_CAT_Tags)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DTO_CAT_Tags result = BS_CAT_Tags.post_CAT_Tags(db, tbl_CAT_Tags, Username);


            if (result != null)
            {
                return(CreatedAtRoute("get_CAT_Tags", new { id = result.ID }, result));
            }
            return(Conflict());
        }
コード例 #3
0
        public IHttpActionResult Delete(int id)
        {
            bool check = BS_CAT_Tags.check_CAT_Tags_Exists(db, id);

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

            bool result = BS_CAT_Tags.delete_CAT_Tags(db, id, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            return(Conflict());
        }
コード例 #4
0
        public IHttpActionResult Put(int id, DTO_CAT_Tags tbl_CAT_Tags)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            bool result = BS_CAT_Tags.put_CAT_Tags(db, id, tbl_CAT_Tags, Username);

            if (result)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(NotFound());
            }
        }
コード例 #5
0
 public IQueryable <DTO_CAT_Tags> Get()
 {
     return(BS_CAT_Tags.get_CAT_Tags(db, QueryStrings));
 }