Exemple #1
0
 public void BindData()
 {
     #region 绑定审核主题
     DataGrid1.AllowCustomPaging = false;
     DataGrid1.TableHeaderName   = "审核主题列表";
     DataGrid1.DataKeyField      = "tid";
     DataGrid1.BindData(AdminTopics.GetUnauditNewTopic());
     #endregion
 }
Exemple #2
0
 public void BindData()
 {
     #region 绑定审核帖子
     DataGrid1.AllowCustomPaging = false;
     DataGrid1.TableHeaderName   = "审核帖子列表";
     DataGrid1.DataKeyField      = "pid";
     DataGrid1.BindData(AdminTopics.GetUnauditPost(int.Parse(postlist.SelectedValue)));
     #endregion
 }
Exemple #3
0
        public void BindData()
        {
            #region 数据绑定

            DataGrid1.AllowCustomPaging = false;
            DataTable dt = AdminTopics.AdminGetPostList(DNTRequest.GetInt("tid", -1), DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1).Tables[0];

            foreach (DataRow dr in dt.Select("layer=0"))
            {
                dt.Rows.Remove(dr);
            }

            DataGrid1.DataSource = dt;
            DataGrid1.DataBind();

            #endregion
        }
Exemple #4
0
        private void SetTopicInfo_Click(object sender, EventArgs e)
        {
            #region   定的操作管理主题

            if (this.CheckCookie())
            {
                if (DNTRequest.GetString("tid") != "")
                {
                    string tidlist = DNTRequest.GetString("tid");
                    switch (DNTRequest.GetString("operation"))
                    {
                    case "moveforum":
                    {
                        if (forumid.SelectedValue != "0")
                        {
                            AdminTopics.BatchMoveTopics(tidlist, Convert.ToInt16(forumid.SelectedValue), userid, username, usergroupid, grouptitle, ip);
                            ////先找出当前主题列表中所属的FID
                            //foreach (DataRow olddr in Topics.GetTopicFidByTid(tidlist).Rows)
                            //{
                            //    string oldtidlist = "0";
                            //    //以FID和列表为条件列出在当前FID下的主题列表
                            //    foreach (DataRow mydr in Topics.GetTopicTidByFid(tidlist, int.Parse(olddr["fid"].ToString())).Rows)
                            //    {
                            //        oldtidlist += "," + mydr["tid"].ToString();
                            //    }
                            //    //调用前台操作函数
                            //    TopicAdmins.MoveTopics(oldtidlist, Convert.ToInt16(forumid.SelectedValue), Convert.ToInt16(olddr["fid"].ToString()));
                            //}
                            //AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量移动主题", "主题ID:" + tidlist + " <br />目标论坛fid:" + forumid.SelectedValue);
                        }
                        break;
                    }

                    case "movetype":
                    {
                        if (typeid.SelectedValue != "0")
                        {
                            AdminTopics.SetTypeid(tidlist, Convert.ToInt16(typeid.SelectedValue));
                            AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量修改主题类型", "主题ID:" + tidlist + " <br />类型tid:" + typeid.SelectedValue);
                        }
                        break;
                    }

                    case "delete":
                    {
                        AdminTopics.BatchDeleteTopics(tidlist, !nodeletepostnum.Checked, userid, username, usergroupid, grouptitle, ip);
                        //if (nodeletepostnum.Checked)
                        //{
                        //    Discuz.Forum.TopicAdmins.DeleteTopics(tidlist, 0, false);
                        //}
                        //else
                        //{
                        //    Discuz.Forum.TopicAdmins.DeleteTopics(tidlist, 1, false);
                        //}
                        //Discuz.Forum.Attachments.UpdateTopicAttachment(tidlist);
                        //AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量删除主题", "主题ID:" + tidlist);
                        break;
                    }

                    case "displayorder":
                    {
                        AdminTopics.BatchChangeTopicsDisplayOrderLevel(tidlist, Convert.ToInt32(DNTRequest.GetString("displayorder_level")), userid, username, usergroupid, grouptitle, ip);
                        //AdminTopics.SetDisplayorder(tidlist, Convert.ToInt16(DNTRequest.GetString("displayorder_level")));
                        //AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量置顶主题", "主题ID:" + tidlist + "<br /> 置顶级为:" + DNTRequest.GetString("displayorder_level"));
                        break;
                    }

                    case "adddigest":
                    {
                        AdminTopics.BatchChangeTopicsDigest(tidlist, Convert.ToInt32(DNTRequest.GetString("digest_level")), userid, username, usergroupid, grouptitle, ip);
                        //Discuz.Forum.TopicAdmins.SetDigest(DNTRequest.GetString("tid").Replace("0 ", ""), (short)Convert.ToInt16(DNTRequest.GetString("digest_level")));
                        //AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量加精主题", "主题ID:" + tidlist + "<br /> 加精级为:" + DNTRequest.GetString("digest_level"));
                        break;
                    }

                    case "deleteattach":
                    {
                        AdminTopics.BatchDeleteTopicAttachs(tidlist, userid, username, usergroupid, grouptitle, ip);
                        //AdminTopicOperations.DeleteAttachmentByTid(DNTRequest.GetString("tid").Replace("0 ", ""));
                        //AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除主题中的附件", "主题ID:" + tidlist);
                        break;
                    }
                    }
                    base.RegisterStartupScript("PAGE", "window.location.href='forum_topicsgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('请选择相应的主题!');window.location.href='forum_topicsgrid.aspx';</script>");
                }
            }

            #endregion
        }
