private void RendeBrand(StringBuilder sb) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, 0x3e8); if ((brandCategories != null) && (brandCategories.Rows.Count > 0)) { sb.AppendLine("<dl class=\"attribute_dl\">"); sb.AppendLine("<dt class=\"attribute_name\">品牌:</dt>"); sb.AppendLine("<dd class=\"attribute_val\">"); sb.AppendLine("<div class=\"h_chooselist\">"); string str = "all"; if (this.brandId == 0) { str = str + " select"; } sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >全部</a>", str, this.CreateUrl("brand", "")).AppendLine(); foreach (DataRow row in brandCategories.Rows) { str = string.Empty; if (this.brandId == ((int)row["BrandId"])) { str = str + " select"; } sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", str, this.CreateUrl("brand", row["BrandId"].ToString()), row["BrandName"]).AppendLine(); } sb.AppendLine("</div>"); sb.AppendLine("</dd>"); sb.AppendLine("</dl>"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!this.Page.IsPostBack) { this.cboxCategory.DataSource = CategoryBrowser.GetAllCategories(); this.cboxCategory.DataTextField = "Name"; this.cboxCategory.DataValueField = "CategoryId"; this.cboxCategory.DataBind(); this.cboxBrand.DataSource = CategoryBrowser.GetBrandCategories(); this.cboxBrand.DataTextField = "BrandName"; this.cboxBrand.DataValueField = "BrandId"; this.cboxBrand.DataBind(); this.cboxType.DataSource = ProductTypeHelper.GetProductTypes(); this.cboxType.DataTextField = "TypeName"; this.cboxType.DataValueField = "TypeId"; this.cboxType.DataBind(); DataTable dtData = DistributorsBrower.GetDistributorProductRangeByUserid(int.Parse(Request.QueryString["UserID"])); if (dtData.Rows.Count > 0) { string strs = string.Empty; if (dtData.Rows[0]["ProductRange1"] != DBNull.Value) { strs = "," + dtData.Rows[0]["ProductRange1"].ToString().Trim() + ","; foreach (ListItem li in this.cboxCategory.Items) { if (strs.IndexOf(li.Value) > -1) { li.Selected = true; } } } if (dtData.Rows[0]["ProductRange2"] != DBNull.Value) { strs = "," + dtData.Rows[0]["ProductRange2"].ToString().Trim() + ","; foreach (ListItem li in this.cboxBrand.Items) { if (strs.IndexOf(li.Value) > -1) { li.Selected = true; } } } if (dtData.Rows[0]["ProductRange3"] != DBNull.Value) { strs = "," + dtData.Rows[0]["ProductRange3"].ToString().Trim() + ","; foreach (ListItem li in this.cboxType.Items) { if (strs.IndexOf(li.Value) > -1) { li.Selected = true; } } } } ViewState["dtData"] = dtData; } }
protected override void AttachChildControls() { this.rptBrands = (WapTemplatedRepeater)this.FindControl("rptBrands"); this.rptBrands.DataSource = CategoryBrowser.GetBrandCategories(0, 1000); this.rptBrands.DataBind(); PageTitle.AddSiteNameTitle("品牌列表"); }
private void RendeBrand(StringBuilder stringBuilder_0) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, 1000); if (brandCategories != null && brandCategories.Rows.Count > 0) { stringBuilder_0.AppendLine("<dl class=\"attribute_dl\">"); stringBuilder_0.AppendLine("<dt class=\"attribute_name\">品牌:</dt>"); stringBuilder_0.AppendLine("<dd class=\"attribute_val\">"); stringBuilder_0.AppendLine("<div class=\"h_chooselist\">"); string text = "all"; if (this.brandId == 0) { text += " select"; } stringBuilder_0.AppendFormat("<a class=\"{0}\" href=\"{1}\" >全部</a>", text, this.CreateUrl("brand", "")).AppendLine(); foreach (DataRow dataRow in brandCategories.Rows) { text = string.Empty; if (this.brandId == (int)dataRow["BrandId"]) { text += " select"; } stringBuilder_0.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", text, this.CreateUrl("brand", dataRow["BrandId"].ToString()), dataRow["BrandName"]).AppendLine(); } stringBuilder_0.AppendLine("</div>"); stringBuilder_0.AppendLine("</dd>"); stringBuilder_0.AppendLine("</dl>"); } }
private void recordsone_ItemDataBound(object sender, RepeaterItemEventArgs e) { Control control = e.Item.Controls[0]; Repeater repeater = (Repeater)control.FindControl("recordstwo"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)control.FindControl("hidMainCategoryId"); int mainCategoryId = int.Parse(htmlInputHidden.Value); Repeater repeater2 = (Repeater)control.FindControl("recordsbrands"); Repeater repeater3 = (Repeater)control.FindControl("rphotkey"); Repeater recordTwoCategory = (Repeater)control.FindControl("recordTwoCategory"); Repeater recordtwoHotBuyProduct = (Repeater)control.FindControl("recordtwoHotBuyProduct"); repeater2.DataSource = CategoryBrowser.GetBrandCategories(mainCategoryId, 12); repeater2.DataBind(); repeater.DataSource = CategoryBrowser.GetMaxSubCategories(mainCategoryId, 0, 1000); repeater.DataBind(); if (repeater3 != null) { repeater3.DataSource = CommentBrowser.GetHotKeywords(mainCategoryId, 12); repeater3.DataBind(); } if (recordTwoCategory != null) { recordTwoCategory.DataSource = CategoryBrowser.GetMaxSubCategories(mainCategoryId, 0, 1000); recordTwoCategory.DataBind(); } if (recordtwoHotBuyProduct != null) { recordtwoHotBuyProduct.DataSource = ProductBrowser.GetHotBuyProduct(mainCategoryId); recordtwoHotBuyProduct.DataBind(); } }
protected override void AttachChildControls() { MemberProcessor.GetCurrentMember(); this.rptBrands = (VshopTemplatedRepeater)this.FindControl("rptBrands"); this.rptBrands.DataSource = CategoryBrowser.GetBrandCategories(); this.rptBrands.DataBind(); PageTitle.AddSiteNameTitle("品牌列表"); }
void recordsone_ItemDataBound(object sender, RepeaterItemEventArgs e) { Control control = e.Item.Controls[0]; Repeater repeater = (Repeater)control.FindControl("recordstwo"); HtmlInputHidden hidden = (HtmlInputHidden)control.FindControl("hidMainCategoryId"); Repeater repeater2 = (Repeater)control.FindControl("recordsbrands"); repeater2.DataSource = CategoryBrowser.GetBrandCategories(int.Parse(hidden.Value), 12); repeater2.DataBind(); repeater.DataSource = CategoryBrowser.SearchCategories(int.Parse(hidden.Value), null); repeater.DataBind(); }
private void RenderBrand(XmlNode node, StringBuilder sb) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, int.Parse(node.Attributes["BrandNum"].Value)); if ((brandCategories != null) && (brandCategories.Rows.Count > 0)) { sb.AppendLine("<div class=\"bd_brand\">"); sb.AppendLine("<ul>"); foreach (DataRow row in brandCategories.Rows) { sb.AppendFormat("<li><a href=\"{0}\"><img src=\"{1}\" /></a></li>", Globals.GetSiteUrls().SubBrandDetails((int)row["BrandId"], row["RewriteName"]), row["Logo"]).AppendLine(); } sb.AppendLine("</ul>"); sb.AppendLine("</div>"); } }
private void RendeBrand(StringBuilder sb) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, 1000); if (brandCategories != null && brandCategories.Rows.Count > 0) { sb.AppendLine("<dl class=\"attribute_dl\">"); sb.AppendLine("<dt class=\"attribute_name\">品牌:</dt>"); sb.AppendLine("<dd class=\"attribute_val\">"); sb.AppendLine("<a class=\"more-attr\">更多<span></span></a>"); sb.AppendLine("<div class=\"h_chooselist\">"); string text = "all"; if (this.brandId == 0) { text += " select"; } sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >全部</a>", text, this.CreateUrl("brand", "")).AppendLine(); #region 过滤品牌 foreach (DataRow dataRow in brandCategories.Rows) { text = string.Empty; if (this.brandId == (int)dataRow["BrandId"]) { text += " select"; } if (search_BrandStr != null) { if (search_BrandStr.Contains(dataRow["BrandId"].ToString())) { sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", text, this.CreateUrl("brand", dataRow["BrandId"].ToString()), dataRow["BrandName"]).AppendLine(); } } else { sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", text, this.CreateUrl("brand", dataRow["BrandId"].ToString()), dataRow["BrandName"]).AppendLine(); } } #endregion sb.AppendLine("</div>"); sb.AppendLine("</dd>"); sb.AppendLine("</dl>"); } }
public string RendHtml() { XmlNode xmlNode = TagsHelper.FindCommentNode(this.CommentId, "brand"); StringBuilder stringBuilder = new StringBuilder(); if (xmlNode != null) { stringBuilder.AppendFormat("<div class=\"brand cssEdite\" type=\"brand\" id=\"comments_{0}\" >", this.CommentId).AppendLine(); int categoryId = 0; int maxNum = 0; bool flag = true; bool flag2 = true; int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId); int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum); bool.TryParse(xmlNode.Attributes["IsShowLogo"].Value, out flag); bool.TryParse(xmlNode.Attributes["IsShowTitle"].Value, out flag2); string value = xmlNode.Attributes["ImageSize"].Value; DataTable brandCategories = CategoryBrowser.GetBrandCategories(categoryId, maxNum); if (brandCategories != null && brandCategories.Rows.Count > 0) { stringBuilder.AppendLine("<ul>"); foreach (DataRow dataRow in brandCategories.Rows) { stringBuilder.AppendLine("<li>"); if (flag) { stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" width=\"{2}\"></a></div>", Globals.GetSiteUrls().SubBrandDetails((int)dataRow["BrandId"], dataRow["RewriteName"]), dataRow["Logo"], value.Split(new char[] { '*' })[0]).AppendLine(); } if (flag2) { stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().SubBrandDetails((int)dataRow["BrandId"], dataRow["RewriteName"]), dataRow["BrandName"]).AppendLine(); } stringBuilder.AppendLine("</li>"); } stringBuilder.AppendLine("</ul>"); } stringBuilder.AppendLine("</div>"); } return(stringBuilder.ToString()); }
protected override void Render(HtmlTextWriter writer) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat(" <div class=\"brush-list\" id=\"{0}\">", this.ID); //原产地列表 IList <ImportSourceTypeInfo> importSourceTypelist = ImportSourceTypeHelper.GetAllImportSourceTypes(); stringBuilder.Append(" <ol class=\"fix\"><h4>地区</h4><div class=\"fix\"><a class=\"selected\">不限</a>"); if (importSourceTypelist != null) { foreach (ImportSourceTypeInfo item in importSourceTypelist) { stringBuilder.AppendFormat("<a name=\"{0}\">{1}</a>", item.ImportSourceId.ToString(), item.CnArea); } } stringBuilder.AppendFormat("</div></ol>"); //根据商品分类获取品牌 DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, 1000); stringBuilder.Append(" <ol class=\"fix\"><h4>品牌</h4><div class=\"fix\"><a class=\"selected\">不限</a>"); if (brandCategories != null && brandCategories.Rows.Count > 0) { foreach (DataRow dataRow in brandCategories.Rows) { stringBuilder.AppendFormat("<a name=\"{0}\">{1}</a>", dataRow["BrandId"].ToString(), dataRow["BrandName"]); } } stringBuilder.AppendFormat("</div></ol>"); stringBuilder.Append("</div>"); writer.Write(stringBuilder.ToString()); }
private void recordsone_ItemDataBound(object sender, RepeaterItemEventArgs e) { Control control = e.Item.Controls[0]; Repeater repeater = (Repeater)control.FindControl("recordstwo"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)control.FindControl("hidMainCategoryId"); Repeater repeater2 = (Repeater)control.FindControl("recordsbrands"); rphotkey = (Repeater)control.FindControl("rphotkey"); repeater2.DataSource = CategoryBrowser.GetBrandCategories(int.Parse(htmlInputHidden.Value), 12); repeater2.DataBind(); repeater.DataSource = CategoryBrowser.GetMaxSubCategories(int.Parse(htmlInputHidden.Value), 1000); repeater.DataBind(); IList <CategoryInfo> i = CategoryBrowser.GetMaxSubCategories(int.Parse(htmlInputHidden.Value), 3); if (i.Count > 0) { this.rphotkey.DataSource = i; rphotkey.DataBind(); } }
protected override void OnLoad(EventArgs e) { base.DataSource = CategoryBrowser.GetBrandCategories(this.MaxNum); base.DataBind(); }
protected override void AttachChildControls() { if (SettingsManager.GetMasterSettings(true).VTheme.ToLower() == "common") { this.Page.Response.Redirect("index.aspx"); return; } this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptProducts.ItemDataBound += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound); this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound); this.img = (HtmlImage)this.FindControl("imgDefaultBg"); this.pager = (Pager)this.FindControl("pager"); this.litstorename = (Literal)this.FindControl("litstorename"); this.litdescription = (Literal)this.FindControl("litdescription"); this.litattention = (Literal)this.FindControl("litattention"); this.imglogo = (HiImage)this.FindControl("imglogo"); if (CustomConfigHelper.Instance.IsLogoOn == "false") { imglogo.Visible = false; } this.litImgae = (Literal)this.FindControl("litImgae"); this.litActivity = (Literal)this.FindControl("litActivity");//大图展示页面 this.litItemParams = (Literal)this.FindControl("litItemParams"); //店铺推广码送过来的地址(参数:ReferralId) if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"])) { //无传参,取COOKIE HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value)) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value); } } if (this.rptCategories.Visible) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(); this.itemcount = brandCategories.Rows.Count; if (brandCategories.Rows.Count > 0) { this.rptCategories.DataSource = brandCategories; this.rptCategories.DataBind(); } } this.Page.Session["stylestatus"] = "3"; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PageTitle.AddSiteNameTitle(masterSettings.SiteName); this.litstorename.Text = masterSettings.SiteName; this.litdescription.Text = masterSettings.ShopIntroduction; if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (base.referralId <= 0) { HttpCookie cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if ((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value)) { base.referralId = int.Parse(cookie2.Value); this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true); } } else { HttpCookie cookie3 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (((cookie3 != null) && !string.IsNullOrEmpty(cookie3.Value)) && (this.referralId.ToString() != cookie3.Value)) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);//跳转到自己的店铺 } } IList <BannerInfo> allBanners = new List <BannerInfo>(); allBanners = VshopBrowser.GetAllBanners(); foreach (BannerInfo info in allBanners) { TplCfgInfo info2 = new NavigateInfo { LocationType = info.LocationType, Url = info.Url }; string loctionUrl = "javascript:"; if (!string.IsNullOrEmpty(info.Url)) { loctionUrl = info2.LoctionUrl; } string text = this.litImgae.Text; this.litImgae.Text = text + "<li><a id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a></li>"; //this.litActivity.Text = text + "<a id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>"; } if (allBanners.Count == 0) { this.litImgae.Text = "<li><a id=\"ahref\" href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\" /></a></li>"; } DistributorsInfo userIdDistributors = new DistributorsInfo(); userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId); if ((userIdDistributors != null) && (userIdDistributors.UserId > 0)) { PageTitle.AddSiteNameTitle(userIdDistributors.StoreName); this.litdescription.Text = userIdDistributors.StoreDescription; this.litstorename.Text = userIdDistributors.StoreName; if (!string.IsNullOrEmpty(userIdDistributors.Logo)) { this.imglogo.ImageUrl = userIdDistributors.Logo; } else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (!string.IsNullOrEmpty(userIdDistributors.BackImage)) { this.litImgae.Text = ""; foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' })) { if (!string.IsNullOrEmpty(str2)) { this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\" /></a>"; } } } } this.dtpromotion = ProductBrowser.GetAllFull(); if (this.rptProducts != null) { ProductQuery query = new ProductQuery { PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortBy = "DisplaySequence", SortOrder = SortAction.Desc }; //查询条件处理 switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower()) { case "underwear": this.pager.Visible = false; query.PageSize = 1000; query.PageIndex = 1; query.SortBy = "ShowSaleCounts"; query.SortOrder = SortAction.Desc; query.TypeId = 1; break; } DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query); this.rptProducts.DataSource = homeProduct.Data; this.rptProducts.DataBind(); this.pager.TotalRecords = homeProduct.TotalRecords; if (this.pager.TotalRecords <= this.pager.PageSize) { this.pager.Visible = false; } } if (this.img != null) { this.img.Src = new VTemplateHelper().GetDefaultBg(); } if (!string.IsNullOrEmpty(masterSettings.GuidePageSet)) { this.litattention.Text = masterSettings.GuidePageSet; } string str3 = ""; if (!string.IsNullOrEmpty(masterSettings.ShopHomePic)) { str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic; } string str4 = ""; string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName; if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic)) { str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0]; } this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$"; this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url }); int userid = 18; string userFomartCode = userid.ToString("000000000000000"); LoadProductTop(); getImgBanner(); //载入大图 getMyCoupon(); //获取首页赠送优惠券 InitDataByTheme(); distributorVisitCont(); //更新店铺访问信息 }
protected override void AttachChildControls() { HttpCookie cookie2; this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptProducts.ItemDataBound += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound); this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound); this.img = (HtmlImage)this.FindControl("imgDefaultBg"); this.pager = (Pager)this.FindControl("pager"); this.litstorename = (Literal)this.FindControl("litstorename"); this.litdescription = (Literal)this.FindControl("litdescription"); this.litattention = (Literal)this.FindControl("litattention"); this.imglogo = (HiImage)this.FindControl("imglogo"); this.litImgae = (Literal)this.FindControl("litImgae"); this.litItemParams = (Literal)this.FindControl("litItemParams"); if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"])) { HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value))) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value); } } if (this.rptCategories.Visible) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(); this.itemcount = brandCategories.Rows.Count; if (brandCategories.Rows.Count > 0) { this.rptCategories.DataSource = brandCategories; this.rptCategories.DataBind(); } } this.Page.Session["stylestatus"] = "3"; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PageTitle.AddSiteNameTitle(masterSettings.SiteName); this.litstorename.Text = masterSettings.SiteName; this.litdescription.Text = masterSettings.ShopIntroduction; if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (base.referralId <= 0) { cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (!((cookie2 == null) || string.IsNullOrEmpty(cookie2.Value))) { base.referralId = int.Parse(cookie2.Value); this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true); } } else { cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value)) && (this.referralId.ToString() != cookie2.Value)) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true); } } IList <BannerInfo> allBanners = new List <BannerInfo>(); allBanners = VshopBrowser.GetAllBanners(); foreach (BannerInfo info in allBanners) { TplCfgInfo info2 = new NavigateInfo { LocationType = info.LocationType, Url = info.Url }; string loctionUrl = "javascript:"; if (!string.IsNullOrEmpty(info.Url)) { loctionUrl = info2.LoctionUrl; } string text = this.litImgae.Text; this.litImgae.Text = text + "<a id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>"; } if (allBanners.Count == 0) { this.litImgae.Text = "<a id=\"ahref\" href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\" /></a>"; } DistributorsInfo userIdDistributors = new DistributorsInfo(); userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId); if ((userIdDistributors != null) && (userIdDistributors.UserId > 0)) { PageTitle.AddSiteNameTitle(userIdDistributors.StoreName); this.litdescription.Text = userIdDistributors.StoreDescription; this.litstorename.Text = userIdDistributors.StoreName; if (!string.IsNullOrEmpty(userIdDistributors.Logo)) { this.imglogo.ImageUrl = userIdDistributors.Logo; } else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (!string.IsNullOrEmpty(userIdDistributors.BackImage)) { this.litImgae.Text = ""; foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' })) { if (!string.IsNullOrEmpty(str2)) { this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\" /></a>"; } } } } this.dtpromotion = ProductBrowser.GetAllFull(); if (this.rptProducts != null) { ProductQuery query = new ProductQuery { PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortBy = "DisplaySequence", SortOrder = SortAction.Desc }; DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query); this.rptProducts.DataSource = homeProduct.Data; this.rptProducts.DataBind(); this.pager.TotalRecords = homeProduct.TotalRecords; if (this.pager.TotalRecords <= this.pager.PageSize) { this.pager.Visible = false; } } if (this.img != null) { this.img.Src = new VTemplateHelper().GetDefaultBg(); } if (!string.IsNullOrEmpty(masterSettings.GuidePageSet)) { this.litattention.Text = masterSettings.GuidePageSet; } if ((this.Page.Request.UserAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet)) && !string.IsNullOrEmpty(masterSettings.GuidePageSet)) { this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet; } string str4 = ""; if (!string.IsNullOrEmpty(masterSettings.ShopHomePic)) { str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic; } string str5 = ""; string str6 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName; if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic)) { str5 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0]; } this.litItemParams.Text = str4 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$"; this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str5, "|好店推荐之", str6, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url }); }
protected override void AttachChildControls() { this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptProducts.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptProducts_ItemDataBound); this.rptCategories.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCategories_ItemDataBound); this.img = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg"); this.pager = (Pager)this.FindControl("pager"); this.litstorename = (System.Web.UI.WebControls.Literal) this.FindControl("litstorename"); this.litdescription = (System.Web.UI.WebControls.Literal) this.FindControl("litdescription"); this.litattention = (System.Web.UI.WebControls.Literal) this.FindControl("litattention"); this.imglogo = (HiImage)this.FindControl("imglogo"); this.litImgae = (System.Web.UI.WebControls.Literal) this.FindControl("litImgae"); this.litItemParams = (System.Web.UI.WebControls.Literal) this.FindControl("litItemParams"); if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"])) { System.Web.HttpCookie httpCookie = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value)) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + httpCookie.Value); } } if (this.rptCategories.Visible) { DataTable brandCategories = CategoryBrowser.GetBrandCategories(); this.itemcount = brandCategories.Rows.Count; if (brandCategories.Rows.Count > 0) { this.rptCategories.DataSource = brandCategories; this.rptCategories.DataBind(); } } this.Page.Session["stylestatus"] = "3"; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PageTitle.AddSiteNameTitle(masterSettings.SiteName); this.litstorename.Text = masterSettings.SiteName; this.litdescription.Text = masterSettings.ShopIntroduction; if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (this.referralId <= 0) { System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value)) { this.referralId = int.Parse(httpCookie2.Value); this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true); } } else { System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value) && this.referralId.ToString() != httpCookie2.Value) { this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true); } } System.Collections.Generic.IList <BannerInfo> list = new System.Collections.Generic.List <BannerInfo>(); list = VshopBrowser.GetAllBanners(); foreach (BannerInfo current in list) { TplCfgInfo tplCfgInfo = new NavigateInfo(); tplCfgInfo.LocationType = current.LocationType; tplCfgInfo.Url = current.Url; string text = "javascript:"; if (!string.IsNullOrEmpty(current.Url)) { text = tplCfgInfo.LoctionUrl; } System.Web.UI.WebControls.Literal expr_3E2 = this.litImgae; string text2 = expr_3E2.Text; expr_3E2.Text = string.Concat(new string[] { text2, "<a id=\"ahref\" href='", text, "'><img src=\"", current.ImageUrl, "\" title=\"", current.ShortDesc, "\" alt=\"", current.ShortDesc, "\" /></a>" }); } if (list.Count == 0) { this.litImgae.Text = "<a id=\"ahref\" href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\" /></a>"; } DistributorsInfo distributorsInfo = new DistributorsInfo(); distributorsInfo = DistributorsBrower.GetUserIdDistributors(this.referralId); if (distributorsInfo != null && distributorsInfo.UserId > 0) { PageTitle.AddSiteNameTitle(distributorsInfo.StoreName); this.litdescription.Text = distributorsInfo.StoreDescription; this.litstorename.Text = distributorsInfo.StoreName; if (!string.IsNullOrEmpty(distributorsInfo.Logo)) { this.imglogo.ImageUrl = distributorsInfo.Logo; } else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic)) { this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0]; } if (!string.IsNullOrEmpty(distributorsInfo.BackImage)) { this.litImgae.Text = ""; string[] array = distributorsInfo.BackImage.Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { string text3 = array[i]; if (!string.IsNullOrEmpty(text3)) { System.Web.UI.WebControls.Literal expr_5D7 = this.litImgae; expr_5D7.Text = expr_5D7.Text + "<a ><img src=\"" + text3 + "\" title=\"\" /></a>"; } } } } this.dtpromotion = ProductBrowser.GetAllFull(); if (this.rptProducts != null) { ProductQuery productQuery = new ProductQuery(); productQuery.PageSize = this.pager.PageSize; productQuery.PageIndex = this.pager.PageIndex; productQuery.SortBy = "DisplaySequence"; productQuery.SortOrder = SortAction.Desc; DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), productQuery); this.rptProducts.DataSource = homeProduct.Data; this.rptProducts.DataBind(); this.pager.TotalRecords = homeProduct.TotalRecords; if (this.pager.TotalRecords <= this.pager.PageSize) { this.pager.Visible = false; } } if (this.img != null) { this.img.Src = new VTemplateHelper().GetDefaultBg(); } if (!string.IsNullOrEmpty(masterSettings.GuidePageSet)) { this.litattention.Text = masterSettings.GuidePageSet; } string userAgent = this.Page.Request.UserAgent; if (userAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet)) { if (!string.IsNullOrEmpty(masterSettings.GuidePageSet)) { this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet; } } string text4 = ""; if (!string.IsNullOrEmpty(masterSettings.ShopHomePic)) { text4 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.ShopHomePic; } string text5 = ""; string text6 = (distributorsInfo == null) ? masterSettings.SiteName : distributorsInfo.StoreName; if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic)) { text5 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0]; } this.litItemParams.Text = string.Concat(new string[] { text4, "|", masterSettings.ShopHomeName, "|", masterSettings.ShopHomeDescription, "$" }); this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, text5, "|好店推荐之", text6, "商城|一个购物赚钱的好去处|", System.Web.HttpContext.Current.Request.Url }); }