Hidistro.UI.Web/Admin/Goods/EditSpecificationValues.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.UI.Web.Admin.Goods
{
    using ASPNET.WebControls;
    using Hidistro.ControlPanel.Commodities;
    using Hidistro.ControlPanel.Store;
    using Hidistro.Entities.Commodities;
    using Hidistro.UI.ControlPanel.Utility;
    using System;
    using System.Globalization;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class EditSpecificationValues : AdminPage
    {
        private int attributeId;
        protected HtmlInputHidden currentAttributeId;
        protected Grid grdAttributeValues;

        protected EditSpecificationValues() : base("m02", "spp07")
        {
        }

        private void BindData()
        {
            AttributeInfo attribute = ProductTypeHelper.GetAttribute(this.attributeId);
            this.grdAttributeValues.DataSource = attribute.AttributeValues;
            this.grdAttributeValues.DataBind();
        }

        private void grdAttributeValues_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int rowIndex = ((GridViewRow) ((Control) e.CommandSource).NamingContainer).RowIndex;
            int attributeValueId = (int) this.grdAttributeValues.DataKeys[rowIndex].Value;
            int displaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
            string imageUrl = e.CommandArgument.ToString();
            int replaceAttributeValueId = 0;
            int replaceDisplaySequence = 0;
            if (e.CommandName == "Fall")
            {
                if (rowIndex < (this.grdAttributeValues.Rows.Count - 1))
                {
                    replaceAttributeValueId = (int) this.grdAttributeValues.DataKeys[rowIndex + 1].Value;
                    replaceDisplaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
                }
            }
            else if ((e.CommandName == "Rise") && (rowIndex > 0))
            {
                replaceAttributeValueId = (int) this.grdAttributeValues.DataKeys[rowIndex - 1].Value;
                replaceDisplaySequence = int.Parse((this.grdAttributeValues.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text, NumberStyles.None);
            }
            if (e.CommandName == "dele")
            {
                if (ProductTypeHelper.DeleteAttributeValue(attributeValueId))
                {
                    StoreHelper.DeleteImage(imageUrl);
                }
                else
                {
                    this.ShowMsg("该规格下存在商品", false);
后面还有 24 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。