private void BindShareProducts() { this.LoadParams(); ProductQuery productQuery = new ProductQuery { SaleStatus = ProductSaleStatus.OnSale, Keywords = this.productName, ProductCode = this.productCode, CategoryId = this.categoryId, PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortOrder = SortAction.Desc, SortBy = "DisplaySequence", BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, TagId = this.dropTagList.SelectedValue.HasValue ? this.dropTagList.SelectedValue : null, TypeId = this.typeId, IsAlert = this.isAlert }; if (this.categoryId.HasValue) { productQuery.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } Globals.EntityCoding(productQuery, true); ShareProductInfo shareProductInfoById = ProductHelper.GetShareProductInfoById(this.shareId); string value = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/WapShop/ShareProducts.aspx?Id=" + this.shareId; this.txturl.Value = value; this.imgurl.ImageUrl = shareProductInfoById.ShareUrl; DbQueryResult shareProducts = ProductHelper.GetShareProducts(productQuery, true, this.shareId); this.rp_shareproduct.DataSource = shareProducts.Data; this.rp_shareproduct.DataBind(); this.pager1.TotalRecords = (this.pager.TotalRecords = shareProducts.TotalRecords); }
private void btnUpdateValue_Click(object sender, System.EventArgs e) { ShareProductInfo shareProductInfo = new ShareProductInfo(); if (!string.IsNullOrEmpty(this.txtshareTitle.Text)) { shareProductInfo.ShareTitle = this.txtshareTitle.Text.Trim(); } if (!string.IsNullOrEmpty(this.shareId.Value)) { shareProductInfo.ShareId = System.Convert.ToInt32(this.shareId.Value); } if (!string.IsNullOrEmpty(this.shareUrl.Value)) { shareProductInfo.ShareUrl = this.shareUrl.Value; } ProductHelper.UpdateShareLine(shareProductInfo); this.BindShareLine(); }
private void LoadParameters() { if (!string.IsNullOrEmpty(this.Page.Request.QueryString["productName"])) { this.productName = Globals.UrlDecode(this.Page.Request.QueryString["productName"]); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["productCode"])) { this.productCode = Globals.UrlDecode(this.Page.Request.QueryString["productCode"]); } int value = 0; if (int.TryParse(this.Page.Request.QueryString["categoryId"], out value)) { this.categoryId = new int?(value); } int value2 = 0; if (int.TryParse(this.Page.Request.QueryString["brandId"], out value2)) { this.dropBrandList.SelectedValue = new int?(value2); } int value3 = 0; if (int.TryParse(this.Page.Request.QueryString["lineId"], out value3)) { this.lineId = new int?(value3); } int value4 = 0; if (int.TryParse(this.Page.Request.QueryString["tagId"], out value4)) { this.tagId = new int?(value4); } int value5 = 0; if (int.TryParse(this.Page.Request.QueryString["typeId"], out value5)) { this.typeId = new int?(value5); } int value6 = 0; if (int.TryParse(this.Page.Request.QueryString["distributorId"], out value6)) { this.distributorId = new int?(value6); } bool.TryParse(this.Page.Request.QueryString["isAlert"], out this.isAlert); if (!string.IsNullOrEmpty(this.Page.Request.QueryString["SaleStatus"])) { this.saleStatus = (ProductSaleStatus)System.Enum.Parse(typeof(ProductSaleStatus), this.Page.Request.QueryString["SaleStatus"]); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["PenetrationStatus"])) { this.penetrationStatus = (PenetrationStatus)System.Enum.Parse(typeof(PenetrationStatus), this.Page.Request.QueryString["PenetrationStatus"]); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["startDate"])) { this.startDate = new System.DateTime?(System.DateTime.Parse(this.Page.Request.QueryString["startDate"])); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["endDate"])) { this.endDate = new System.DateTime?(System.DateTime.Parse(this.Page.Request.QueryString["endDate"])); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["shareId"])) { this.shareId = new int?(System.Convert.ToInt32(this.Page.Request.QueryString["shareId"])); } if (this.shareId.HasValue && this.shareId.Value > 0) { this.TemporaryProductId = null; string value7 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/WapShop/ShareProducts.aspx?Id=" + this.shareId.Value; ShareProductInfo shareProductInfoById = ProductHelper.GetShareProductInfoById(this.shareId.Value); string text = this.Create_ImgCode(value7, 10); shareProductInfoById.ShareUrl = text; if (ProductHelper.UpdateShareLine(shareProductInfoById)) { this.panlproducts.Visible = false; this.SharePanel.Visible = true; this.imgurl.ImageUrl = text; this.txtlink.Value = value7; } } this.txtSearchText.Text = this.productName; this.dropCategories.DataBind(); this.dropCategories.SelectedValue = this.categoryId; this.dropTagList.DataBind(); this.dropTagList.SelectedValue = this.tagId; this.calendarStartDate.SelectedDate = this.startDate; this.calendarEndDate.SelectedDate = this.endDate; this.dropType.SelectedValue = this.typeId; }