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

📄 authormanage.cs

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

    public class AuthorManage : AdminPage
    {
        protected Button EBtnAdd;
        protected ExtendedButton EBtnBatchDelete;
        protected ExtendedGridView GdvAuthorList;
        protected ObjectDataSource OdsAuthor2;
        protected ExtendedSiteMapPath SmpNavigator;

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

        protected void EBtnBatchDelete_Click(object sender, EventArgs e)
        {
            string str = this.GdvAuthorList.SelectList.ToString();
            if (string.IsNullOrEmpty(str))
            {
                AdminPage.WriteErrMsg("<li>对不起,您还没选择要删除的作者!</li>");
            }
            else if (Author.Delete(str))
            {
                this.GdvAuthorList.DataBind();
            }
            else
            {
                AdminPage.WriteErrMsg("删除失败!");
            }
        }

        protected void GdvAuthorList_RowCommand(object sender, CommandEventArgs e)
        {
            bool flag = false;
            string commandName = e.CommandName;
            if (commandName != null)
            {
                AuthorInfo authorInfoById;
                if (!(commandName == "Elite"))
                {
                    if (commandName == "OnTop")
                    {
                        authorInfoById = Author.GetAuthorInfoById(Convert.ToInt32(e.CommandArgument));
                        authorInfoById.OnTop = !authorInfoById.OnTop;
                        flag = Author.Update(authorInfoById);
                        goto Label_00E1;
                    }
                    if (commandName == "Passed")
                    {
                        authorInfoById = Author.GetAuthorInfoById(Convert.ToInt32(e.CommandArgument));
                        authorInfoById.Passed = !authorInfoById.Passed;
                        flag = Author.Update(authorInfoById);
                        goto Label_00E1;
                    }
                    if (commandName == "Deleted")
                    {
                        flag = Author.Delete(Convert.ToString(Convert.ToInt32(e.CommandArgument), (IFormatProvider) null));
                        goto Label_00E1;
                    }
                }
                else
                {
                    authorInfoById = Author.GetAuthorInfoById(Convert.ToInt32(e.CommandArgument));
                    authorInfoById.Elite = !authorInfoById.Elite;
                    flag = Author.Update(authorInfoById);
                    goto Label_00E1;
                }
            }
            flag = false;
        Label_00E1:
            if (flag)
            {
                this.GdvAuthorList.DataBind();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }
}

⌨️ 快捷键说明

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