Esempio n. 1
0
        protected void EBtnUnite_Click(object sender, EventArgs e)
        {
            int nodeId       = DataConverter.CLng(this.DropFromNode.SelectedValue);
            int targetNodeId = DataConverter.CLng(this.DropToNode.SelectedValue);

            if (nodeId == 0)
            {
                AdminPage.WriteErrMsg("<li>指定要合并的节点不存在或者已经被删除!</li>", "CategoryUnite.aspx");
            }
            if (targetNodeId == 0)
            {
                AdminPage.WriteErrMsg("<li>指定的目标节点不存在或者已经被删除!</li>", "CategoryUnite.aspx");
            }
            int errorType = Nodes.NodesUnite(nodeId, targetNodeId);

            if (errorType > 0)
            {
                AdminPage.WriteErrMsg("<li>" + Nodes.WriteNodesUniteMessage(errorType) + "</li>", "CategoryManage.aspx");
            }
            else
            {
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("<li>节点合并成功!已经将被合并节点及其下属子节点的所有数据转入目标节点中。</li><li>同时删除了被合并的节点及其子节点。</li><li>请重新生成目标节点的所有内容!。</li>", "CategoryManage.aspx");
            }
        }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            int nodeId       = DataConverter.CLng(this.LstFromNodes.SelectedValue);
            int moveToNodeId = DataConverter.CLng(this.LstToNodes.SelectedValue);

            if (nodeId == 0)
            {
                AdminPage.WriteErrMsg("<li>指定的节点不存在或者已经被删除!</li>", "CategoryMove.aspx?NodeID=" + nodeId);
            }
            if (string.IsNullOrEmpty(this.LstFromNodes.SelectedValue.ToString()))
            {
                AdminPage.WriteErrMsg("<li>请先选择要移动的目标节点!</li>", "CategoryMove.aspx?NodeID=" + nodeId);
            }
            int errorNum = Nodes.NodesMove(nodeId, moveToNodeId);

            if (errorNum > 0)
            {
                AdminPage.WriteErrMsg("<li>" + Nodes.WriteMessageByErrorNum(errorNum) + "</li>", "CategoryMove.aspx?NodeID=" + nodeId);
            }
            else
            {
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("<li>节点移动成功!</li>", "CategoryManage.aspx");
            }
        }
Esempio n. 3
0
        protected void EBtnSetOrderId_Click(object sender, EventArgs e)
        {
            string str = this.HdnSerNodeList.Value;

            if (!string.IsNullOrEmpty(str))
            {
                List <NodeInfo> nodeList = new List <NodeInfo>();
                string[]        strArray = str.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(DataConverter.CLng(strArray[i]));
                    if (this.m_IsRootOrder)
                    {
                        cacheNodeById.RootId    = i + 1;
                        cacheNodeById.OrderType = 1;
                    }
                    else
                    {
                        cacheNodeById.OrderId   = i + 1;
                        cacheNodeById.OrderType = 0;
                    }
                    if (!cacheNodeById.IsNull)
                    {
                        nodeList.Add(cacheNodeById);
                    }
                }
                Nodes.OrderNode(nodeList);
                this.Repeater1.DataBind();
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("栏目排序成功!", "CategoryOrder.aspx");
            }
        }
 protected void EBtnBacthSet_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         StringBuilder sb = new StringBuilder();
         foreach (ListItem item in this.LstSpecial.Items)
         {
             if (item.Selected)
             {
                 StringHelper.AppendString(sb, item.Value);
             }
         }
         if (sb.Length <= 0)
         {
             AdminPage.WriteErrMsg("请先指定要批量设置的专题!", "SpecialBatchSet.aspx");
         }
         if (Special.SpecialBatchSet(this.GetSpecialInfo(), sb.ToString(), this.GetCheckItem()))
         {
             IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
             AdminPage.WriteSuccessMsg("专题批量设置成功!", "SpecialManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("专题批量设置失败!", "SpecialBatchSet.aspx");
         }
     }
 }
