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

📄 specialmanage.aspx.cs

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

    public class SpecialManage : AdminPage
    {
        protected DropDownList DropRescentQuery;
        protected ExtendedGridView EgvSpecial;
        protected HiddenField HdnListType;
        protected Label LblOrderType;
        protected ObjectDataSource OdsSpecial;
        protected ExtendedSiteMapPath SmpNavigator;

        private void ClearSpecialInfos()
        {
            if (Special.DeleteSpecialInfoBySpecialId(BasePage.RequestInt32("SpecialID")))
            {
                AdminPage.WriteSuccessMsg("已经成功清空该专题的所有内容!", "SpecialManage.aspx");
            }
            else
            {
                AdminPage.WriteErrMsg("清空该专题的所有内容失败!", "SpecialManage.aspx");
            }
        }

        private void DeleteSpecial()
        {
            if (Special.DeleteSpecialById(BasePage.RequestInt32("SpecialID")))
            {
                IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                AdminPage.WriteSuccessMsg("<li>专题删除成功!</li>", "SpecialManage.aspx");
            }
            else
            {
                AdminPage.WriteErrMsg("<li>专题删除失败!</li>");
            }
        }

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

        protected void EgvSpecial_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if ((e.Row.RowType == DataControlRowType.DataRow) && (BasePage.RequestInt32("SpecialCategoryID") == 0))
            {
                SpecialInfo dataItem = new SpecialInfo();
                dataItem = (SpecialInfo) e.Row.DataItem;
                int specialCategoryId = dataItem.SpecialCategoryId;
                SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialCategoryId);
                Label label = e.Row.FindControl("LblSpecialCategoryLink") as Label;
                label.Text = "<strong>[<a href=\"SpecialManage.aspx?SpecialCategoryID=" + specialCategoryId.ToString() + "\">" + specialCategoryInfoById.SpecialCategoryName + "</a>]</strong>";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            RolePermissions.BusinessAccessCheck(OperateCode.SpecialManage);
            if (!this.Page.IsPostBack)
            {
                switch (BasePage.RequestStringToLower("Action", ""))
                {
                    case "clear":
                        this.ClearSpecialInfos();
                        break;

                    case "delete":
                        this.DeleteSpecial();
                        break;
                }
                this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
                this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
                if (BasePage.RequestInt32("SpecialCategoryID") > 0)
                {
                    this.LblOrderType.Visible = false;
                    this.DropRescentQuery.Visible = false;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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