コード例 #1
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)
         {
             SubSiteProducthelper.AddRelatedProduct(this.productId, relatedProductId);
         }
         base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
     }
 }
コード例 #2
0
 private void dlstProducts_ItemCommand(object sender, 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)
         {
             SubSiteProducthelper.AddRelatedProduct(this.productId, num);
         }
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
コード例 #3
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 SubSiteProducthelper.GetProductIds(query))
            {
                if (this.productId != num)
                {
                    SubSiteProducthelper.AddRelatedProduct(this.productId, num);
                }
            }
            base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
        }
コード例 #4
0
 private void btnAddSearch_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <int> productIds = SubSiteProducthelper.GetProductIds(new ProductQuery
     {
         Keywords   = this.keywords,
         CategoryId = this.categoryId,
         SaleStatus = ProductSaleStatus.OnSale
     });
     foreach (int current in productIds)
     {
         if (this.productId != current)
         {
             SubSiteProducthelper.AddRelatedProduct(this.productId, current);
         }
     }
     base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
 }