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

📄 ordereditorpart.cs

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

    public class OrderEditorPart : EditorPart
    {
        private DropDownList m_DropSearchType;

        public override bool ApplyChanges()
        {
            Orders webBrowsableObject = (Orders) base.WebPartToEdit.WebBrowsableObject;
            webBrowsableObject.SearchType = this.DropSearchType.SelectedValue;
            return true;
        }

        protected override void CreateChildControls()
        {
            this.Controls.Clear();
            this.m_DropSearchType = new DropDownList();
            this.m_DropSearchType.Items.Add(new ListItem("今天的新订单", "1"));
            this.m_DropSearchType.Items.Add(new ListItem("未确认的订单", "4"));
            this.m_DropSearchType.Items.Add(new ListItem("未送货的订单", "7"));
            this.m_DropSearchType.Items.Add(new ListItem("未开发票的订单", "9"));
            this.m_DropSearchType.Items.Add(new ListItem("我负责跟踪的订单", "18"));
            this.Controls.Add(this.m_DropSearchType);
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.Write("待处理的订单类型");
            this.m_DropSearchType.RenderControl(writer);
            writer.WriteBreak();
            writer.WriteBreak();
        }

        public void SetListControlsSelect(ListControl control, string value)
        {
            foreach (ListItem item in control.Items)
            {
                if (item.Value == value)
                {
                    item.Selected = true;
                    break;
                }
            }
        }

        public override void SyncChanges()
        {
            Orders webBrowsableObject = (Orders) base.WebPartToEdit.WebBrowsableObject;
            this.SetListControlsSelect(this.DropSearchType, webBrowsableObject.SearchType);
        }

        private DropDownList DropSearchType
        {
            get
            {
                this.EnsureChildControls();
                return this.m_DropSearchType;
            }
        }
    }
}

⌨️ 快捷键说明

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