public IHttpActionResult GetIntroduce(int id) { IntroducesDTO intro = IntroducesDAO.Instance.GetIntroducts(id); if (intro == null) { return(NotFound()); } return(Ok(intro)); }
public IHttpActionResult PostIntroduce(IntroducesDTO introduce) { if (InsertIntroduce(introduce.Name, introduce.Img, introduce.Data, introduce.Describe, introduce.Color)) { return(CreatedAtRoute("DefaultApi", new { id = introduce.Id }, introduce)); } else { return(BadRequest()); } }
public IHttpActionResult PutIntroduce(int id, IntroducesDTO introduce) { if (EditIntroduce(id, introduce.Name, introduce.Img, introduce.Data, introduce.Describe, introduce.Color)) { return(StatusCode(HttpStatusCode.NoContent)); } else { return(BadRequest()); } }