protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadAttributeClass", PowerCheckType.Single);
         base.BindControl(AttributeClassBLL.ReadAttributeClassCacheList(), this.RecordList);
     }
 }
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            base.CheckAdminPower("DeleteAttributeClass", PowerCheckType.Single);
            string intsForm = RequestHelper.GetIntsForm("SelectID");

            if (intsForm != string.Empty)
            {
                AttributeClassBLL.DeleteAttributeClass(intsForm);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("AttributeClass"), intsForm);
                ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         int queryString = RequestHelper.GetQueryString <int>("ID");
         if (queryString != -2147483648)
         {
             base.CheckAdminPower("ReadAttributeClass", PowerCheckType.Single);
             AttributeClassInfo info = AttributeClassBLL.ReadAttributeClassCache(queryString);
             this.Name.Text = info.Name;
         }
     }
 }
Exemple #4
0
        protected void BindClassBrandAttributeClassStandardType()
        {
            List <ProductBrandInfo> list = ProductBrandBLL.ReadProductBrandCacheList();

            this.BrandID.DataSource     = list;
            this.BrandID.DataTextField  = "Name";
            this.BrandID.DataValueField = "ID";
            this.BrandID.DataBind();
            this.BrandID.Items.Insert(0, new ListItem("选择品牌", "0"));
            this.RelationBrandID.DataSource     = list;
            this.RelationBrandID.DataTextField  = "Name";
            this.RelationBrandID.DataValueField = "ID";
            this.RelationBrandID.DataBind();
            this.RelationBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));
            this.AccessoryBrandID.DataSource     = list;
            this.AccessoryBrandID.DataTextField  = "Name";
            this.AccessoryBrandID.DataValueField = "ID";
            this.AccessoryBrandID.DataBind();
            this.AccessoryBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));
            List <ProductClassInfo> list2 = ProductClassBLL.ReadProductClassNamedList();

            foreach (ProductClassInfo info in list2)
            {
                this.RelationClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
            }
            this.RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
            foreach (ProductClassInfo info in list2)
            {
                this.AccessoryClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
            }
            this.AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
            this.AttributeClassID.DataSource     = AttributeClassBLL.ReadAttributeClassCacheList();
            this.AttributeClassID.DataTextField  = "Name";
            this.AttributeClassID.DataValueField = "ID";
            this.AttributeClassID.DataBind();
            this.AttributeClassID.Items.Insert(0, new ListItem("请选择", "0"));
            foreach (ArticleClassInfo info2 in ArticleClassBLL.ReadArticleClassChildList(3))
            {
                this.ArticleClassID.Items.Add(new ListItem(info2.ClassName, "|" + info2.ID + "|"));
            }
            this.ArticleClassID.Items.Insert(0, new ListItem(ArticleClassBLL.ReadArticleClassCache(3).ClassName, "|" + 3 + "|"));
            this.StandardType.DataSource     = EnumHelper.ReadEnumList <ProductStandardType>();
            this.StandardType.DataTextField  = "ChineseName";
            this.StandardType.DataValueField = "Value";
            this.StandardType.DataBind();
        }
Exemple #5
0
        protected void BindClassBrandAttributeClassStandardType()
        {
            //List<ProductBrandInfo> list = ProductBrandBLL.ReadProductBrandCacheList();
            //this.RelationBrandID.DataSource = list;
            //this.RelationBrandID.DataTextField = "Name";
            //this.RelationBrandID.DataValueField = "ID";
            //this.RelationBrandID.DataBind();
            //this.RelationBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty));

            List <ProductClassInfo> list2 = ProductClassBLL.ReadProductClassNamedList();

            foreach (ProductClassInfo info in list2)
            {
                this.RelationClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|"));
            }
            this.RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            CourseCateInfo CourseCateModel = new CourseCateInfo();

            CourseCateModel.Condition = CompanyBLL.SystemCompanyId.ToString();
            List <CourseCateInfo> courseCateList = CourseCateBLL.ReadCourseCateNamedList(CourseCateModel);

            foreach (CourseCateInfo info in courseCateList)
            {
                this.AccessoryClassID.Items.Add(new ListItem(info.CateName, info.CateId.ToString()));
            }
            this.AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            this.AttributeClassID.DataSource     = AttributeClassBLL.ReadAttributeClassCacheList();
            this.AttributeClassID.DataTextField  = "Name";
            this.AttributeClassID.DataValueField = "ID";
            this.AttributeClassID.DataBind();
            this.AttributeClassID.Items.Insert(0, new ListItem("请选择", "0"));
            foreach (ArticleClassInfo info2 in ArticleClassBLL.ReadArticleClassChildList(3))
            {
                this.ArticleClassID.Items.Add(new ListItem(info2.ClassName, "|" + info2.ID + "|"));
            }
            this.ArticleClassID.Items.Insert(0, new ListItem(ArticleClassBLL.ReadArticleClassCache(3).ClassName, "|" + 3 + "|"));
            this.StandardType.DataSource     = EnumHelper.ReadEnumList <ProductStandardType>();
            this.StandardType.DataTextField  = "ChineseName";
            this.StandardType.DataValueField = "Value";
            this.StandardType.DataBind();
        }
Exemple #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadAttribute", PowerCheckType.Single);
         this.AttributeClass.DataSource     = AttributeClassBLL.ReadAttributeClassCacheList();
         this.AttributeClass.DataTextField  = "Name";
         this.AttributeClass.DataValueField = "ID";
         this.AttributeClass.DataBind();
         this.InputType.DataSource     = EnumHelper.ReadEnumList <InputType>();
         this.InputType.DataTextField  = "ChineseName";
         this.InputType.DataValueField = "Value";
         this.InputType.DataBind();
         this.InputType.Items[0].Selected = true;
         string queryString = RequestHelper.GetQueryString <string>("Action");
         int    id          = RequestHelper.GetQueryString <int>("ID");
         if ((queryString != string.Empty) && (id > 0))
         {
             if (queryString == "Up")
             {
                 AttributeBLL.ChangeAttributeOrder(ChangeAction.Up, id);
             }
             else
             {
                 AttributeBLL.ChangeAttributeOrder(ChangeAction.Down, id);
             }
         }
         if (id != -2147483648)
         {
             AttributeInfo info = AttributeBLL.ReadAttributeCache(id);
             this.Name.Text       = info.Name;
             this.InputType.Text  = info.InputType.ToString();
             this.InputValue.Text = info.InputValue;
         }
         this.attributeClassIDAspx         = RequestHelper.GetQueryString <int>("AttributeClassID");
         this.AttributeClass.SelectedValue = this.attributeClassIDAspx.ToString();
         base.BindControl(AttributeBLL.ReadAttributeListByClassID(this.attributeClassIDAspx), this.RecordList);
     }
 }
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            AttributeClassInfo attributeClass = new AttributeClassInfo();

            attributeClass.ID             = RequestHelper.GetQueryString <int>("ID");
            attributeClass.Name           = this.Name.Text;
            attributeClass.AttributeCount = 0;
            string alertMessage = ShopLanguage.ReadLanguage("AddOK");

            if (attributeClass.ID == -2147483648)
            {
                base.CheckAdminPower("AddAttributeClass", PowerCheckType.Single);
                int id = AttributeClassBLL.AddAttributeClass(attributeClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("AttributeClass"), id);
            }
            else
            {
                base.CheckAdminPower("UpdateAttributeClass", PowerCheckType.Single);
                AttributeClassBLL.UpdateAttributeClass(attributeClass);
                AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("AttributeClass"), attributeClass.ID);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl);
        }