Esempio n. 5
0
        private bool BatchAddSpecial(SpecialInfo specialInfo, StringBuilder information)
        {
            bool flag = false;

            if (IsDir(specialInfo.SpecialDir))
            {
                information.Append("<li>" + specialInfo.SpecialName + "目录名只能是字母、数字、下划线组成,首字符不能是数字!</li>");
                return(flag);
            }
            if (Special.ExistsSpecialName(specialInfo.SpecialName))
            {
                information.Append("<li>" + specialInfo.SpecialName + "专题名已经存在,请输入其它的专题名!</li>");
                return(flag);
            }
            if (Special.ExistsSpecialDir(specialInfo.SpecialDir))
            {
                information.Append("<li>" + specialInfo.SpecialDir + "专题目录已经存在,请输入其它的目录名!</li>");
                return(flag);
            }
            if (Special.AddSpecial(specialInfo))
            {
                this.InputPermissions(specialInfo.SpecialId);
                this.InputRolePermission(specialInfo.SpecialId);
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                return(true);
            }
            information.Append("<li>" + specialInfo.SpecialName + "专题信息保存失败!</li>");
            return(flag);
        }
 protected void EBtnReset_Click(object sender, EventArgs e)
 {
     Nodes.ResetNodes();
     IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
     base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
     AdminPage.WriteSuccessMsg("<li>复位节点成功!</li>", "CategoryManage.aspx");
 }
Esempio n. 7
0
 protected void EBtnModify_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         SpecialInfo specialInfo = this.GetSpecialInfo();
         specialInfo.SpecialId      = this.specialId;
         specialInfo.OrderId        = DataConverter.CLng(this.HdnOrderId.Value);
         specialInfo.NeedCreateHtml = true;
         string specialName = specialInfo.SpecialName;
         if ((specialName != this.HdnSpecialName.Value) && Special.ExistsSpecialName(specialName))
         {
             AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "Special.aspx");
         }
         if (Special.UpdateSpecial(specialInfo))
         {
             this.InputPermissions(specialInfo.SpecialId);
             this.InputRolePermission(specialInfo.SpecialId);
             IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
             AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "SpecialManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "SpecialManage.aspx");
         }
     }
 }
Esempio n. 8
0
 private void DeleteSpecialCategory()
 {
     if (Special.DeleteSpecialCategoryById(BasePage.RequestInt32("SpecialCategoryID")))
     {
         IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
         base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
         AdminPage.WriteSuccessMsg("<li>专题类别删除成功!</li>", "SpecialCategoryManage.aspx");
     }
     else
     {
         AdminPage.WriteErrMsg("<li>专题类别删除失败!</li>");
     }
 }
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         bool flag = true;
         SpecialCategoryInfo specialCategoryInfo = new SpecialCategoryInfo();
         specialCategoryInfo.NeedCreateHtml = false;
         if (this.HdnAction.Value == "Modify")
         {
             specialCategoryInfo.SpecialCategoryId = BasePage.RequestInt32("SpecialCategoryID");
             specialCategoryInfo.OrderId           = DataConverter.CLng(this.HdnOrderId.Value);
             specialCategoryInfo.NeedCreateHtml    = true;
         }
         specialCategoryInfo.SpecialCategoryName = this.TxtSpecialCategoryName.Text;
         specialCategoryInfo.SpecialCategoryDir  = this.TxtSpecialCategoryDir.Text;
         specialCategoryInfo.SpecialTemplatePath = this.FileCSpecialTemplatePath.Text;
         specialCategoryInfo.SearchTemplatePath  = this.FileCSearchTemplatePath.Text;
         specialCategoryInfo.OpenType            = DataConverter.CBoolean(this.RadOpenType.SelectedValue);
         specialCategoryInfo.Description         = this.TxtDescription.Text;
         specialCategoryInfo.PagePostfix         = this.PagePostfix.Value;
         specialCategoryInfo.IsCreateHtml        = DataConverter.CBoolean(this.RadlCreatHtml.SelectedValue);
         string text = this.TxtSpecialCategoryName.Text;
         if (((this.HdnAction.Value == "Modify") && (text != this.HdnSpecialCategoryName.Value)) && Special.ExistsSpecialCategoryName(text))
         {
             AdminPage.WriteErrMsg("<li>系统已经有此专题类别名称,请返回重新填写专题类别名称!</li>");
         }
         if (this.HdnAction.Value == "Modify")
         {
             flag = Special.UpdateSpecialCategory(specialCategoryInfo);
         }
         else
         {
             flag = Special.AddSpecialCategory(specialCategoryInfo);
         }
         if (flag)
         {
             IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
             base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
             AdminPage.WriteSuccessMsg("<li>专题类别信息保存成功!</li>", "SpecialCategoryManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("<li>专题类别信息保存失败!</li>", "SpecialCategoryManage.aspx");
         }
     }
 }
 protected void EBtnBacthSet_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         StringBuilder sb = new StringBuilder();
         foreach (ListItem item in this.LstNodes.Items)
         {
             int num;
             if (item.Selected && int.TryParse(item.Value, out num))
             {
                 StringHelper.AppendString(sb, item.Value);
             }
         }
         if (sb.Length <= 0)
         {
             AdminPage.WriteErrMsg("请先选择要批量设置的节点!");
         }
         if (Nodes.BatchUpdate(this.GetNodesInfo(), sb.ToString(), this.GetCheckItem()))
         {
             if (this.ChkPermissions.Checked)
             {
                 foreach (string str in sb.ToString().Split(new char[] { ',' }))
                 {
                     this.InputPermissions(DataConverter.CLng(str));
                     this.InputRolePermission(DataConverter.CLng(str));
                 }
             }
             if (this.ChkFileCTemplate.Checked)
             {
                 IList <NodesModelTemplateRelationShipInfo> dataFromRepeater = this.GetDataFromRepeater();
                 foreach (string str2 in sb.ToString().Split(new char[] { ',' }))
                 {
                     ModelManager.UpdateNodesModelTemplateRelationShip(DataConverter.CLng(str2), dataFromRepeater);
                 }
             }
             IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
             base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload()</script>");
             AdminPage.WriteSuccessMsg("批量设置成功!", "CategoryManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("批量设置失败!");
         }
     }
 }
        private void DeleteNode()
        {
            if (BasePage.RequestInt32("NodeID") == -2)
            {
                AdminPage.WriteErrMsg("首页节点不允许删除!", "CategoryManage.aspx");
            }
            switch (Nodes.Delete(BasePage.RequestInt32("NodeID")))
            {
            case 0:
                AdminPage.WriteErrMsg("删除节点失败!", "CategoryManage.aspx");
                return;

            case 1:
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("删除节点成功!请记得重新生成相关节点的文件呀!", "CategoryManage.aspx");
                return;

            case 2:
                AdminPage.WriteErrMsg("节点不存在,或者已经被删除!", "CategoryManage.aspx");
                return;
            }
        }
        private void ResetChildNodes()
        {
            int num = 0;

            num = Nodes.ResetChildNodes(BasePage.RequestInt32("NodeID"));
            if (num > 0)
            {
                if (num == 1)
                {
                    AdminPage.WriteErrMsg("<li>请选择你要复位的一级节点,一级节点以下的节点不能进行复位操作!</li>", "CategoryManage.aspx");
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>复位节点失败!</li>", "CategoryManage.aspx");
                }
            }
            else
            {
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("<li>复位节点成功!</li>", "CategoryManage.aspx");
            }
        }
