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

📄 productmanagenavigation.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Controls
{
    using AjaxControlToolkit;
    using PowerEasy.AccessManage;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Enumerations;
    using PowerEasy.ExtendedControls;
    using PowerEasy.Model.Contents;
    using PowerEasy.Web.UI;
    using System;
    using System.Data;
    using System.Web.UI.WebControls;

    public class ProductManageNavigation : BaseUserControl
    {
        protected DropDownExtender Adrp;
        protected ExtendedNodeLinkButton ELnkContentList;
        protected ExtendedLinkButton ELnkProductBatchModify;
        protected ExtendedLinkButton ELnkProductImport;
        protected ExtendedNodeLinkButton ELnkProductRecycle;
        protected ExtendedNodeLinkButton ELnkProductStockManage;
        protected HyperLink HlkModel;
        protected Label LblAddProduct;
        protected Literal LitSeparator;
        protected Panel PnlSelectModelMenu;
        protected Repeater RptModelList;

        protected void ELnkProductBatchModify_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("ProductBatchModify.aspx");
        }

        protected void ELnkProductImport_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("ProductImport.aspx");
        }

        protected void ELnkProductList_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("ProductManage.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
        }

        protected void ELnkProductRecycle_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("ProductRecycle.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
        }

        protected void ELnkProductStockManage_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("StockManage.aspx");
        }

        protected void ELnkReplaceManage_Click(object sender, EventArgs e)
        {
            BaseUserControl.ResponseRedirect("ProductBatchModify.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            string basePath = "";
            basePath = base.BasePath;
            basePath = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + basePath;
            this.Adrp.DropArrowImageUrl = basePath + "Admin/Images/sitelist.gif";
            int nodeId = BaseUserControl.RequestInt32("NodeID");
            bool isSuperAdmin = PEContext.Current.Admin.IsSuperAdmin;
            bool flag2 = false;
            bool flag3 = false;
            if (!isSuperAdmin)
            {
                string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput);
                string str3 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (nodeId > 0)
                {
                    string str4 = nodeId.ToString();
                    NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        BaseUserControl.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        str4 = str4 + "," + cacheNodeById.ParentPath;
                    }
                    flag3 = RolePermissions.CheckNodePurview(str3, str4);
                    flag2 = RolePermissions.CheckNodePurview(roleNodeId, str4);
                }
                else
                {
                    flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.ProductManage, -1);
                    flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.ProductAdd, -1);
                }
                if (!flag2)
                {
                    this.LblAddProduct.Enabled = false;
                }
                if (!flag3)
                {
                    this.ELnkContentList.Enabled = false;
                }
            }
            if ((nodeId > 0) && ((flag2 || flag3) || isSuperAdmin))
            {
                DataTable shopModelListByNodeId = ModelManager.GetShopModelListByNodeId(nodeId, true);
                if (shopModelListByNodeId.Rows.Count <= 1)
                {
                    this.LblAddProduct.Visible = false;
                }
                else
                {
                    this.RptModelList.DataSource = shopModelListByNodeId;
                    this.RptModelList.DataBind();
                }
                if (shopModelListByNodeId.Rows.Count == 1)
                {
                    this.HlkModel.Visible = true;
                    string str5 = "";
                    str5 = string.Concat(new object[] { "~/Admin/Shop/", shopModelListByNodeId.Rows[0]["AddInfoFilePath"].ToString(), "?Action=add&modelId=", shopModelListByNodeId.Rows[0]["ModelId"].ToString(), "&NodeID=", BaseUserControl.RequestInt32("NodeID") });
                    this.HlkModel.NavigateUrl = str5;
                    this.HlkModel.Text = "添加" + shopModelListByNodeId.Rows[0]["ItemName"].ToString();
                }
                if (!this.LblAddProduct.Visible && !this.HlkModel.Visible)
                {
                    this.LitSeparator.Visible = false;
                }
            }
            else
            {
                this.LblAddProduct.Visible = false;
                this.HlkModel.Visible = false;
                this.LitSeparator.Visible = false;
            }
        }
    }
}

⌨️ 快捷键说明

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