Exemple #5
0
 private void SetTopicInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (Request["tid"] != "")
         {
             string tid = Request["tid"];
             string string2;
             if ((string2 = Request["operation"]) != null)
             {
                 if (!(string2 == "moveforum"))
                 {
                     if (!(string2 == "movetype"))
                     {
                         if (!(string2 == "delete"))
                         {
                             if (!(string2 == "displayorder"))
                             {
                                 if (!(string2 == "adddigest"))
                                 {
                                     if (string2 == "deleteattach")
                                     {
                                         AdminTopics.BatchDeleteTopicAttachs(tid, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                                     }
                                 }
                                 else
                                 {
                                     AdminTopics.BatchChangeTopicsDigest(tid, Request["digest_level"].ToInt(), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                                 }
                             }
                             else
                             {
                                 AdminTopics.BatchChangeTopicsDisplayOrderLevel(tid, Request["displayorder_level"].ToInt(), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                             }
                         }
                         else
                         {
                             AdminTopics.BatchDeleteTopics(tid, !this.nodeletepostnum.Checked, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                         }
                     }
                     else
                     {
                         if (this.typeid.SelectedValue != "0")
                         {
                             //AdminTopics.SetTypeid(tid, (int)Convert.ToInt16(this.typeid.SelectedValue));
                             var list = Topic.FindAllByIDs(tid);
                             list.ForEach(tp => tp.TypeID = typeid.SelectedValue.ToInt());
                             list.Save();
                             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量修改主题类型", "主题ID:" + tid + " <br />类型tid:" + this.typeid.SelectedValue);
                         }
                     }
                 }
                 else
                 {
                     if (this.forumid.SelectedValue != "0")
                     {
                         AdminTopics.BatchMoveTopics(tid, (int)Convert.ToInt16(this.forumid.SelectedValue), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);
                     }
                 }
             }
             base.RegisterStartupScript("PAGE", "window.location.href='forum_topicsgrid.aspx';");
             return;
         }
         base.RegisterStartupScript("", "<script>alert('请选择相应的主题!');window.location.href='forum_topicsgrid.aspx';</script>");
     }
 }
Exemple #6
0
        private void SetTopicInfo_Click(object sender, EventArgs e)
        {
            #region   定的操作管理主题

            if (this.CheckCookie())
            {
                if (DNTRequest.GetString("tid") != "")
                {
                    string tidlist = DNTRequest.GetString("tid");
                    switch (DNTRequest.GetString("operation"))
                    {
                    case "moveforum":
                    {
                        if (forumid.SelectedValue != "0")
                        {         //先找出当前主题列表中所属的FID
                            //foreach (DataRow olddr in DbHelper.ExecuteDataset("SELECT distinct [fid] From [" + BaseConfigs.GetTablePrefix + "topics] WHERE [tid] IN(" + tidlist + ")").Tables[0].Rows)
                            foreach (DataRow olddr in DatabaseProvider.GetInstance().GetTopicFidByTid(tidlist).Rows)
                            {
                                string oldtidlist = "0";
                                //以FID和列表为条件列出在当前FID下的主题列表
                                //foreach (DataRow mydr in DbHelper.ExecuteDataset("SELECT [tid] From [" + BaseConfigs.GetTablePrefix + "topics] WHERE [tid] IN(" + tidlist + ") AND [fid]=" + olddr["fid"]).Tables[0].Rows)
                                foreach (DataRow mydr in DatabaseProvider.GetInstance().GetTopicTidByFid(tidlist, int.Parse(olddr["fid"].ToString())).Rows)
                                {
                                    oldtidlist += "," + mydr["tid"].ToString();
                                }
                                //调用前台操作函数
                                TopicAdmins.MoveTopics(oldtidlist, Convert.ToInt16(forumid.SelectedValue), Convert.ToInt16(olddr["fid"].ToString()));
                            }
                            AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量移动主题", "主题ID:" + tidlist + " <br />目标论坛fid:" + forumid.SelectedValue);
                        }
                        break;
                    }

                    case "movetype":
                    {
                        if (typeid.SelectedValue != "0")
                        {
                            AdminTopics.SetTypeid(tidlist, Convert.ToInt16(typeid.SelectedValue));
                            AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量修改主题类型", "主题ID:" + tidlist + " <br />类型tid:" + typeid.SelectedValue);
                        }
                        break;
                    }

                    case "delete":
                    {
                        if (nodeletepostnum.Checked)
                        {
                            TopicAdmins.DeleteTopics(tidlist, 0, false);
                        }
                        else
                        {
                            TopicAdmins.DeleteTopics(tidlist, 1, false);
                        }
                        Attachments.UpdateTopicAttachment(tidlist);
                        AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量删除主题", "主题ID:" + tidlist);
                        break;
                    }

                    case "displayorder":
                    {
                        AdminTopics.SetDisplayorder(tidlist, Convert.ToInt16(DNTRequest.GetString("displayorder_level")));
                        AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量置顶主题", "主题ID:" + tidlist + "<br /> 置顶级为:" + DNTRequest.GetString("displayorder_level"));
                        break;
                    }

                    case "adddigest":
                    {
                        TopicAdmins.SetDigest(DNTRequest.GetString("tid").Replace("0 ", ""), (short)Convert.ToInt16(DNTRequest.GetString("digest_level")));
                        AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量加精主题", "主题ID:" + tidlist + "<br /> 加精级为:" + DNTRequest.GetString("digest_level"));
                        break;
                    }

                    case "deleteattach":
                    {
                        AdminTopicOperations.DeleteAttachmentByTid(DNTRequest.GetString("tid").Replace("0 ", ""));
                        AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除主题中的附件", "主题ID:" + tidlist);
                        break;
                    }
                    }
                    base.RegisterStartupScript("PAGE", "window.location.href='forum_topicsgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('请选择相应的主题!');window.location.href='forum_topicsgrid.aspx';</script>");
                }
            }

            #endregion
        }