Esempio n. 13
0
 private void AddSpecial(SpecialInfo specialInfo)
 {
     if (Special.ExistsSpecialName(specialInfo.SpecialName))
     {
         AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "");
     }
     if (Special.ExistsSpecialDir(specialInfo.SpecialDir))
     {
         AdminPage.WriteErrMsg("<li>此专题目录已经存在,请输入其它的目录名!</li>", "");
     }
     if (Special.AddSpecial(specialInfo))
     {
         this.InputPermissions(specialInfo.SpecialId);
         this.InputRolePermission(specialInfo.SpecialId);
         IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
         base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
         AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "Special.aspx?SpecialCategoryID=" + this.specialCategoryId.ToString());
     }
     else
     {
         AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "");
     }
 }
        protected void EBtnSetOrderId_Click(object sender, EventArgs e)
        {
            string str = this.HdnList.Value;

            if (!string.IsNullOrEmpty(str))
            {
                List <SpecialCategoryInfo> list = new List <SpecialCategoryInfo>();
                string[] strArray = str.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(DataConverter.CLng(strArray[i]));
                    if (!specialCategoryInfoById.IsNull)
                    {
                        specialCategoryInfoById.OrderId = i + 1;
                        list.Add(specialCategoryInfoById);
                    }
                }
                Special.OrderSpecialCategory(list);
                this.Repeater1.DataBind();
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("专题类别排序成功!", "SpecialCategoryOrder.aspx");
            }
        }
