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

📄 presentview.aspx.cs

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

    public class PresentView : AdminPage
    {
        protected Image ImgProductThumb;
        protected Label LblAlarmNum;
        protected Label LblDownRemark;
        protected Label LblDownUrl;
        protected Label LblMarkPrice;
        protected Label LblPresentExplain;
        protected Label LblPresentIntro;
        protected Label LblPresentName;
        protected Label LblPresentType;
        protected Label LblPrice;
        protected Label LblServiceNum;
        protected Label LblStocks;
        protected Label LblUnit;
        protected Label LblWeight;
        protected ScriptManager SmgeProperties;
        protected ExtendedSiteMapPath SmpNavigator;

        public string GetStocksProject(StocksProject stocksProject)
        {
            switch (stocksProject)
            {
                case StocksProject.ActualStock:
                    return "实际库存";

                case StocksProject.VirtualStock:
                    return "虚拟库存";
            }
            return "";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            int id = BasePage.RequestInt32("presentId");
            if (!this.Page.IsPostBack)
            {
                if (id == 0)
                {
                    AdminPage.WriteErrMsg("<li>没有找到对应ID的礼品信息!</li>");
                }
                else
                {
                    PresentInfo presentById = PowerEasy.Shop.Present.GetPresentById(id);
                    if (!presentById.IsNull)
                    {
                        this.LblPresentName.Text = presentById.PresentName;
                        this.LblServiceNum.Text = presentById.ServiceTerm.ToString() + BasePage.EnumToHtml<ServiceTermUnit>(presentById.ServiceTermUnit);
                        this.LblMarkPrice.Text = presentById.PriceMarket.ToString("c");
                        this.LblPrice.Text = presentById.Price.ToString("c");
                        this.LblWeight.Text = presentById.Weight.ToString();
                        this.LblDownUrl.Text = presentById.DownloadUrl;
                        this.LblDownRemark.Text = presentById.Remark;
                        this.LblStocks.Text = presentById.Stocks.ToString();
                        this.LblUnit.Text = presentById.Unit;
                        this.LblAlarmNum.Text = presentById.AlarmNum.ToString();
                        this.LblPresentType.Text = BasePage.EnumToHtml<ProductCharacter>(presentById.ProductCharacter);
                        this.LblPresentIntro.Text = presentById.PresentIntro;
                        this.LblPresentExplain.Text = presentById.PresentExplain;
                        if (!string.IsNullOrEmpty(presentById.PresentPic))
                        {
                            this.ImgProductThumb.ImageUrl = Utility.ConvertAbsolutePath(SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.UploadDir), presentById.PresentPic);
                        }
                        else if (!string.IsNullOrEmpty(presentById.PresentThumb))
                        {
                            this.ImgProductThumb.ImageUrl = Utility.ConvertAbsolutePath(SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.UploadDir), presentById.PresentThumb);
                        }
                    }
                }
            }
        }
    }
}

⌨️ 快捷键说明

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