コード例 #1
0
 private void dlstProducts_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
 {
     if (e.CommandName == "check")
     {
         int num = int.Parse(this.dlstProducts.DataKeys[e.Item.ItemIndex].ToString(), System.Globalization.NumberStyles.None);
         if (this.productId != num)
         {
             ProductHelper.AddRelatedProduct(this.productId, num);
         }
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
コード例 #2
0
 private void dlstProducts_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "check")
     {
         int relatedProductId = int.Parse(this.dlstProducts.DataKeys[e.Item.ItemIndex].ToString(), NumberStyles.None);
         if (this.productId != relatedProductId)
         {
             ProductHelper.AddRelatedProduct(this.productId, relatedProductId);
         }
         base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
     }
 }
コード例 #3
0
        private void Add(HttpContext context)
        {
            int value = base.GetIntParam(context, "relatedId", false).Value;

            if (this.productId <= 0 || this.productId == value)
            {
                throw new HidistroAshxException("错误的数据编号");
            }
            if (value <= 0)
            {
                throw new HidistroAshxException("错误的数据编号");
            }
            ProductHelper.AddRelatedProduct(this.productId, value);
            base.ReturnSuccessResult(context, "操作成功!", 0, true);
        }
コード例 #4
0
        private void btnAddSearch_Click(object sender, EventArgs e)
        {
            ProductQuery query = new ProductQuery();

            query.Keywords   = this.keywords;
            query.CategoryId = this.categoryId;
            query.SaleStatus = ProductSaleStatus.OnSale;
            foreach (int num in ProductHelper.GetProductIds(query))
            {
                if (this.productId != num)
                {
                    ProductHelper.AddRelatedProduct(this.productId, num);
                }
            }
            base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
        }
コード例 #5
0
 private void btnAddSearch_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <int> productIds = ProductHelper.GetProductIds(new ProductQuery
     {
         Keywords   = this.keywords,
         CategoryId = this.categoryId,
         SaleStatus = ProductSaleStatus.OnSale
     });
     foreach (int current in productIds)
     {
         if (this.productId != current)
         {
             ProductHelper.AddRelatedProduct(this.productId, current);
         }
     }
     base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
 }
コード例 #6
0
        private void AddSearch(HttpContext context)
        {
            if (this.productId <= 0)
            {
                throw new HidistroAshxException("错误的数据编号");
            }
            ProductQuery productQuery = this.GetProductQuery(context);
            IList <int>  productIds   = ProductHelper.GetProductIds(productQuery);

            foreach (int item in productIds)
            {
                if (this.productId != item)
                {
                    ProductHelper.AddRelatedProduct(this.productId, item);
                }
            }
            base.ReturnSuccessResult(context, "操作成功!", 0, true);
        }