protected void Page_Load(object sender, EventArgs e) { var fid = Request["currentfid"].ToInt(); if (fid > 0) { var tfid = Request["targetfid"].ToInt(); if (!AdminForums.MovingForumsPos(fid, tfid, Request["isaschildnode"].ToInt() == 1)) { base.RegisterStartupScript("", "<script>alert('当前版块下面有子版块,因此无法移动!');window.location.href='forum_forumsTree.aspx';</script>"); } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + fid + "到ID:" + tfid); } if (!this.Page.IsPostBack) { var list = XForum.Root.Childs; if (list.Count == 0) { base.Server.Transfer("forum_AddFirstForum.aspx"); } else { this.AddTree(0, list, ""); this.str = "<script type=\"text/javascript\">\r\n var obj = [" + this.str; this.str = this.str.Substring(0, this.str.Length - 3); this.str += "];\r\n var newtree = new tree(\"newtree\",obj,\"reSetTree\");"; this.str += "</script>"; } this.ShowTreeLabel.Text = this.str; } }
protected void Page_Load(object sender, EventArgs e) { if (DNTRequest.GetString("currentfid") != "") { if (!AdminForums.MovingForumsPos(DNTRequest.GetString("currentfid"), DNTRequest.GetString("targetfid"), DNTRequest.GetString("isaschildnode") == "1" ? true : false)) { base.RegisterStartupScript("", "<script>alert('当前版块下面有子版块,因此无法移动!');window.location.href='forum_forumsTree.aspx';</script>"); } AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + DNTRequest.GetString("currentfid") + "到ID:" + DNTRequest.GetString("targetfid")); } if (!Page.IsPostBack) { DataTable dt = DatabaseProvider.GetInstance().GetForums(); ViewState["dt"] = dt; if (dt.Rows.Count == 0) { Server.Transfer("forum_AddFirstForum.aspx"); //如果版块表中没有任何版块, 则跳转到"添加第一个版块"页面. } else { AddTree(0, dt.Select("layer=0 AND [parentid]=0"), ""); str = "<script type=\"text/javascript\">\r\n var obj = [" + str; str = str.Substring(0, str.Length - 3); str += "];\r\n var newtree = new tree(\"newtree\",obj,\"reSetTree\");"; str += "</script>"; } ShowTreeLabel.Text = str; } }
private void SaveMoveInfo_Click(object sender, EventArgs e) { if (this.sourceforumid.SelectedValue == this.targetforumid.SelectedValue) { base.RegisterStartupScript("", "<script>alert('您所要移动的版块与目标版块相同, 因此无法提交!');</script>"); return; } bool isaschildnode = this.movetype.SelectedValue == "1"; if (!AdminForums.MovingForumsPos(this.sourceforumid.SelectedValue.ToInt(), this.targetforumid.SelectedValue.ToInt(), isaschildnode)) { base.RegisterStartupScript("", "<script>alert('当前源版块移动失败!');</script>"); return; } ForumOperator.RefreshForumCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + this.sourceforumid.SelectedValue + "到ID:" + this.targetforumid.SelectedValue); base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsTree.aspx';"); }
private void SaveMoveInfo_Click(object sender, EventArgs e) { #region 保存版块移动设置 if (sourceforumid.SelectedValue == targetforumid.SelectedValue) { base.RegisterStartupScript("", "<script>alert('您所要移动的版块与目标版块相同, 因此无法提交!');</script>"); return; } bool aschild = movetype.SelectedValue == "1" ? true : false; if (!AdminForums.MovingForumsPos(sourceforumid.SelectedValue, targetforumid.SelectedValue, aschild)) { base.RegisterStartupScript("", "<script>alert('当前源版块移动失败!');</script>"); return; } ForumOperator.RefreshForumCache(); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + sourceforumid.SelectedValue + "到ID:" + targetforumid.SelectedValue); base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsTree.aspx';"); #endregion }