Example #1
0
        public JsonResult updatePost([System.Web.Http.FromBody] Post data)
        {
            data.updateBy = User.UserId;
            var res = new PostBO().updatePost(data);

            return(Json(res));
        }
Example #2
0
        public static PostBO PostPOToBO(PostPO from)
        {
            PostBO to = new PostBO();

            to.PostId       = from.PostId;
            to.UserId       = from.UserId;
            to.Username     = from.Username;
            to.ThreadId     = from.ThreadId;
            to.CreationDate = from.CreationDate;
            to.EditDate     = from.EditDate;
            to.Title        = from.Title;
            to.Content      = from.Content;
            return(to);
        }
Example #3
0
        public JsonResult getPost([System.Web.Http.FromBody] int id)
        {
            var data = new PostBO().getPost(id);

            return(Json(data));
        }
Example #4
0
        public JsonResult hidePostFromList([System.Web.Http.FromBody] List <Post> datas)
        {
            var res = new PostBO().updatePostActiveFromList(datas, false);

            return(Json(res));
        }
Example #5
0
        public JsonResult getPostList()
        {
            var datas = new PostBO().getPostList();

            return(Json(datas));
        }
Example #6
0
        public JsonResult deletePost([System.Web.Http.FromBody] Post data)
        {
            var res = new PostBO().deletePost(data);

            return(Json(res));
        }