示例#1
0
        private void btnMove_Click(object sender, EventArgs e)
        {
            int    newCategoryId = dropMoveToCategories.SelectedValue.HasValue ? dropMoveToCategories.SelectedValue.Value : 0;
            string str           = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                ShowMsg("请选择要转移的商品", false);
            }
            else
            {
                string[] strArray;
                if (!str.Contains(","))
                {
                    strArray = new string[] { str };
                }
                else
                {
                    strArray = str.Split(new char[] { ',' });
                }
                foreach (string str2 in strArray)
                {
                    SubSiteProducthelper.UpdateProductCategory(Convert.ToInt32(str2), newCategoryId);
                }
                dropCategories.SelectedValue = new int?(newCategoryId);
                BindProducts();
                ShowMsg("转移商品类型成功", true);
            }
        }
        private void btnMove_Click(object sender, System.EventArgs e)
        {
            int    num  = this.dropMoveToCategories.SelectedValue.HasValue ? this.dropMoveToCategories.SelectedValue.Value : 0;
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请选择要转移的商品", false);
                return;
            }
            string[] array;
            if (!text.Contains(","))
            {
                array = new string[]
                {
                    text
                };
            }
            else
            {
                array = text.Split(new char[]
                {
                    ','
                });
            }
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string value = array2[i];
                SubSiteProducthelper.UpdateProductCategory(System.Convert.ToInt32(value), num);
            }
            this.dropCategories.SelectedValue = new int?(num);
            this.BindProducts();
            this.ShowMsg("转移商品类型成功", true);
        }