⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contentmanageui.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.AccessManage;
    using PowerEasy.Common;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Enumerations;
    using PowerEasy.Model.CommonModel;
    using PowerEasy.Model.Contents;
    using PowerEasy.Model.WorkFlow;
    using PowerEasy.ModelControls;
    using PowerEasy.Web.UI;
    using PowerEasy.WebSite.Controls;
    using PowerEasy.WorkFlows;
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class ContentManageUI : AdminPage
    {
        protected Button BatchSpecialSet;
        protected Button BtnSearch;
        protected ContentManageNavigation Cmn;
        protected DropDownList DropRescentQuery;
        protected DropDownList DrpSearchType;
        protected Button EBtnBatchDelete;
        protected Button EBtnBatchMove;
        protected Button EBtnBatchSet;
        protected Button EBtnCancelPass;
        protected Button EBtnPass;
        protected ExtendedGridView EgvContent;
        protected HiddenField HdnListType;
        protected HiddenField HdnSearchKeyword;
        protected HiddenField HdnSearchType;
        protected HiddenField HdnStatus;
        private bool m_Administrator;
        private string m_arrNodeIdCheck = "";
        private string m_arrNodeIdManage = "";
        private string m_arrNodeIdShow = "";
        private bool m_isCheck;
        private bool m_isManage;
        protected Dictionary<int, string> m_ModelPreviewDictionary = new Dictionary<int, string>();
        private int m_NodeId;
        protected Dictionary<int, NodeInfo> m_NodeInfoDictionary = new Dictionary<int, NodeInfo>();
        protected Dictionary<int, string> m_StatusDictionary = new Dictionary<int, string>();
        protected ObjectDataSource OdsContents;
        protected RadioButtonList RadlContent;
        protected ScriptManager ScriptManageContent;
        protected ExtendedSiteMapPath SmpNavigator;
        protected TextBox TxtSearchKeyword;

        protected void BtnModify_Click(object sender, EventArgs e)
        {
            BasePage.ResponseRedirect("ContentBatchModfiy.aspx");
        }

        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            this.HdnSearchType.Value = this.DrpSearchType.SelectedValue;
            this.HdnSearchKeyword.Value = this.TxtSearchKeyword.Text;
            this.EgvContent.DataBind();
        }

        protected void DropSelectedIndex_Changed(object sender, EventArgs e)
        {
            this.HdnListType.Value = this.DropRescentQuery.SelectedValue;
            this.EgvContent.PageIndex = 0;
        }

        protected void EBtnBatchDelete_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isManage);
            StringBuilder selectList = this.EgvContent.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要删除的项目!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else if (ContentManage.UpdateStatus(selectList.ToString(), -3))
            {
                PermissionContent.Delete(selectList.ToString());
                PowerEasy.Contents.ContentCharge.Delete(selectList.ToString());
                SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                AdminPage.WriteErrMsg("<li>删除项目失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
        }

        protected void EBtnBatchMove_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isManage);
            StringBuilder selectList = this.EgvContent.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要添加的项目!</li>");
            }
            else
            {
                BasePage.ResponseRedirect("ContentBatchMove.aspx?Id=" + selectList.ToString());
            }
        }

        protected void EBtnBatchSet_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isManage);
            BasePage.ResponseRedirect("ContentBatchSet.aspx?Action=Content&GeneralID=" + this.EgvContent.SelectList.ToString());
        }

        protected void EBtnBatchSpecialSet_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isManage);
            StringBuilder selectList = this.EgvContent.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要添加的项目!</li>");
            }
            else
            {
                BasePage.ResponseRedirect("AddContentToSpecial.aspx?Action=Content&Id=" + selectList.ToString());
            }
        }

        protected void EBtnCancelPass_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isCheck);
            StringBuilder selectList = this.EgvContent.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要取消审核的项目!</li>");
            }
            else if (ContentManage.UpdateStatus(selectList.ToString(), 0))
            {
                AdminPage.WriteSuccessMsg("<li>取消审核成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                AdminPage.WriteErrMsg("<li>取消审核失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
        }

        protected void EBtnPass_Click(object sender, EventArgs e)
        {
            this.PermissionDetection(this.m_isCheck);
            StringBuilder selectList = this.EgvContent.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要审核的项目!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                int nodeWorkFlowId = Nodes.GetNodeWorkFlowId(this.m_NodeId);
                RolePermissions.BusinessAccessCheck(OperateCode.NodeContentCheck, this.m_NodeId);
                if (this.m_Administrator)
                {
                    UpdateStatus(selectList.ToString(), 0x63);
                }
                else if (Nodes.GetNodeById(BasePage.RequestInt32("NodeID")).Child == 0)
                {
                    UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId));
                }
                else
                {
                    CommonModelInfo info2 = new CommonModelInfo();
                    if (selectList.ToString().IndexOf(",") > 0)
                    {
                        foreach (string str in selectList.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(str)).NodeId).WorkFlowId);
                            ContentManage.UpdateStatus(str, UserPass(nodeWorkFlowId));
                        }
                        AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                    }
                    else
                    {
                        nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(selectList.ToString())).NodeId).WorkFlowId);
                        UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId));
                    }
                }
            }
        }

        protected void EgvContent_RowCommand(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "DeleteContent")
            {
                int generalId = DataConverter.CLng(e.CommandArgument.ToString());
                if (ContentManage.UpdateStatus(generalId, -3))
                {
                    PermissionContent.Delete(generalId);
                    PowerEasy.Contents.ContentCharge.Delete(generalId);
                    SiteCache.Remove("CK_Page_Category_" + this.m_NodeId.ToString());
                    AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>删除失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                }
            }
        }

        protected void EgvContent_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                CommonModelInfo dataItem = (CommonModelInfo) e.Row.DataItem;
                int nodeId = dataItem.NodeId;
                string s = "";
                int length = 0;
                if (this.m_NodeInfoDictionary.ContainsKey(dataItem.NodeId))
                {
                    s = this.m_NodeInfoDictionary[dataItem.NodeId].NodeName;
                }
                else
                {
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
                    if (!cacheNodeById.IsNull)
                    {
                        s = cacheNodeById.NodeName;
                        this.m_NodeInfoDictionary.Add(dataItem.NodeId, cacheNodeById);
                    }
                }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -