Hidistro.UI.Web/Admin/zbGoods/ascx/SpecificationView.cs

(开头部分) 7KB

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

namespace Hidistro.UI.Web.Admin.zbGoods.ascx
{
    using ASPNET.WebControls;
    using Hidistro.ControlPanel.zbCommodities;
    using Hidistro.ControlPanel.Store;
    using Hidistro.Core;
    using Hidistro.Entities.Commodities;
    using Hidistro.UI.Common.Controls;
    using Hidistro.UI.ControlPanel.Utility;
    using Hishop.Components.Validation;
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class SpecificationView : UserControl
    {
        protected Button btnCreate;
        protected Grid grdSKU;
        protected UseAttributeImageRadioButtonList radIsImage;
        protected TextBox txtName;
        protected int typeId;

        private void BindAttribute()
        {
            this.grdSKU.DataSource = ProductTypeHelper.GetAttributes(this.typeId, AttributeUseageMode.Choose);
            this.grdSKU.DataBind();
        }

        private void btnCreate_Click(object sender, EventArgs e)
        {
            AttributeInfo target = new AttributeInfo {
                TypeId = this.typeId,
                AttributeName = Globals.HtmlEncode(this.txtName.Text).Replace(",", ","),
                UsageMode = AttributeUseageMode.Choose,
                UseAttributeImage = this.radIsImage.SelectedValue
            };
            ValidationResults results = Hishop.Components.Validation.Validation.Validate<AttributeInfo>(target, new string[] { "ValAttribute" });
            string str = string.Empty;
            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable<ValidationResult>) results)
                {
                    str = str + Formatter.FormatErrorMessage(result.Message);
                }
            }
            else
            {
                ProductTypeHelper.GetAttributes(this.typeId, AttributeUseageMode.Choose);
                if (ProductTypeHelper.AddAttributeName(target))
                {
                    base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
                }
            }
        }

        private void grdSKU_RowCommand(object sender, GridViewCommandEventArgs e)
        {
后面还有 96 行代码,购买后查看完整代码

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

AI 解读 AI

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

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