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

📄 specialcategory.cs

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

    public class SpecialCategory : AdminPage
    {
        protected AlternateLiteral AltrTitle;
        protected Button EBtnSubmit;
        protected TemplateSelectControl FileCSearchTemplatePath;
        protected TemplateSelectControl FileCSpecialTemplatePath;
        protected HiddenField HdnAction;
        protected HiddenField HdnOrderId;
        protected HiddenField HdnSpecialCategoryName;
        protected ComboBox PagePostfix;
        protected RadioButtonList RadlCreatHtml;
        protected RadioButtonList RadOpenType;
        protected RegularExpressionValidator RegularExpressionValidator1;
        protected PowerEasy.Controls.RequiredFieldValidator RequiredFieldValidator1;
        protected ExtendedSiteMapPath SmpNavigator;
        protected TextBox TxtDescription;
        protected TextBox TxtSpecialCategoryDir;
        protected TextBox TxtSpecialCategoryName;
        protected PowerEasy.Controls.RequiredFieldValidator ValrSpecialCategoryName;

        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                bool flag = true;
                SpecialCategoryInfo specialCategoryInfo = new SpecialCategoryInfo();
                if (this.HdnAction.Value == "Modify")
                {
                    specialCategoryInfo.SpecialCategoryId = BasePage.RequestInt32("SpecialCategoryID");
                    specialCategoryInfo.OrderId = DataConverter.CLng(this.HdnOrderId.Value);
                }
                specialCategoryInfo.SpecialCategoryName = this.TxtSpecialCategoryName.Text;
                specialCategoryInfo.SpecialCategoryDir = this.TxtSpecialCategoryDir.Text;
                specialCategoryInfo.SpecialTemplatePath = this.FileCSpecialTemplatePath.Text;
                specialCategoryInfo.SearchTemplatePath = this.FileCSearchTemplatePath.Text;
                specialCategoryInfo.OpenType = DataConverter.CBool(this.RadOpenType.SelectedValue);
                specialCategoryInfo.Description = this.TxtDescription.Text;
                specialCategoryInfo.PagePostfix = this.PagePostfix.Value;
                specialCategoryInfo.IsCreateHtml = DataConverter.CBool(this.RadlCreatHtml.SelectedValue);
                string text = this.TxtSpecialCategoryName.Text;
                if (((this.HdnAction.Value == "Modify") && (text != this.HdnSpecialCategoryName.Value)) && Special.ExistsSpecialCategoryName(text))
                {
                    AdminPage.WriteErrMsg("<li>系统已经有此专题类别名称,请返回重新填写专题类别名称!</li>");
                }
                if (this.HdnAction.Value == "Modify")
                {
                    flag = Special.UpdateSpecialCategory(specialCategoryInfo);
                }
                else
                {
                    flag = Special.AddSpecialCategory(specialCategoryInfo);
                }
                if (flag)
                {
                    IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                    base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                    AdminPage.WriteSuccessMsg("<li>专题类别信息保存成功!</li>", "SpecialCategoryManage.aspx");
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>专题类别信息保存失败!</li>", "SpecialCategoryManage.aspx");
                }
            }
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            RolePermissions.BusinessAccessCheck(OperateCode.SpecialManage);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                string str = BasePage.RequestString("Action", "Add");
                if (str == "Modify")
                {
                    SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(BasePage.RequestInt32("SpecialCategoryID"));
                    if (!specialCategoryInfoById.IsNull)
                    {
                        this.TxtSpecialCategoryName.Text = specialCategoryInfoById.SpecialCategoryName;
                        this.TxtSpecialCategoryDir.Enabled = false;
                        this.TxtSpecialCategoryDir.Text = specialCategoryInfoById.SpecialCategoryDir;
                        this.FileCSpecialTemplatePath.Text = specialCategoryInfoById.SpecialTemplatePath;
                        this.FileCSearchTemplatePath.Text = specialCategoryInfoById.SearchTemplatePath;
                        this.TxtDescription.Text = specialCategoryInfoById.Description;
                        this.PagePostfix.Value = specialCategoryInfoById.PagePostfix;
                        BasePage.SetSelectedIndexByValue(this.RadlCreatHtml, specialCategoryInfoById.IsCreateHtml.ToString());
                        BasePage.SetSelectedIndexByValue(this.RadOpenType, specialCategoryInfoById.OpenType.ToString());
                        this.HdnAction.Value = str;
                        this.HdnSpecialCategoryName.Value = specialCategoryInfoById.SpecialCategoryName;
                        this.HdnOrderId.Value = specialCategoryInfoById.OrderId.ToString();
                    }
                }
            }
        }
    }
}

⌨️ 快捷键说明

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