private void dlstProducts_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e) { if (e.CommandName == "check") { int productId = int.Parse(this.dlstProducts.DataKeys[e.Item.ItemIndex].ToString(), System.Globalization.NumberStyles.None); ArticleHelper.AddReleatesProdcutByArticId(this.articId, productId); base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); } }
private void btnAddSearch_Click(object sender, EventArgs e) { ProductQuery query = new ProductQuery(); query.Keywords = keywords; query.CategoryId = categoryId; query.SaleStatus = ProductSaleStatus.OnSale; foreach (int num in ProductHelper.GetProductIds(query)) { ArticleHelper.AddReleatesProdcutByArticId(articId, num); } base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); }
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) { ArticleHelper.AddReleatesProdcutByArticId(this.articId, current); } base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true); }
private void Add(HttpContext context) { int value = base.GetIntParam(context, "relatedId", false).Value; if (this.articleId <= 0 || this.articleId == value) { throw new HidistroAshxException("错误的数据编号"); } if (value <= 0) { throw new HidistroAshxException("错误的数据编号"); } ArticleHelper.AddReleatesProdcutByArticId(this.articleId, value); base.ReturnSuccessResult(context, "操作成功!", 0, true); }
private void AddSearch(HttpContext context) { if (this.articleId <= 0) { throw new HidistroAshxException("错误的数据编号"); } ProductQuery productQuery = this.GetProductQuery(context); IList <int> productIds = ProductHelper.GetProductIds(productQuery); foreach (int item in productIds) { if (this.articleId != item) { ArticleHelper.AddReleatesProdcutByArticId(this.articleId, item); } } base.ReturnSuccessResult(context, "操作成功!", 0, true); }