Beispiel #1
0
 public ResponseNewsUnPublish UnPublish([FromBody] RequestNewsUnPublish request)
 {
     try
     {
         NewsBLL bll = new NewsBLL();
         return(bll.UnPublish(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Beispiel #2
0
        public ResponseNewsUnPublish UnPublish(RequestNewsUnPublish request)
        {
            var res = new ResponseNewsUnPublish();

            using (cnn = GetConnection())
            {
                try
                {
                    string sql = "update tks_fas_news set status=0   where id=@Id";

                    cnn.Execute(sql, new { Id = request.Id });

                    res.IsSuccess = true;
                    res.Message   = "取消发布成功";
                    return(res);
                }
                catch (Exception ex)
                {
                    return(this.DealException(res, ex) as ResponseNewsUnPublish);
                }
            }
        }