Ejemplo n.º 1
0
        public void Delete(HttpContext context)
        {
            string text = context.Request.Form["productids"];

            if (string.IsNullOrEmpty(text))
            {
                throw new HidistroAshxException("请先选择要下架的商品");
            }
            int[] values = (from d in text.Split(',')
                            select int.Parse(d)).ToArray();
            int storeId = HiContext.Current.Manager.StoreId;

            if (StoresHelper.DeleteProduct(storeId, string.Join("','", values)))
            {
                base.ReturnResult(context, true, "成功移出了选择的商品", 0, true);
            }
            else
            {
                base.ReturnResult(context, false, "移出商品失败,未知错误", -1, true);
            }
        }