Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.joindateStart.SelectedDate = DateTime.Now.AddDays(-30.0);
         this.joindateEnd.SelectedDate   = DateTime.Now;
         this.UserGroup.AddTableData(UserGroups.GetUserGroupForDataTable(), "grouptitle", "groupid");
         if (Request["username"] != null && Request["username"] != "")
         {
             this.ViewState["condition"]   = Users.GetUserListCondition(Request["username"]);
             this.searchtable.Visible      = false;
             this.ResetSearchTable.Visible = true;
         }
         if (this.ViewState["condition"] != null)
         {
             this.searchtable.Visible      = false;
             this.ResetSearchTable.Visible = true;
         }
         else
         {
             if (!String.IsNullOrEmpty(Request["condition"]))
             {
                 this.ViewState["condition"]   = Request["condition"].Replace("~^", "'").Replace("~$", "%");
                 this.searchtable.Visible      = false;
                 this.ResetSearchTable.Visible = true;
             }
         }
         this.BindData();
     }
 }
        public void InitInfo()
        {
            #region 初始化信息绑定
            targetforumid.BuildTree(Forums.GetForumListForDataTable(), "name", "fid");
            templateid.AddTableData(Templates.GetValidTemplateList(), "name", "templateid");

            DataTable dt = UserGroups.GetUserGroupForDataTable();
            int       i  = 1;
            foreach (DataRow dr in dt.Rows)
            {
                HtmlTableRow  tr = new HtmlTableRow();
                HtmlTableCell td = new HtmlTableCell("td");
                if (i % 2 == 1)
                {
                    td.Attributes.Add("class", "td_alternating_item1");
                }
                else
                {
                    td.Attributes.Add("class", "td_alternating_item2");
                }
                td.Controls.Add(new LiteralControl("<input type='checkbox' id='r" + i + "' onclick='selectRow(" + i + ",this.checked)'><label for='r" + i + "'>" + dr["grouptitle"].ToString() + "</lable>"));
                tr.Cells.Add(td);
                tr.Cells.Add(GetTD("viewperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("postperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("replyperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("getattachperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("postattachperm", dr["groupid"].ToString(), i));
                powerset.Rows.Add(tr);
                i++;
            }

            dt = Attachments.GetAttachmentType();
            attachextensions.AddTableData(dt);


            if (DNTRequest.GetString("fid") != "")
            {
                targetforumid.SelectedValue = DNTRequest.GetString("fid");
                addtype.SelectedValue       = "1";
                targetforumid.Visible       = true;
            }

            showcolnum.Attributes.Add("style", "display:none");
            colcount.SelectedIndex = 0;
            colcount.Attributes.Add("onclick", "javascript:document.getElementById('" + showcolnum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_colcount_0').checked ? 'none' : 'block');");

            showclose.Attributes.Add("style", "display:none");
            autocloseoption.SelectedIndex = 0;

            showtargetforum.Attributes.Add("style", "display:block");
            addtype.Attributes.Add("onclick", "javascript:document.getElementById('" + showtargetforum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage51_addtype_0').checked ? 'none' : 'block');setColDisplayer(document.getElementById('TabControl1_tabPage51_addtype_0').checked);");
            autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage22_autocloseoption_0').checked ? 'none' : 'block');");

            #endregion
        }
Exemplo n.º 3
0
        public void InitInfo()
        {
            #region 加载初始化信息
            //绑定模板
            templateid.AddTableData(Templates.GetValidTemplateList(), "templatetitle", "templateid");
            //绑定用户组
            DataTable dt = UserGroups.GetUserGroupForDataTable();
            int       i  = 1;
            foreach (DataRow dr in dt.Rows)
            {
                HtmlTableRow  tr = new HtmlTableRow();
                HtmlTableCell td = new HtmlTableCell("td");
                if (i % 2 == 1)
                {
                    td.Attributes.Add("class", "td_alternating_item1");
                }
                else
                {
                    td.Attributes.Add("class", "td_alternating_item2");
                }
                td.Controls.Add(new LiteralControl("<input type='checkbox' id='r" + i + "' onclick='selectRow(" + i + ",this.checked)'>"));
                tr.Cells.Add(td);
                td = new HtmlTableCell("td");
                if (i % 2 == 1)
                {
                    td.Attributes.Add("class", "td_alternating_item1");
                }
                else
                {
                    td.Attributes.Add("class", "td_alternating_item2");
                }
                td.Controls.Add(new LiteralControl("<label for='r" + i + "'>" + dr["grouptitle"].ToString() + "</lable>"));
                tr.Cells.Add(td);
                tr.Cells.Add(GetTD("viewperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("postperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("replyperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("getattachperm", dr["groupid"].ToString(), i));
                tr.Cells.Add(GetTD("postattachperm", dr["groupid"].ToString(), i));
                powerset.Rows.Add(tr);
                i++;
            }
            //绑定附件类型
            dt = Attachments.GetAttachmentType();
            attachextensions.AddTableData(dt);

            showclose.Attributes.Add("style", "display:none");
            autocloseoption.SelectedIndex = 0;
            autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage2_autocloseoption_0').checked ? 'none' : 'block');");

            #endregion
        }
Exemplo n.º 4
0
 private void InitializeComponent()
 {
     this.EditUser.Click              += new EventHandler(this.EditUser_Click);
     this.EditForum.Click             += new EventHandler(this.EditForum_Click);
     this.EditUserGroup.Click         += new EventHandler(this.EditUserGroup_Click);
     this.UpdateCache.Click           += new EventHandler(this.UpdateCache_Click);
     this.CreateTemplate.Click        += new EventHandler(this.CreateTemplate_Click);
     this.UpdateForumStatistics.Click += new EventHandler(this.UpdateForumStatistics_Click);
     foreach (DataRow dataRow in AdminTemplates.GetAllTemplateList(Utils.GetMapPath("..\\..\\templates\\")).Rows)
     {
         if (dataRow["valid"].ToString() == "1")
         {
             this.Templatepath.Items.Add(new ListItem(dataRow["name"].ToString(), dataRow["directory"].ToString()));
         }
     }
     this.Username.AddAttributes("onkeydown", "if(event.keyCode==13) return(document.forms(0).EditUser.focus());");
     this.Usergroupid.AddTableData(UserGroups.GetUserGroupForDataTable(), "grouptitle", "groupid");
 }
Exemplo n.º 5
0
        private void InitializeComponent()
        {
            this.SubmitBatchSet.Click += new EventHandler(this.SubmitBatchSet_Click);

            #region 控件数据绑定

            DataTable dt = UserGroups.GetUserGroupForDataTable();
            viewperm.AddTableData(dt, "grouptitle", "groupid");
            postperm.AddTableData(dt, "grouptitle", "groupid");
            replyperm.AddTableData(dt, "grouptitle", "groupid");
            getattachperm.AddTableData(dt, "grouptitle", "groupid");
            postattachperm.AddTableData(dt, "grouptitle", "groupid");

            attachextensions.AddTableData(Attachments.GetAttachmentType());
            LoadCurrentForumInfo(DNTRequest.GetInt("fid", -1));

            #endregion
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                #region 实始化控件

                joindateStart.SelectedDate = DateTime.Now.AddDays(-30);

                joindateEnd.SelectedDate = DateTime.Now;

                UserGroup.AddTableData(UserGroups.GetUserGroupForDataTable(), "grouptitle", "groupid");
                if ((DNTRequest.GetString("username") != null) && (DNTRequest.GetString("username") != ""))
                {
                    ViewState["condition"]   = Users.GetUserListCondition(DNTRequest.GetString("username"));
                    searchtable.Visible      = false;
                    ResetSearchTable.Visible = true;
                }

                if (ViewState["condition"] != null)
                {
                    searchtable.Visible      = false;
                    ResetSearchTable.Visible = true;
                }
                else
                {
                    if (DNTRequest.GetString("condition") != "")
                    {
                        ViewState["condition"]   = DNTRequest.GetString("condition").Replace("~^", "'").Replace("~$", "%");
                        searchtable.Visible      = false;
                        ResetSearchTable.Visible = true;
                    }
                }
                BindData();

                #endregion
            }
        }
        public void LoadCurrentForumInfo(int fid)
        {
            #region 加载相关信息

            if (fid <= 0)
            {
                return;
            }

            forumInfo = Forums.GetForumInfo(fid);

            if (forumInfo == null)
            {
                return;
            }

            if (forumInfo.Layer > 0)
            {
                tabPage2.Visible = true;
                tabPage6.Visible = true;
            }
            else//如果是分类
            {
                //删除掉"高级设置"属性页
                TabControl1.Items.Remove(tabPage2);
                tabPage2.Visible = false;

                //删除掉"权限设置"属性页
                //TabControl1.Items.Remove(tabPage3);
                //tabPage3.Visible = false;

                //删除掉"特殊用户"属性页
                //TabControl1.Items.Remove(tabPage4);
                //tabPage4.Visible = false;

                //删除掉"主题分类"属性页
                TabControl1.Items.Remove(tabPage5);
                tabPage5.Visible = false;

                //删除掉"统计信息"属性页
                TabControl1.Items.Remove(tabPage6);
                tabPage6.Visible = false;
                //templatestyle.Visible = false;
            }
            forumname.Text    = forumInfo.Name.Trim();
            name.Text         = forumInfo.Name.Trim();
            displayorder.Text = forumInfo.Displayorder.ToString();

            status.SelectedValue = forumInfo.Status.ToString();

            if (forumInfo.Colcount == 1)
            {
                showcolnum.Attributes.Add("style", "display:none");
                colcount.SelectedIndex = 0;
            }
            else
            {
                showcolnum.Attributes.Add("style", "display:block");
                colcount.SelectedIndex = 1;
            }
            colcount.Attributes.Add("onclick", "javascript:document.getElementById('" + showcolnum.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage1_colcount_0').checked ? 'none' : 'block');");
            colcountnumber.Text = forumInfo.Colcount.ToString();
            //forumInfo.Templateid为0表示绑定到默认模板
            templateid.SelectedValue = (forumInfo.Templateid == 0 && config.Templateid == 1) ? "1" : forumInfo.Templateid.ToString();

            forumsstatic.Text = string.Format("主题总数:{0}<br />帖子总数:{1}<br />今日回帖数总数:{2}<br />最后提交日期:{3}",
                                              forumInfo.Topics.ToString(),
                                              forumInfo.Posts.ToString(),
                                              forumInfo.Todayposts.ToString(),
                                              forumInfo.Lastpost.ToString());

            ViewState["forumsstatic"] = forumsstatic.Text;

            if (forumInfo.Allowsmilies == 1)
            {
                setting.Items[0].Selected = true;
            }
            if (forumInfo.Allowrss == 1)
            {
                setting.Items[1].Selected = true;
            }
            if (forumInfo.Allowbbcode == 1)
            {
                setting.Items[2].Selected = true;
            }
            if (forumInfo.Allowimgcode == 1)
            {
                setting.Items[3].Selected = true;
            }
            if (forumInfo.Recyclebin == 1)
            {
                setting.Items[4].Selected = true;
            }
            if (forumInfo.Modnewposts == 1)
            {
                setting.Items[5].Selected = true;
            }
            if (forumInfo.Modnewtopics == 1)
            {
                setting.Items[6].Selected = true;
            }
            if (forumInfo.Jammer == 1)
            {
                setting.Items[7].Selected = true;
            }
            if (forumInfo.Disablewatermark == 1)
            {
                setting.Items[8].Selected = true;
            }
            if (forumInfo.Inheritedmod == 1)
            {
                setting.Items[9].Selected = true;
            }
            if (forumInfo.Allowthumbnail == 1)
            {
                setting.Items[10].Selected = true;
            }
            if (forumInfo.Allowtag == 1)
            {
                setting.Items[11].Selected = true;
            }
            //if (__foruminfo.Istrade == 1) setting.Items[11].Selected = true;
            if ((forumInfo.Allowpostspecial & 1) != 0)
            {
                setting.Items[12].Selected = true;
            }
            if ((forumInfo.Allowpostspecial & 16) != 0)
            {
                setting.Items[13].Selected = true;
            }
            if ((forumInfo.Allowpostspecial & 4) != 0)
            {
                setting.Items[14].Selected = true;
            }
            if ((forumInfo.Alloweditrules == 1))
            {
                setting.Items[15].Selected = true;
            }
            allowspecialonly.SelectedValue = forumInfo.Allowspecialonly.ToString();

            if (forumInfo.Autoclose == 0)
            {
                showclose.Attributes.Add("style", "display:none");
                autocloseoption.SelectedIndex = 0;
            }
            else
            {
                autocloseoption.SelectedIndex = 1;
            }
            autocloseoption.Attributes.Add("onclick", "javascript:document.getElementById('" + showclose.ClientID + "').style.display= (document.getElementById('TabControl1_tabPage2_autocloseoption_0').checked ? 'none' : 'block');");
            autocloseday.Text = forumInfo.Autoclose.ToString();

            //提取高级信息
            description.Text = forumInfo.Description.Trim();
            password.Text    = forumInfo.Password.Trim();
            icon.Text        = forumInfo.Icon.Trim();
            redirect.Text    = forumInfo.Redirect.Trim();
            moderators.Text  = forumInfo.Moderators.Trim();

            inheritmoderators.Text = Users.GetModerators(fid);
            rules.Text             = forumInfo.Rules.Trim();
            seokeywords.Text       = forumInfo.Seokeywords == null ? "" : forumInfo.Seokeywords.Trim();
            seodescription.Text    = forumInfo.Seodescription == null ? "" : forumInfo.Seodescription.Trim();
            rewritename.Text       = forumInfo.Rewritename == null ? "" : forumInfo.Rewritename.Trim();
            oldrewritename.Value   = rewritename.Text;
            topictypes.Text        = forumInfo.Topictypes.Trim();
            DataTable dt = UserGroups.GetUserGroupForDataTable();
            int       i  = 1;
            foreach (DataRow dr in dt.Rows)
            {
                HtmlTableRow  tr = new HtmlTableRow();
                HtmlTableCell td = new HtmlTableCell("td");
                //if (i % 2 == 1)
                //    td.Attributes.Add("class", "td_alternating_item1");
                //else
                //    td.Attributes.Add("class", "td_alternating_item2");
                td.Controls.Add(new LiteralControl("<input type='checkbox' id='r" + i + "' onclick='selectRow(" + i + ",this.checked)'>"));
                tr.Cells.Add(td);
                td = new HtmlTableCell("td");
                //if (i % 2 == 1)
                //    td.Attributes.Add("class", "td_alternating_item1");
                //else
                //    td.Attributes.Add("class", "td_alternating_item2");
                td.Controls.Add(new LiteralControl("<label for='r" + i + "'>" + dr["grouptitle"].ToString() + "</lable>"));
                tr.Cells.Add(td);
                tr.Cells.Add(GetTD("viewperm", forumInfo.Viewperm.Trim(), dr["groupid"].ToString(), i));

                if (forumInfo.Layer > 0)
                {
                    tr.Cells.Add(GetTD("postperm", forumInfo.Postperm.Trim(), dr["groupid"].ToString(), i));
                    tr.Cells.Add(GetTD("replyperm", forumInfo.Replyperm.Trim(), dr["groupid"].ToString(), i));
                    tr.Cells.Add(GetTD("getattachperm", forumInfo.Getattachperm.Trim(), dr["groupid"].ToString(), i));
                    tr.Cells.Add(GetTD("postattachperm", forumInfo.Postattachperm.Trim(), dr["groupid"].ToString(), i));
                }
                powerset.Rows.Add(tr);
                i++;
            }
            if (forumInfo.Layer == 0)
            {
                HtmlTableRow dr = powerset.Rows[0];
                dr.Cells[3].Visible = false;
                dr.Cells[4].Visible = false;
                dr.Cells[5].Visible = false;
                dr.Cells[6].Visible = false;
            }

            dt = Attachments.GetAttachmentType();
            attachextensions.SetSelectByID(forumInfo.Attachextensions.Trim());

            if (fid > 0)
            {
                forumInfo = Forums.GetForumInfo(fid);
            }
            else
            {
                return;
            }
            applytopictype.SelectedValue  = forumInfo.Applytopictype.ToString();
            postbytopictype.SelectedValue = forumInfo.Postbytopictype.ToString();
            viewbytopictype.SelectedValue = forumInfo.Viewbytopictype.ToString();
            topictypeprefix.SelectedValue = forumInfo.Topictypeprefix.ToString();


            #endregion
        }