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

📄 productview.aspx.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 3 页
字号:
namespace PowerEasy.WebSite.Admin.Shop
{
    using PowerEasy.AccessManage;
    using PowerEasy.Common;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Enumerations;
    using PowerEasy.ExtendedControls;
    using PowerEasy.Model.CommonModel;
    using PowerEasy.Model.Contents;
    using PowerEasy.Model.Shop;
    using PowerEasy.Model.UserManage;
    using PowerEasy.ModelControls;
    using PowerEasy.Shop;
    using PowerEasy.UserManage;
    using PowerEasy.Web.UI;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class ProductView : AdminPage
    {
        protected HtmlGenericControl DivNode;
        protected HtmlGenericControl DivSpecial;
        protected ExtendedNodeButton EBtnDelete;
        protected ExtendedNodeButton EBtnModify;
        protected ExtendedGridView EgvChildProducts;
        protected Image ImgProductThumb;
        protected Label LblAlarmNum;
        protected Label LblBarCode;
        protected Label LblBuyTimes;
        protected Label LblDayHits;
        protected Label LblDownloadUrl;
        protected Label LblEliteLevel;
        protected Label LblEnableBuyWhenOutofstock;
        protected Label LblEnableSale;
        protected Label LblEnableSingleSell;
        protected Label LblGetNextInfo;
        protected Label LblGetPrevInfo;
        protected Label LblHits;
        protected Label LblKeyword;
        protected Label LblLimitNum;
        protected Label LblMonthHits;
        protected Label LblNodeNavigation;
        protected Label LblNumberWholesale1;
        protected Label LblNumberWholesale2;
        protected Label LblNumberWholesale3;
        protected Label LblPresentExp;
        protected Label LblPresentMoney;
        protected Label LblPresentPoint;
        protected Label LblPrice;
        protected Label LblPrice_Agent;
        protected Label LblPrice_Market;
        protected Label LblPrice_Member;
        protected Label LblPriceWholesale1;
        protected Label LblPriceWholesale2;
        protected Label LblPriceWholesale3;
        protected Label LblPriority;
        protected Label LblProducerName;
        protected Label LblProductCharacter;
        protected Label LblProductExplain;
        protected Label LblProductIntro;
        protected Label LblProductName;
        protected Label LblProductNum;
        protected Label LblProductType;
        protected Label LblPropertySetting;
        protected Label LblRemark;
        protected Label LblSalePromotionType;
        protected Label LblServiceTerm;
        protected Label LblServiceTermUnit;
        protected Label LblStars;
        protected Label LblStocks;
        protected Label LblStocksProject;
        protected Label LblTaxRate;
        protected Label LblTaxRateType;
        protected Label LblTemplate;
        protected Label LblTrademarkName;
        protected Label LblUnit;
        protected Label LblUpdateTime;
        protected Label LblWeekHits;
        protected Label LblWeight;
        protected Label LblWholesale;
        private int m_GeneralId;
        private IList<ProductDataInfo> m_ProductDataInfoList;
        private ProductInfo m_ProductInfo;
        protected PlaceHolder PlhDownloadUrl;
        protected Panel PnlAgent;
        protected Panel PnlMember;
        protected Panel PnlWholesale;
        protected Repeater RptAgentGroupPrice;
        protected Repeater RptGroupPrice;
        protected Repeater RptProduct;
        protected ShowPointName ShowPointName1;
        protected ScriptManager SmgeProperties;
        protected ExtendedSiteMapPath SmpNavigator;

        private void AddTemplateField(string controlId, string headerText, bool visible)
        {
            GridViewTemplateField field = new GridViewTemplateField();
            field.HeaderText = headerText;
            field.Visible = visible;
            field.HeaderStyle.Width = Unit.Pixel(150);
            field.ItemStyle.Width = Unit.Pixel(150);
            field.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
            field.ItemTemplate = new GridViewTemplate(controlId, "Label");
            this.EgvChildProducts.Columns.Add(field);
        }

        protected void EBtnDelete_Click(object sender, EventArgs e)
        {
            RolePermissions.BusinessAccessCheck(OperateCode.NodeContentManage, DataConverter.CLng(this.ContentDataTable.Rows[0]["NodeId"]));
            if (ContentManage.UpdateStatus(this.m_GeneralId, -3))
            {
                AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ProductManage.aspx?NodeID=" + this.ContentDataTable.Rows[0]["NodeId"].ToString());
            }
            else
            {
                AdminPage.WriteErrMsg("<li>删除失败!</li>");
            }
        }

        protected void EBtnModify_Click(object sender, EventArgs e)
        {
            RolePermissions.BusinessAccessCheck(OperateCode.NodeContentManage, DataConverter.CLng(this.ContentDataTable.Rows[0]["NodeId"]));
            StringBuilder builder = new StringBuilder();
            if (ModelManager.GetModelInfoById(DataConverter.CLng(this.ContentDataTable.Rows[0]["ModelID"].ToString())).IsEshop)
            {
                builder.Append("../shop/Product.aspx");
            }
            else
            {
                builder.Append("Content.aspx");
            }
            builder.Append("?Action=Modify&NodeID=");
            builder.Append(this.ContentDataTable.Rows[0]["NodeId"].ToString());
            builder.Append("&GeneralID=");
            builder.Append(this.m_GeneralId.ToString());
            builder.Append("&ModelID=");
            builder.Append(this.ContentDataTable.Rows[0]["ModelID"].ToString());
            builder.Append("&LinkType=");
            builder.Append(this.ContentDataTable.Rows[0]["LinkType"].ToString());
            BasePage.ResponseRedirect(builder.ToString());
        }

        protected void EgdvChildProducts_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ProductDataInfo dataItem = e.Row.DataItem as ProductDataInfo;
                Label label = (Label) e.Row.FindControl("LblProperty");
                label.Text = dataItem.PropertyValue;
                if ((this.m_ProductInfo != null) && !this.Page.IsPostBack)
                {
                    Label label2 = (Label) e.Row.FindControl("LblChildStocks");
                    label2.Text = dataItem.Stocks.ToString();
                    Label label3 = (Label) e.Row.FindControl("LblChildAlarmNum");
                    label3.Text = dataItem.AlarmNum.ToString();
                    Label label4 = (Label) e.Row.FindControl("LblChildPrice");
                    label4.Text = dataItem.PriceInfo.Price.ToString("0.00");
                    Label label5 = (Label) e.Row.FindControl("LblUserPrice");
                    label5.Text = dataItem.PriceInfo.PriceMember.ToString("0.00");
                    Label label6 = (Label) e.Row.FindControl("LblAgentPrice");
                    label6.Text = dataItem.PriceInfo.PriceAgent.ToString("0.00");
                    Label label7 = (Label) e.Row.FindControl("LblNumber_Wholesale1");
                    label7.Text = dataItem.PriceInfo.NumberWholesale1.ToString();
                    Label label8 = (Label) e.Row.FindControl("LblNumber_Wholesale2");
                    label8.Text = dataItem.PriceInfo.NumberWholesale2.ToString();
                    Label label9 = (Label) e.Row.FindControl("LblNumber_Wholesale3");
                    label9.Text = dataItem.PriceInfo.NumberWholesale3.ToString();
                    Label label10 = (Label) e.Row.FindControl("LblPrice_Wholesale1");
                    label10.Text = dataItem.PriceInfo.PriceWholesale1.ToString("0.00");
                    Label label11 = (Label) e.Row.FindControl("LblPrice_Wholesale2");
                    label11.Text = dataItem.PriceInfo.PriceWholesale2.ToString("0.00");
                    Label label12 = (Label) e.Row.FindControl("LblPrice_Wholesale3");
                    label12.Text = dataItem.PriceInfo.PriceWholesale3.ToString("0.00");
                    IList<ProductPriceInfo> productPriceInfoList = new List<ProductPriceInfo>();
                    if ((this.m_ProductInfo.PriceInfo.PriceMember == -1M) || (this.m_ProductInfo.PriceInfo.PriceAgent == -1M))
                    {
                        productPriceInfoList = ProductPrice.GetProductPrice(this.m_ProductInfo.ProductId, this.m_ProductInfo.TableName, dataItem.PropertyValue);
                    }
                    if (this.m_ProductInfo.PriceInfo.PriceMember == -1M)
                    {
                        foreach (UserGroupsInfo info2 in UserGroups.GetGroupTable(GroupType.Register))
                        {
                            Label label13 = (Label) e.Row.FindControl("LblGroupPrice" + info2.GroupId);
                            if (label13 != null)
                            {
                                label13.Text = this.GetChildGroupPrice(info2.GroupId, productPriceInfoList).ToString("0.00");
                            }
                        }
                    }
                    if (this.m_ProductInfo.PriceInfo.PriceAgent == -1M)
                    {
                        foreach (UserGroupsInfo info3 in UserGroups.GetGroupTable(GroupType.Agent))
                        {
                            Label label14 = (Label) e.Row.FindControl("LblAgentGroupPrice" + info3.GroupId);
                            if (label14 != null)
                            {
                                label14.Text = this.GetChildGroupPrice(info3.GroupId, productPriceInfoList).ToString("0.00");
                            }
                        }
                    }
                }
            }
        }

        private void EgdvChildProductsDataBind()
        {
            if (this.m_ProductDataInfoList != null)
            {
                this.EgvChildProducts.DataSource = this.m_ProductDataInfoList;
                this.EgvChildProducts.DataBind();
                this.EgvChildProducts.Visible = true;
            }
            else
            {
                this.EgvChildProducts.Visible = false;
            }
        }

        private string GetBoolString(bool value)
        {
            string str = "否";
            if (value)
            {
                str = "是";
            }
            return str;
        }

        private string GetCharacter(int characterValue)
        {
            StringBuilder builder = new StringBuilder();
            if (Product.CharacterIsExists((ProductCharacter) characterValue, ProductCharacter.Practicality))
            {
                builder.Append("实物");
                builder.Append("&nbsp;&nbsp;");
            }
            if (Product.CharacterIsExists((ProductCharacter) characterValue, ProductCharacter.Service))
            {
                builder.Append("服务");
                builder.Append("&nbsp;&nbsp;");

⌨️ 快捷键说明

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