/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int productBrandID = RequestHelper.GetQueryString <int>("ID"); if (productBrandID != int.MinValue) { CheckAdminPower("ReadProductBrand", PowerCheckType.Single); productBrand = ProductBrandBLL.Read(productBrandID); Name.Text = productBrand.Name; Logo.Text = productBrand.ImageUrl; Url.Text = productBrand.LinkUrl; Description.Text = productBrand.Remark; OrderID.Text = productBrand.OrderId.ToString(); if (Convert.ToBoolean(productBrand.IsTop)) { IsTop.Checked = true; } Spell.Visible = true; Spelling.Text = productBrand.Spelling; } } }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); ClassID.DataSource = ProductClassBLL.ReadNamedList(); ClassID.DataTextField = "Name"; ClassID.DataValueField = "ID"; ClassID.DataBind(); ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.IsDelete = 0;//未删除的 productSearch.StandardType = (int)ProductStandardType.No; productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); BindControl(ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count), RecordList, MyPager); } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("ID"); productBrand = ProductBrandBLL.ReadProductBrandCache(id); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.BrandID = id; productSearch.IsTop = (int)BoolType.True; productList = ProductBLL.SearchProductList(productSearch); string strProductID = string.Empty; foreach (ProductInfo product in productList) { if (strProductID == string.Empty) { strProductID = product.ID.ToString(); } else { strProductID += "," + product.ID.ToString(); } } if (strProductID != string.Empty) { memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID); } Title = productBrand.Name; }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsProduct", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = 1; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); string queryString = RequestHelper.GetQueryString <string>("ProductOrderType"); queryString = (queryString == string.Empty) ? "SellCount" : queryString; productSearch.ProductOrderType = queryString; this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartDate.Text = RequestHelper.GetQueryString <string>("StartDate"); this.EndDate.Text = RequestHelper.GetQueryString <string>("EndDate"); this.ProductOrderType.Text = queryString; DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate")); base.BindControl(ProductBLL.StatisticsProductSale(base.CurrentPage, base.PageSize, productSearch, ref this.Count, startDate, endDate), this.RecordList, this.MyPager); } }
protected string CreatBrandCheckBoxHtml(string brandIDStr) { StringBuilder brandCheckBoxHtml = new StringBuilder(); brandCheckBoxHtml.Append("<div class=\"checkboxlistarea\">"); brandCheckBoxHtml.AppendLine("<dl>"); brandCheckBoxHtml.Append("<dt><input name=\"AllBrandID\" type=\"checkbox\" value=\"0\" "); if (brandIDStr == "0") { brandCheckBoxHtml.Append(" checked"); } brandCheckBoxHtml.Append(">所有品牌</dt>"); brandCheckBoxHtml.AppendLine("<div class=\"checkboxlist\">"); foreach (ProductBrandInfo info in ProductBrandBLL.ReadProductBrandCacheList()) { brandCheckBoxHtml.AppendLine("<dd><input name=\"BrandID\" data-type=\"0\" type=\"checkbox\" value=\"" + info.ID + "\""); if (StringHelper.CompareStringContainSpecialValue(brandIDStr, info.ID.ToString())) { brandCheckBoxHtml.Append(" checked"); } brandCheckBoxHtml.Append(">" + info.Name + "</dd>"); } brandCheckBoxHtml.AppendLine("</div>"); brandCheckBoxHtml.AppendLine("</dl>"); brandCheckBoxHtml.Append("</div>"); return(brandCheckBoxHtml.ToString()); }
public ActionResult FindPageList(string title, int?classfyId) { var count = 0; var list = new ProductBrandBLL().GetBrandListBySearch(title, classfyId, out count); return(ToDataGrid(list, count)); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("StatisticsProduct", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StorageAnalyse.Text = RequestHelper.GetQueryString <string>("StorageAnalyse"); ProductSearchInfo product = new ProductSearchInfo(); product.IsSale = 1; product.Name = RequestHelper.GetQueryString <string>("Name"); product.ClassID = RequestHelper.GetQueryString <string>("ClassID"); product.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); product.StorageAnalyse = RequestHelper.GetQueryString <int>("StorageAnalyse"); List <ProductInfo> dataSource = ProductBLL.SearchProductList(base.CurrentPage, base.PageSize, product, ref this.Count); base.BindControl(dataSource, this.RecordList, this.MyPager); } }
protected void SubmitButton_Click(object sender, EventArgs e) { ProductBrandInfo productBrand = new ProductBrandInfo();; productBrand.ID = RequestHelper.GetQueryString <int>("ID"); productBrand.Name = this.Name.Text; productBrand.Logo = this.Logo.Text; productBrand.Url = this.Url.Text; productBrand.Description = this.Description.Text; productBrand.IsTop = Convert.ToInt32(this.IsTop.Text); productBrand.ProductCount = 0; string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (productBrand.ID == -2147483648) { base.CheckAdminPower("AddProductBrand", PowerCheckType.Single); int id = ProductBrandBLL.AddProductBrand(productBrand); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ProductBrand"), id); } else { base.CheckAdminPower("UpdateProductBrand", PowerCheckType.Single); ProductBrandBLL.UpdateProductBrand(productBrand); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ProductBrand"), productBrand.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
protected override void PageLoad() { base.PageLoad(); base.Title = "¹«Ë¾±à¼"; base.CheckUserPower("ReadCompany,UpdateCompany,UpdateSubCompany", PowerCheckType.OR); string sonCompanyID = CookiesHelper.ReadCookieValue("UserCompanySonCompanyID"); if (companyID > 0) { if (!StringHelper.CompareSingleString(sonCompanyID, companyID.ToString())) { ScriptHelper.Alert("Òì³£"); } } else { companyID = base.UserCompanyID; } company = CompanyBLL.ReadCompany(companyID); if (StringHelper.CompareSingleString(company.BrandId, "0")) { productBrandList = ProductBrandBLL.ReadProductBrandCacheList(); } else { productBrandList = ProductBrandBLL.ReadProductBrandCacheList(company.BrandId); } departmentList = PostBLL.ReadParentPostListByPostId(company.Post); postList = PostBLL.ReadPostListByPostId(company.Post); if (company.GroupId == (int)CompanyType.SubCompany || company.GroupId == (int)CompanyType.SubGroup) { parentCompanyPath = CompanyBLL.ReadParentCompanyName(company.ParentId); } }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProductBrand", PowerCheckType.Single); ProductBrandSearchInfo brandSearch = new ProductBrandSearchInfo(); brandSearch.Key = RequestHelper.GetQueryString <string>("Key"); brandSearch.IsTop = RequestHelper.GetQueryString <int>("IsTop"); Key.Text = brandSearch.Key; IsTop.Text = brandSearch.IsTop.ToString(); PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); brandList = ProductBrandBLL.SearchList(CurrentPage, PageSize, brandSearch, ref Count); //BindControl(ProductBrandBLL.ReadList(), RecordList); BindControl(brandList, RecordList, MyPager); if (RequestHelper.GetQueryString <string>("Action") == "Delete") { int brandId = RequestHelper.GetQueryString <int>("ID"); if (brandId > 0) { CheckAdminPower("DeleteProductBrand", PowerCheckType.Single); string URL = "ProductBrand.aspx?Action=search&"; URL += "Key=" + Key.Text + "&"; URL += "IsTop=" + IsTop.Text; ProductBrandBLL.Delete(brandId); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("ProductBrand"), brandId.ToString()); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), URL); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsProduct", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "Id"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Name.Text = RequestHelper.GetQueryString <string>("Name"); StorageAnalyse.Text = RequestHelper.GetQueryString <string>("StorageAnalyse"); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.StorageAnalyse = RequestHelper.GetQueryString <int>("StorageAnalyse"); List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count); BindControl(productList, RecordList, MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ProductBatchEdit", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); string queryString = RequestHelper.GetQueryString <string>("Action"); if (queryString != null) { if (!(queryString == "UnionEdit")) { if (queryString == "search") { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassID = RequestHelper.GetQueryString <string>("ClassID"); productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Name.Text = RequestHelper.GetQueryString <string>("Name"); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); base.BindControl(ProductBLL.SearchProductList(productSearch), this.RecordList); } } else { this.UnionEdit(); } } this.userGradeList = UserGradeBLL.ReadUserGradeCacheList(); foreach (UserGradeInfo info3 in this.userGradeList) { if (this.userGradeIDList == string.Empty) { this.userGradeIDList = info3.ID.ToString(); this.userGradeNameList = info3.Name; } else { this.userGradeIDList = this.userGradeIDList + "," + info3.ID.ToString(); this.userGradeNameList = this.userGradeNameList + "," + info3.Name; } } } }
protected override void PageLoad() { this.helpClassList = ArticleClassBLL.ReadArticleClassChildList(4); this.productClassList = ProductClassBLL.ReadProductClassRootList(); //this.allProductClassList = ProductClassBLL.ReadProductClassNamedList(); this.topProductBrandList = ProductBrandBLL.ReadProductBrandIsTopCacheList(); this.productBrandList = ProductBrandBLL.ReadProductBrandCacheList(); this.hotKeyword = ShopConfig.ReadConfigInfo().HotKeyword; this.bottomList = ArticleBLL.ReadBottomList(); //this.tagsList = TagsBLL.ReadHotTagsList(); }
protected string GetBrandList(string ids) { string brandStr = string.Empty; string[] idArr = ids.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string id in idArr) { ProductBrandInfo brand = ProductBrandBLL.Read(Convert.ToInt32(id)); brandStr += brand.Name + ";"; } return(brandStr); }
/// <summary> /// 删除按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void DeleteButton_Click(object sender, EventArgs e) { CheckAdminPower("DeleteProductBrand", PowerCheckType.Single); string deleteID = RequestHelper.GetIntsForm("SelectID"); if (deleteID != string.Empty) { ProductBrandBLL.DeleteList(deleteID); AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("ProductBrand"), deleteID); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } }
/// <summary> /// 根据首字符筛选品牌 /// </summary> protected void GetBrandsByFirstLetter() { string firstLetter = RequestHelper.GetQueryString <string>("FirstLetter"); string _html = string.Empty; int attributeClassID = RequestHelper.GetQueryString <int>("ID"); pageAttr = ProductTypeBLL.Read(attributeClassID); List <ProductBrandInfo> proBrandList = new List <ProductBrandInfo>(); if (!string.IsNullOrEmpty(firstLetter)) { if (firstLetter == "+") {//其他,不是以字母开头的 Regex regChar = new Regex("^[a-z]"); Regex regDChar = new Regex("^[A-Z]"); proBrandList = ProductBrandBLL.ReadList().Where(k => !regChar.IsMatch(k.Spelling)).Where(k => !regDChar.IsMatch(k.Spelling)).OrderBy(k => k.Spelling).ToList(); } else {//以字母开头的 proBrandList = ProductBrandBLL.ReadList().Where(k => k.Spelling.ToLower().StartsWith(firstLetter.ToLower())).OrderBy(k => k.Spelling).ToList(); } foreach (ProductBrandInfo proBrand in proBrandList) { if (!string.IsNullOrEmpty(pageAttr.BrandIds)) { string brands = ";" + pageAttr.BrandIds + ";"; if (brands.IndexOf(";" + proBrand.Id.ToString() + ";") >= 0) { _html += "<label class=\"ig-checkbox checked\"><input type=\"checkbox\" checked=\"checked\" name=\"proBrand\" value=\"" + proBrand.Id + "\" onclick=\"chooseBrand(this,'" + proBrand.Name + "')\"/>" + proBrand.Name + "</label>"; } else { _html += " <label class=\"ig-checkbox\" ><input type=\"checkbox\" name=\"proBrand\" value=\"" + proBrand.Id + "\" onclick=\"chooseBrand(this,'" + proBrand.Name + "')\"/>" + proBrand.Name + "</label>"; } } else { _html += "<label class=\"ig-checkbox\"><input type=\"checkbox\" name=\"proBrand\" value=\"" + proBrand.Id + "\" onclick=\"chooseBrand(this,'" + proBrand.Name + "')\"/>" + proBrand.Name + "</label>"; } } Response.Clear(); ResponseHelper.Write(JsonConvert.SerializeObject(new { flag = true, content = _html })); } else { Response.Clear(); ResponseHelper.Write(JsonConvert.SerializeObject(new { flag = false, content = _html })); } Response.End(); }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); RegionID.DataSource = RegionBLL.ReadRegionUnlimitClass(); RegionID.ClassID = "|1|27|607|"; foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); IsSpecial.Text = RequestHelper.GetQueryString <string>("IsSpecial"); IsNew.Text = RequestHelper.GetQueryString <string>("IsNew"); IsHot.Text = RequestHelper.GetQueryString <string>("IsHot"); IsTop.Text = RequestHelper.GetQueryString <string>("IsTop"); List <ProductInfo> productList = new List <ProductInfo>(); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial"); productSearch.IsNew = RequestHelper.GetQueryString <int>("IsNew"); productSearch.IsHot = RequestHelper.GetQueryString <int>("IsHot"); productSearch.IsSale = (int)BoolType.True; productSearch.IsTop = RequestHelper.GetQueryString <int>("IsTop"); productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); productSearch.IsDelete = 0;//没有逻辑删除的商品 PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]); AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString(); productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count); BindControl(productList, RecordList, MyPager); } }
protected override void PageLoad() { base.PageLoad(); topNav = 1; IPHostEntry ipHost = System.Net.Dns.GetHostEntry(Dns.GetHostName());// Dns.Resolve(Dns.GetHostName()); ; foreach (IPAddress ipa in ipHost.AddressList) { if (ipa.AddressFamily.ToString() == "InterNetwork") { localIP = ipa.ToString(); } } //IPAddress ipaddress = ipHost.AddressList[0]; //localIP = ipaddress.ToString(); //imageList = AdImageBLL.ReadList(); //ProductBrandBLL.ReadList( proBranInfo = ProductBrandBLL.ReadList(); List <AdImageInfo> flashList = AdImageBLL.ReadList(6); int count = 0; //likeProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { ProductOrderType = "LikeNum", IsSale = (int)BoolType.True }, ref count); artListInfo = ArticleBLL.SearchList(1, 4, new ArticleSearchInfo { ClassId = "|58|" }, ref count); topnewsList = ArticleBLL.SearchList(1, 5, new ArticleSearchInfo { ClassId = "|38|", IsTop = (int)BoolType.True }, ref count); topylzcList = ArticleBLL.SearchList(1, 6, new ArticleSearchInfo { ClassId = "|47|", IsTop = (int)BoolType.True }, ref count); //newProductList = ProductBLL.SearchList(1, 5, new ProductSearchInfo { IsNew = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //hotProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsHot = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //specialProductList = ProductBLL.SearchList(1, 10, new ProductSearchInfo { IsSpecial = (int)BoolType.True, IsTop = (int)BoolType.True, IsSale = (int)BoolType.True }, ref count); //textLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Text); //pictureLinkList = LinkBLL.ReadLinkCacheListByClass((int)LinkType.Picture); //在线咨询 if (RequestHelper.GetQueryString <string>("Action") == "AskOnline") { AskOnline(); } }
/// <summary> /// 根据首字符筛选品牌数量 /// </summary> /// <param name="firstLetter"></param> /// <returns></returns> protected int GetBrandCountByFirstLetter(string firstLetter) { List <ProductBrandInfo> proBrandList = new List <ProductBrandInfo>(); if (firstLetter == "+") { //其他,不是以字母开头的 Regex regChar = new Regex("^[a-z]"); Regex regDChar = new Regex("^[A-Z]"); proBrandList = ProductBrandBLL.ReadList().Where(k => !regChar.IsMatch(k.Spelling)).Where(k => !regDChar.IsMatch(k.Spelling)).OrderBy(k => k.Spelling).ToList(); } else { //以字母开头的 proBrandList = ProductBrandBLL.ReadList().Where(k => k.Spelling.ToLower().StartsWith(firstLetter.ToLower())).OrderBy(k => k.Spelling).ToList(); } return(proBrandList.Count); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.RelationClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); List <ProductBrandInfo> list = ProductBrandBLL.ReadProductBrandCacheList(); this.RelationBrandID.DataSource = list; this.RelationBrandID.DataTextField = "Name"; this.RelationBrandID.DataValueField = "ID"; this.RelationBrandID.DataBind(); this.RelationBrandID.Items.Insert(0, new ListItem("选择品牌", string.Empty)); } }
protected void BindClassBrandAttributeClassStandardType() { List <ProductBrandInfo> list = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataSource = list; this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("选择品牌", "0")); this.RelationBrandID.DataSource = list; this.RelationBrandID.DataTextField = "Name"; this.RelationBrandID.DataValueField = "ID"; this.RelationBrandID.DataBind(); this.RelationBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); this.AccessoryBrandID.DataSource = list; this.AccessoryBrandID.DataTextField = "Name"; this.AccessoryBrandID.DataValueField = "ID"; this.AccessoryBrandID.DataBind(); this.AccessoryBrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); List <ProductClassInfo> list2 = ProductClassBLL.ReadProductClassNamedList(); foreach (ProductClassInfo info in list2) { this.RelationClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); foreach (ProductClassInfo info in list2) { this.AccessoryClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.AttributeClassID.DataSource = AttributeClassBLL.ReadAttributeClassCacheList(); this.AttributeClassID.DataTextField = "Name"; this.AttributeClassID.DataValueField = "ID"; this.AttributeClassID.DataBind(); this.AttributeClassID.Items.Insert(0, new ListItem("请选择", "0")); foreach (ArticleClassInfo info2 in ArticleClassBLL.ReadArticleClassChildList(3)) { this.ArticleClassID.Items.Add(new ListItem(info2.ClassName, "|" + info2.ID + "|")); } this.ArticleClassID.Items.Insert(0, new ListItem(ArticleClassBLL.ReadArticleClassCache(3).ClassName, "|" + 3 + "|")); this.StandardType.DataSource = EnumHelper.ReadEnumList <ProductStandardType>(); this.StandardType.DataTextField = "ChineseName"; this.StandardType.DataValueField = "Value"; this.StandardType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { base.CheckAdminPower("ReadProductBrand", PowerCheckType.Single); ProductBrandInfo info = ProductBrandBLL.ReadProductBrandCache(queryString); this.Name.Text = info.Name; this.Logo.Text = info.Logo; this.Url.Text = info.Url; this.Description.Text = info.Description; this.IsTop.Text = info.IsTop.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { RelationClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); List <ProductBrandInfo> productBrandList = ProductBrandBLL.ReadList(); RelationBrandID.DataSource = productBrandList; RelationBrandID.DataTextField = "Name"; RelationBrandID.DataValueField = "ID"; RelationBrandID.DataBind(); RelationBrandID.Items.Insert(0, new ListItem("选择品牌", string.Empty)); } }
protected void Page_Load(object sender, EventArgs e) { ClearCache(); int attributeClassID = RequestHelper.GetQueryString <int>("AttributeClassID"); int proTypeID = ProductClassBLL.GetProductClassType(attributeClassID); ProductTypeInfo aci = ProductTypeBLL.Read(proTypeID); if (aci.Id > 0) { string[] strArr = aci.BrandIds.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); int[] intArr = Array.ConvertAll <string, int>(strArr, s => int.Parse(s)); productBrandList = ProductBrandBLL.ReadList(intArr); } }
protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("id"); product = ProductBLL.Read(id); if (product.IsSale == (int)BoolType.False) { ScriptHelper.AlertFront("该产品未上市,不能查看"); } //如果为移动端单独设置了内容,则取移动端内容 if (!string.IsNullOrEmpty(product.Introduction1_Mobile)) { product.Introduction1 = product.Introduction1_Mobile; } if (!string.IsNullOrEmpty(product.Introduction2_Mobile)) { product.Introduction2 = product.Introduction2_Mobile; } if (!string.IsNullOrEmpty(product.Introduction3_Mobile)) { product.Introduction3 = product.Introduction3_Mobile; } //更新查看数量 Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("ViewCount", product.ViewCount + 1); ProductBLL.UpdatePart(ProductInfo.TABLENAME, dict, id); if (product.BrandId > 0) { productBrand = ProductBrandBLL.Read(product.BrandId); } productPhotoList = ProductPhotoBLL.ReadList(id, 0); attributeRecords = ProductTypeAttributeRecordBLL.ReadList(id); standardRecords = ProductTypeStandardRecordBLL.ReadList(id); //搜索优化 Title = product.Name; Keywords = string.IsNullOrEmpty(product.Keywords) ? product.Name : product.Keywords; Description = string.IsNullOrEmpty(product.Summary) ? StringHelper.Substring(StringHelper.KillHTML(product.Introduction1), 200) : product.Summary; }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadProduct", PowerCheckType.Single); foreach (ProductClassInfo info in ProductClassBLL.ReadProductClassNamedList()) { this.ClassID.Items.Add(new ListItem(info.ClassName, "|" + info.ID + "|")); } this.ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); this.BrandID.DataSource = ProductBrandBLL.ReadProductBrandCacheList(); this.BrandID.DataTextField = "Name"; this.BrandID.DataValueField = "ID"; this.BrandID.DataBind(); this.BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); this.ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); this.BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); this.Key.Text = RequestHelper.GetQueryString <string>("Key"); this.StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); this.EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); this.IsSpecial.Text = RequestHelper.GetQueryString <string>("IsSpecial"); this.IsNew.Text = RequestHelper.GetQueryString <string>("IsNew"); this.IsHot.Text = RequestHelper.GetQueryString <string>("IsHot"); this.IsTop.Text = RequestHelper.GetQueryString <string>("IsTop"); List <ProductInfo> dataSource = new List <ProductInfo>(); ProductSearchInfo product = new ProductSearchInfo(); product.Key = RequestHelper.GetQueryString <string>("Key"); product.ClassID = RequestHelper.GetQueryString <string>("ClassID"); product.InBrandID = RequestHelper.GetQueryString <string>("BrandID"); product.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial"); product.IsNew = RequestHelper.GetQueryString <int>("IsNew"); product.IsHot = RequestHelper.GetQueryString <int>("IsHot"); product.IsSale = 1; product.IsTop = RequestHelper.GetQueryString <int>("IsTop"); product.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); product.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); base.PageSize = 10; dataSource = ProductBLL.SearchProductList(base.CurrentPage, base.PageSize, product, ref this.Count); base.BindControl(dataSource, this.RecordList, this.MyPager); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadProductBrand", PowerCheckType.Single); string queryString = RequestHelper.GetQueryString <string>("Action"); int id = RequestHelper.GetQueryString <int>("ID"); if ((id != 0) && (queryString != string.Empty)) { base.CheckAdminPower("UpdateProductBrand", PowerCheckType.Single); ChangeAction up = ChangeAction.Up; if (queryString == "down") { up = ChangeAction.Down; } ProductBrandBLL.ChangeProductBrandOrder(up, id); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("MoveRecord"), ShopLanguage.ReadLanguage("ProductBrand"), id); } base.BindControl(ProductBrandBLL.ReadProductBrandCacheList(), this.RecordList); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("StatisticsSale", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "Id"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Name.Text = RequestHelper.GetQueryString <string>("Name"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); UserName.Text = RequestHelper.GetQueryString <string>("UserName"); OrderNumber.Text = RequestHelper.GetQueryString <string>("OrderNumber"); ProductSearchInfo productSearch = new ProductSearchInfo(); OrderSearchInfo orderSearch = new OrderSearchInfo(); productSearch.IsSale = (int)BoolType.True; productSearch.Name = RequestHelper.GetQueryString <string>("Name"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.InProductId = RequestHelper.GetQueryString <string>("ProductID"); orderSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); orderSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); orderSearch.UserName = RequestHelper.GetQueryString <string>("UserName"); orderSearch.OrderNumber = RequestHelper.GetQueryString <string>("OrderNumber"); BindControl(OrderDetailBLL.StatisticsSaleDetail(CurrentPage, PageSize, orderSearch, productSearch, ref Count), RecordList, MyPager); } }
/// <summary> /// 提交按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitButton_Click(object sender, EventArgs e) { ProductBrandInfo productBrand = new ProductBrandInfo(); productBrand.Id = RequestHelper.GetQueryString <int>("ID"); productBrand.Name = Name.Text; var _brand = ProductBrandBLL.Read(productBrand.Name); if ((productBrand.Id > 0 && _brand.Id > 0 && _brand.Id != productBrand.Id) || (productBrand.Id <= 0 && _brand.Id > 0)) { ScriptHelper.Alert("该品牌已存在,请重新输入", RequestHelper.RawUrl); } else { productBrand.ImageUrl = Logo.Text; productBrand.LinkUrl = Url.Text; productBrand.Remark = Description.Text; productBrand.IsTop = Convert.ToInt32(IsTop.Checked); productBrand.OrderId = Convert.ToInt32(OrderID.Text); string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (productBrand.Id == int.MinValue) { CheckAdminPower("AddProductBrand", PowerCheckType.Single); productBrand.Spelling = ChineseCharacterHelper.GetChineseSpell(Name.Text.Trim()); int id = ProductBrandBLL.Add(productBrand); AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ProductBrand"), id); } else { CheckAdminPower("UpdateProductBrand", PowerCheckType.Single); productBrand.Spelling = Spelling.Text; ProductBrandBLL.Update(productBrand); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ProductBrand"), productBrand.Id); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl); } }
/// <summary> /// 页面加载方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckAdminPower("ReadProduct", PowerCheckType.Single); foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList()) { ClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|")); } ClassID.Items.Insert(0, new ListItem("所有分类", string.Empty)); BrandID.DataSource = ProductBrandBLL.ReadList(); BrandID.DataTextField = "Name"; BrandID.DataValueField = "ID"; BrandID.DataBind(); BrandID.Items.Insert(0, new ListItem("所有品牌", string.Empty)); ClassID.Text = RequestHelper.GetQueryString <string>("ClassID"); BrandID.Text = RequestHelper.GetQueryString <string>("BrandID"); Key.Text = RequestHelper.GetQueryString <string>("Key"); StartAddDate.Text = RequestHelper.GetQueryString <string>("StartAddDate"); EndAddDate.Text = RequestHelper.GetQueryString <string>("EndAddDate"); ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = RequestHelper.GetQueryString <string>("Key"); productSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID"); productSearch.BrandId = RequestHelper.GetQueryString <int>("BrandID"); productSearch.IsSale = 2;//草稿 productSearch.StartAddDate = RequestHelper.GetQueryString <DateTime>("StartAddDate"); productSearch.EndAddDate = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndAddDate")); productSearch.IsDelete = 0;//没有逻辑删除的商品 PageSize = 10; List <ProductInfo> productList = ProductBLL.SearchList(CurrentPage, PageSize, productSearch, ref Count); BindControl(productList, RecordList, MyPager); } }