Esempio n. 15
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                if ((!PEContext.Current.Admin.IsSuperAdmin && (this.m_arrCurrentNodesManage != "-1")) && !StringHelper.FoundCharInArr(this.m_arrCurrentNodesManage, this.DropParentNode.SelectedValue))
                {
                    AdminPage.WriteErrMsg("<li>对不起,您没有保存指定栏目的权限!</li>");
                }
                NodeInfo nodesInfo = this.GetNodesInfo();
                nodesInfo.NodeId = BasePage.RequestInt32("NodeID");
                if (BasePage.RequestStringToLower("Action", "add") == "add")
                {
                    nodesInfo.NodeId = Nodes.GetMaxNodeId() + 1;
                    switch (Nodes.Add(nodesInfo))
                    {
                    case 0:
                        AdminPage.WriteErrMsg("添加单页失败!");
                        return;

                    case 1:
                        IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                        base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                        AdminPage.WriteSuccessMsg("添加单页成功!", "Single.aspx?Action=Modify&NodeID=" + nodesInfo.NodeId);
                        return;

                    case 2:
                        AdminPage.WriteErrMsg("节点名称已经存在!");
                        return;

                    case 3:
                        AdminPage.WriteErrMsg("节点标识符已经存在!");
                        return;

                    case 4:
                        AdminPage.WriteErrMsg("节点目录名已经存在!");
                        return;

                    case 5:
                        AdminPage.WriteErrMsg("父节点必须为容器节点!");
                        return;

                    case 6:
                        AdminPage.WriteErrMsg("父节点不存在!");
                        return;
                    }
                    AdminPage.WriteErrMsg("未知错误!");
                }
                else
                {
                    switch (Nodes.Update(nodesInfo))
                    {
                    case 0:
                        AdminPage.WriteErrMsg("修改单页失败!");
                        return;

                    case 1:
                        IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
                        base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                        AdminPage.WriteSuccessMsg("修改单页成功!", "Single.aspx?Action=Modify&NodeID=" + nodesInfo.NodeId);
                        return;

                    case 2:
                        AdminPage.WriteErrMsg("节点名称已经存在!");
                        return;

                    case 3:
                        AdminPage.WriteErrMsg("节点标识符已经存在!");
                        return;
                    }
                    AdminPage.WriteErrMsg("未知错误!");
                }
            }
        }
Esempio n. 16
0
        private void InitialText()
        {
            RolePermissions.AccessCheck(OperateCode.SpecialManage);
            string str = BasePage.RequestStringToLower("Action", "add");

            if (this.Page.IsPostBack)
            {
                return;
            }
            if (str == "copy")
            {
                this.specialId = Special.GetSpecialByIdCopySpecial(this.specialId);
                if (this.specialId > 0)
                {
                    this.InputPermissions(this.specialId);
                    this.InputRolePermission(this.specialId);
                    IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                    base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                    AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "Special.aspx?Action=Modify&SpecialID=" + this.specialId.ToString());
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>发生错误!</li>", "");
                }
            }
            IList <SpecialCategoryInfo> specialCategoryList = Special.GetSpecialCategoryList();

            this.DropSpecialCategory.SelectedValue = this.specialCategoryId.ToString();
            this.DropSpecialCategory.DataSource    = specialCategoryList;
            this.DropSpecialCategory.DataBind();
            ((DropDownList)this.PnlCustomFileds.FindControl("DropCustomNum")).Attributes.Add("onchange", "setFileFileds(this.value)");
            this.InitEChklPermission();
            string str2 = str;

            if (str2 != null)
            {
                if (!(str2 == "add"))
                {
                    if (str2 == "modify")
                    {
                        this.SmpNavigator.CurrentNode = "修改专题";
                        this.EBtnModify.Visible       = true;
                        if (!this.Page.IsPostBack)
                        {
                            this.BindSpecial();
                        }
                        goto Label_023A;
                    }
                }
                else
                {
                    this.SmpNavigator.CurrentNode = "添加专题";
                    this.EBtnAdd.Visible          = true;
                    BasePage.SetSelectedIndexByValue(this.DropSpecialCategory, this.specialCategoryId.ToString());
                    if (BasePage.RequestString("AddType").CompareTo("BatchSpecial") == 0)
                    {
                        this.SpecialName.Visible       = false;
                        this.SpecialIdentifier.Visible = false;
                        this.SpecialDir.Visible        = false;
                        this.BatchSpecial.Visible      = true;
                        this.TxtSpecialNames.Attributes.Add("onchange", "GetBatchInitial();");
                    }
                    else
                    {
                        this.TxtSpecialName.Attributes.Add("onchange", "GetInitial();");
                    }
                    goto Label_023A;
                }
            }
            this.SmpNavigator.CurrentNode = "添加专题";
            this.EBtnAdd.Visible          = true;
Label_023A:
            if (!RolePermissions.AccessCheck(OperateCode.AdministratorManage))
            {
                this.TabTitle1.Style.Add("display", "none");
            }
        }
 protected void EBtnPatch_Click(object sender, EventArgs e)
 {
     Nodes.PatchNodes();
     IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Node);
     AdminPage.WriteSuccessMsg("<li>节点修复成功!</li>", "CategoryManage.aspx");
 }