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

📄 clientmanage.cs

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

    public class ClientManage : AdminPage
    {
        protected ExtendedButton BtnDelete;
        protected ExtendedGridView EgvClient;
        protected bool m_ClientModifyOwn = RolePermissions.AccessCheck(OperateCode.ClientModifyOwn);
        protected ObjectDataSource OdsClient;
        protected ExtendedSiteMapPath SmpNavigator;

        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = this.EgvClient.SelectList;
            if (selectList.Length == 0)
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要删除的客户!</li>");
            }
            else
            {
                BasePage.ResponseRedirect("ClientDelete.aspx?ClientID=" + selectList.ToString());
            }
        }

        protected void EgvClient_RowCommand(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Del")
            {
                BasePage.ResponseRedirect("ClientDelete.aspx?ClientID=" + e.CommandArgument.ToString());
            }
        }

        protected void EgvClient_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            ClientInfo dataItem = new ClientInfo();
            dataItem = (ClientInfo) e.Row.DataItem;
            if (((e.Row.RowType == DataControlRowType.DataRow) && this.m_ClientModifyOwn) && (dataItem.Owner == PEContext.Current.Admin.AdminName))
            {
                ((ExtendedAnchor) e.Row.FindControl("ModifyOwn")).Disabled = false;
            }
        }

        protected string GetClientGroupName(int groupId)
        {
            return Client.GetClientGroupName(groupId);
        }

        protected string GetClientTypeName(int clientType)
        {
            return Client.GetClientTypeName(clientType);
        }

        private void GetNavigationText(int searchType, string keyword, int quickSearch, int groupId)
        {
            switch (searchType)
            {
                case 1:
                    if (!string.IsNullOrEmpty(keyword) && !(keyword == "0"))
                    {
                        this.SmpNavigator.AdditionalNode = "客户ID为“" + keyword + "”的数据";
                        return;
                    }
                    this.SmpNavigator.AdditionalNode = "所有客户";
                    return;

                case 2:
                    if (!string.IsNullOrEmpty(keyword))
                    {
                        this.SmpNavigator.AdditionalNode = "客户名称中含有“" + keyword + "”的数据";
                        return;
                    }
                    this.SmpNavigator.AdditionalNode = "所有客户";
                    return;
            }
            if (groupId >= 0)
            {
                this.SmpNavigator.AdditionalNode = Client.GetClientGroupName(groupId);
            }
            else if (quickSearch > 0)
            {
                if (quickSearch == 3)
                {
                    this.SmpNavigator.AdditionalNode = "我添加的客户";
                }
                else
                {
                    this.SmpNavigator.AdditionalNode = Client.GetClientTypeName(quickSearch - 1);
                }
            }
            else
            {
                this.SmpNavigator.AdditionalNode = "所有客户";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            int searchType = BasePage.RequestInt32("SearchType");
            string keyword = BasePage.RequestString("Keyword");
            int quickSearch = BasePage.RequestInt32("QuickSearch");
            int groupId = BasePage.RequestInt32("GroupID", -1);
            this.GetNavigationText(searchType, keyword, quickSearch, groupId);
        }
    }
}

⌨️ 快捷键说明

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