Esempio n. 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string str = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请选择一件商品!", false);
            }
            else
            {
                string[] strArray = str.Split(new char[] { ',' });
                int      num      = 0;
                foreach (string str2 in strArray)
                {
                    if (VShopHelper.AddHomeProdcut(Convert.ToInt32(str2)))
                    {
                        num++;
                    }
                }
                if (num > 0)
                {
                    this.CloseWindow();
                }
                else
                {
                    this.ShowMsg("添加首页商品失败!", false);
                }
            }
        }
Esempio n. 2
0
        private void AddProduct(HttpContext context)
        {
            string text = context.Request["ids"];
            int    num  = 0;

            string[] array = text.Split(',');
            foreach (string text2 in array)
            {
                if (!string.IsNullOrEmpty(text2))
                {
                    HomeProductInfo info = new HomeProductInfo
                    {
                        ProductId = text2.ToInt(0)
                    };
                    if (VShopHelper.AddHomeProdcut(info))
                    {
                        num++;
                    }
                }
            }
            if (num > 0)
            {
                base.ReturnSuccessResult(context, "添加成功!", 0, true);
                return;
            }
            throw new HidistroAshxException("选择首页商品失败!");
        }
Esempio n. 3
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请选择一件商品!", false);
                return;
            }
            string[] array = text.Split(new char[]
            {
                ','
            });
            int num = 0;

            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string value = array2[i];
                if (VShopHelper.AddHomeProdcut(System.Convert.ToInt32(value), ClientType.App, CheckSupplierRole()))
                {
                    num++;
                }
            }
            if (num > 0)
            {
                this.CloseWindow();
                return;
            }
            this.ShowMsg("添加首页商品失败!", false);
        }
Esempio n. 4
0
        private void AddProduct(HttpContext context)
        {
            string      text = context.Request["ids"];
            IList <int> list = new List <int>();

            if (text.Length < 0)
            {
                throw new HidistroAshxException("错误的参数!");
            }
            string[] array = text.Split(',');
            foreach (string text2 in array)
            {
                if (!string.IsNullOrEmpty(text2))
                {
                    list.Add(text2.ToInt(0));
                }
            }
            int num = 0;

            string[] array2 = text.Split(',');
            foreach (string obj in array2)
            {
                HomeProductInfo info = new HomeProductInfo
                {
                    ProductId = obj.ToInt(0)
                };
                if (VShopHelper.AddHomeProdcut(info))
                {
                    num++;
                }
            }
            if (num > 0)
            {
                base.ReturnSuccessResult(context, "AppProductSetting.aspx", 0, true);
                return;
            }
            throw new HidistroAshxException("选择首页商品失败!");
        }