コード例 #1
0
    private void DeleteTopic(int topicid)
    {
        TopicInfo t       = Topics.GetTopic(topicid);
        int       forumid = t.ForumId;

        Topics.Delete(t);
        InvalidateForumCache();
        Response.Redirect("~/Content/Forums/Forum.aspx?FORUM=" + forumid);
    }
コード例 #2
0
        public APIReturn Delete_delete(ulong?Id)
        {
            int affrows = Topics.Delete(Id);

            if (affrows > 0)
            {
                return(new APIReturn(0, string.Format("删除成功,影响行数:{0}", affrows)));
            }
            return(new APIReturn(99, "失败"));
        }
コード例 #3
0
        public IActionResult  除(ulong id)
        {
            TopicsInfo topic = Topics.GetItem(id);

            if (topic.Owner_users_id == LoginUser.Id || LoginUser.Id == 1             //管理员
                )
            {
                Topics.Delete(id);

                return(Json(new { success = true, message = "成功" }));
            }
            return(Json(new { success = false, message = "没有权限删除" }));
        }
コード例 #4
0
        private void DeleteTopic(int topicid)
        {
            var lbl = UpdateProgress1.FindControl("lblProgress");

            if (lbl != null)
            {
                ((Label)lbl).Text = "Deleting Topic";
            }

            Topics.Delete(topicid);
            InvalidateCache();
            ForumTable.DataBind();
        }
コード例 #5
0
        public void DeletePost(string topicid, string replyid, string jsonform)
        {
            var form = HttpUtility.UrlDecode(jsonform);

            System.Collections.Specialized.NameValueCollection formresult = HttpUtility.ParseQueryString(form);
            string reason     = formresult["ctl00$txtReason"];
            int    adminmodid = Convert.ToInt32(formresult["ctl00$hdnModerator"]);

            if (!String.IsNullOrEmpty(topicid))
            {
                Topics.Delete(Convert.ToInt32(topicid));
            }
            if (!String.IsNullOrEmpty(replyid))
            {
                Replies.DeleteReply(Convert.ToInt32(replyid));
            }
            if (!string.IsNullOrEmpty(reason) && Config.UseEmail)
            {
                ProcessModeration(1, Convert.ToInt32(topicid), Convert.ToInt32(replyid), adminmodid, reason);
            }
        }
コード例 #6
0
 protected void DeleteTopic(int topicid)
 {
     Topics.Delete(topicid);
     Response.Redirect(Request.RawUrl);
 }