protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId)) { base.GotoResourceNotFound(""); } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.litBrandDetail = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandDetail"); this.txtTotal = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.BrandId); this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description); this.imgUrl.ImageUrl = brandCategory.Logo; int pageNumber; if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber)) { pageNumber = 1; } int maxNum; if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum)) { maxNum = 20; } int num; this.rptProducts.DataSource = ProductBrowser.GetBrandProducts(MemberProcessor.GetCurrentMember(), new int?(this.BrandId), pageNumber, maxNum, out num); this.rptProducts.DataBind(); this.txtTotal.SetWhenIsNotNull(num.ToString()); PageTitle.AddSiteNameTitle("品牌详情"); }
private BrandCategoryInfo GetBrandCategoryInfo() { BrandCategoryInfo info = new BrandCategoryInfo { BrandId = this.brandId }; if (this.ViewState["Logo"] != null) { info.Logo = (string)this.ViewState["Logo"]; } info.BrandName = Globals.HtmlEncode(this.txtBrandName.Text.Trim()); if (!string.IsNullOrEmpty(this.txtCompanyUrl.Text)) { info.CompanyUrl = this.txtCompanyUrl.Text.Trim(); } else { info.CompanyUrl = null; } info.RewriteName = Globals.HtmlEncode(this.txtReUrl.Text.Trim()); info.MetaKeywords = Globals.HtmlEncode(this.txtkeyword.Text.Trim()); info.MetaDescription = Globals.HtmlEncode(this.txtMetaDescription.Text.Trim()); info.Description = ((!string.IsNullOrEmpty(this.fckDescription.Text) && this.fckDescription.Text.Length > 0) ? this.fckDescription.Text : null); System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); foreach (System.Web.UI.WebControls.ListItem item in this.chlistProductTypes.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } info.ProductTypes = list; return(info); }
private void btnSave_Click(object sender, EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (!string.IsNullOrEmpty(this.uploader1.UploadedImageUrl.ToString())) { brandCategoryInfo.Logo = this.uploader1.UploadedImageUrl; } else { this.ShowMsg("请选择图片上传!", false); return; } if (string.IsNullOrEmpty(brandCategoryInfo.BrandName)) { this.ShowMsg("请输入品牌名称!", false); } else if (string.IsNullOrEmpty(brandCategoryInfo.Description)) { this.ShowMsg("请输入品牌介绍!", false); } else if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/Goods/BrandCategories.aspx"), true); } else { this.ShowMsg("添加品牌分类失败", true); } }
private BrandCategoryInfo GetBrandCategoryInfo() { BrandCategoryInfo brandCategoryInfo = new BrandCategoryInfo(); brandCategoryInfo.BrandName = Globals.HtmlEncode(this.txtBrandName.Text.Trim()); if (!string.IsNullOrEmpty(this.txtCompanyUrl.Text)) { brandCategoryInfo.CompanyUrl = this.txtCompanyUrl.Text.Trim(); } else { brandCategoryInfo.CompanyUrl = null; } brandCategoryInfo.RewriteName = Globals.HtmlEncode(this.txtReUrl.Text.Trim()); brandCategoryInfo.MetaKeywords = Globals.HtmlEncode(this.txtkeyword.Text.Trim()); brandCategoryInfo.MetaDescription = Globals.HtmlEncode(this.txtMetaDescription.Text.Trim()); System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); foreach (System.Web.UI.WebControls.ListItem listItem in this.chlistProductTypes.Items) { if (listItem.Selected) { list.Add(int.Parse(listItem.Value)); } } brandCategoryInfo.ProductTypes = list; brandCategoryInfo.Description = ((string.IsNullOrEmpty(this.fckDescription.Text) || this.fckDescription.Text.Length <= 0) ? null : this.fckDescription.Text); return(brandCategoryInfo); }
protected void btnAddBrandCategory_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (string.IsNullOrEmpty(this.uploader1.UploadedImageUrl.ToString())) { this.ShowMsg("请上传图片!", false); return; } brandCategoryInfo.Logo = this.uploader1.UploadedImageUrl; if (string.IsNullOrEmpty(brandCategoryInfo.BrandName)) { this.ShowMsg("请输入品牌名称!", false); return; } if (string.IsNullOrEmpty(brandCategoryInfo.Description)) { this.ShowMsg("请输入品牌介绍!", false); return; } if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { this.txtBrandName.Text = ""; this.txtCompanyUrl.Text = ""; this.txtkeyword.Text = ""; this.txtMetaDescription.Text = ""; this.txtReUrl.Text = ""; this.fckDescription.Text = ""; this.ShowMsg("成功添加品牌分类", true); return; } this.ShowMsg("添加品牌分类失败", true); }
private void loadData() { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.brandId); if (brandCategory == null) { base.GotoResourceNotFound(); } else { this.ViewState["Logo"] = brandCategory.Logo; foreach (ListItem item in this.chlistProductTypes.Items) { if (brandCategory.ProductTypes.Contains(int.Parse(item.Value))) { item.Selected = true; } } this.txtBrandName.Text = Globals.HtmlDecode(brandCategory.BrandName); this.txtCompanyUrl.Text = brandCategory.CompanyUrl; this.txtReUrl.Text = Globals.HtmlDecode(brandCategory.RewriteName); this.txtkeyword.Text = Globals.HtmlDecode(brandCategory.MetaKeywords); this.txtMetaDescription.Text = Globals.HtmlDecode(brandCategory.MetaDescription); this.fckDescription.Text = brandCategory.Description; this.hidOldImages.Value = brandCategory.Logo; } }
private void btnSave_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (this.fileUpload.HasFile) { try { brandCategoryInfo.Logo = CatalogHelper.UploadBrandCategorieImage(this.fileUpload.PostedFile); } catch { this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } if (!this.ValidationBrandCategory(brandCategoryInfo)) { return; } if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/BrandCategories.aspx"), true); return; } this.ShowMsg("添加品牌分类失败", true); return; } else { this.ShowMsg("请上传一张品牌logo图片", false); } }
protected void btnAddBrandCategory_Click(object sender, EventArgs e) { BrandCategoryInfo brandCategoryInfo = GetBrandCategoryInfo(); if (fileUpload.HasFile) { try { brandCategoryInfo.Logo = CatalogHelper.UploadBrandCategorieImage(fileUpload.PostedFile); } catch { ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } } if (ValidationBrandCategory(brandCategoryInfo)) { if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { ShowMsg("成功添加品牌分类", true); } else { ShowMsg("添加品牌分类失败", true); } } }
private BrandCategoryInfo GetBrandCategoryInfo() { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.brandId); brandCategory.BrandName = Globals.HtmlEncode(Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtBrandName.Text.Trim())).Replace("\\", "")); if (!string.IsNullOrEmpty(this.txtCompanyUrl.Text)) { brandCategory.CompanyUrl = this.txtCompanyUrl.Text.Trim(); } else { brandCategory.CompanyUrl = null; } brandCategory.RewriteName = Globals.HtmlEncode(this.txtReUrl.Text.Trim()); brandCategory.MetaKeywords = Globals.HtmlEncode(Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtkeyword.Text.Trim())).Replace("\\", "")); brandCategory.MetaDescription = Globals.HtmlEncode(Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtMetaDescription.Text.Trim())).Replace("\\", "")); brandCategory.Description = ((!string.IsNullOrEmpty(this.fckDescription.Text) && this.fckDescription.Text.Length > 0) ? this.fckDescription.Text : null); IList <int> list = new List <int>(); foreach (ListItem item in this.chlistProductTypes.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } brandCategory.ProductTypes = list; return(brandCategory); }
protected void btnAddBrandCategory_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (this.fileUpload.HasFile) { try { brandCategoryInfo.Logo = CatalogHelper.UploadBrandCategorieImage(this.fileUpload.PostedFile); } catch { this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } if (!this.ValidationBrandCategory(brandCategoryInfo)) { return; } if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { this.ShowMsg("成功添加品牌分类", true); return; } this.ShowMsg("添加品牌分类失败", true); return; } else { this.ShowMsg("请上传一张品牌logo图片", false); } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId)) { base.GotoResourceNotFound(""); } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptProducts"); this.litBrandDetail = (Literal)this.FindControl("litBrandDetail"); this.txtTotal = (HtmlInputHidden)this.FindControl("txtTotal"); BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.BrandId); this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description); this.imgUrl.ImageUrl = brandCategory.Logo; int pageNumber = default(int); if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber)) { pageNumber = 1; } int maxNum = default(int); if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum)) { maxNum = 20; } DbQueryResult brandProducts = ProductBrowser.GetBrandProducts(this.BrandId, pageNumber, maxNum); this.rptProducts.DataSource = brandProducts.Data; this.rptProducts.DataBind(); this.txtTotal.SetWhenIsNotNull(brandProducts.TotalRecords.ToString()); PageTitle.AddSiteNameTitle("品牌详情"); }
private void loadData() { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.brandId); if (brandCategory == null) { base.GotoResourceNotFound(); } else { this.ViewState["Logo"] = brandCategory.Logo; foreach (System.Web.UI.WebControls.ListItem item in this.chlistProductTypes.Items) { if (brandCategory.ProductTypes.Contains(int.Parse(item.Value))) { item.Selected = true; } } this.txtBrandName.Text = Globals.HtmlDecode(brandCategory.BrandName); this.txtCompanyUrl.Text = brandCategory.CompanyUrl; this.txtReUrl.Text = Globals.HtmlDecode(brandCategory.RewriteName); this.txtkeyword.Text = Globals.HtmlDecode(brandCategory.MetaKeywords); this.txtMetaDescription.Text = Globals.HtmlDecode(brandCategory.MetaDescription); this.fckDescription.Text = brandCategory.Description; if (string.IsNullOrEmpty(brandCategory.Logo)) { this.btnDeleteLogo.Visible = false; } else { this.btnDeleteLogo.Visible = true; } this.imgLogo.ImageUrl = brandCategory.Logo; } }
public int AddBrandCategory(BrandCategoryInfo brandCategory) { DbCommand sqlStringCommand = this.database.GetSqlStringCommand("DECLARE @DisplaySequence AS INT SELECT @DisplaySequence = (CASE WHEN MAX(DisplaySequence) IS NULL THEN 1 ELSE MAX(DisplaySequence) + 1 END) FROM Ecshop_BrandCategories;INSERT INTO Ecshop_BrandCategories(BrandName, Logo, BigLogo,CompanyUrl,RewriteName,MetaKeywords,MetaDescription, Description, DisplaySequence) VALUES(@BrandName, @Logo,@BigLogo, @CompanyUrl,@RewriteName,@MetaKeywords,@MetaDescription, @Description, @DisplaySequence); SELECT @@IDENTITY"); this.database.AddInParameter(sqlStringCommand, "BrandName", DbType.String, brandCategory.BrandName); this.database.AddInParameter(sqlStringCommand, "Logo", DbType.String, brandCategory.Logo); this.database.AddInParameter(sqlStringCommand, "BigLogo", DbType.String, brandCategory.BigLogo); this.database.AddInParameter(sqlStringCommand, "CompanyUrl", DbType.String, brandCategory.CompanyUrl); this.database.AddInParameter(sqlStringCommand, "RewriteName", DbType.String, brandCategory.RewriteName); this.database.AddInParameter(sqlStringCommand, "MetaKeywords", DbType.String, brandCategory.MetaKeywords); this.database.AddInParameter(sqlStringCommand, "MetaDescription", DbType.String, brandCategory.MetaDescription); this.database.AddInParameter(sqlStringCommand, "Description", DbType.String, brandCategory.Description); object obj = this.database.ExecuteScalar(sqlStringCommand); int result; if (obj != null) { result = Convert.ToInt32(obj); } else { result = 0; } return(result); }
protected void btnUpdateBrandCategory_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (string.IsNullOrEmpty(brandCategoryInfo.Logo)) { this.ShowMsg("请上传一张品牌LOGO图片", false); return; } if (string.IsNullOrEmpty(brandCategoryInfo.BrandName)) { this.ShowMsg("请输入品牌名称!", false); return; } if (string.IsNullOrEmpty(brandCategoryInfo.Description)) { this.ShowMsg("请输入品牌介绍!", false); return; } if (CatalogHelper.UpdateBrandCategory(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/Goods/BrandCategories.aspx"), true); return; } this.ShowMsg("编辑品牌分类失败", true); }
private void btnSave_Click(object sender, EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (this.hidUploadImages.Value.Trim().Length > 0) { try { string value = brandCategoryInfo.Logo = this.UploadImage(); this.hidOldImages.Value = value; } catch { this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } if (this.ValidationBrandCategory(brandCategoryInfo)) { if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/BrandCategories.aspx"), true); } else { this.ShowMsg("添加品牌分类失败", true); } } } else { this.ShowMsg("请上传一张品牌logo图片", false); } }
protected void btnAddBrandCategory_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (this.fileUpload.HasFile) { try { brandCategoryInfo.Logo = CatalogHelper.UploadBrandCategorieImage(this.fileUpload.PostedFile); } catch { this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } } if (this.ValidationBrandCategory(brandCategoryInfo)) { if (CatalogHelper.AddBrandCategory(brandCategoryInfo)) { this.txtBrandName.Text = ""; this.txtCompanyUrl.Text = ""; this.txtkeyword.Text = ""; this.txtMetaDescription.Text = ""; this.txtReUrl.Text = ""; this.fckDescription.Text = ""; this.ShowMsg("成功添加品牌分类", true); } else { this.ShowMsg("添加品牌分类失败", true); } } }
private BrandCategoryInfo GetBrandCategoryInfo() { BrandCategoryInfo info = new BrandCategoryInfo { BrandName = Globals.HtmlEncode(this.txtBrandName.Text.Trim()) }; if (!string.IsNullOrEmpty(this.txtCompanyUrl.Text)) { info.CompanyUrl = this.txtCompanyUrl.Text.Trim(); } else { info.CompanyUrl = null; } info.RewriteName = Globals.HtmlEncode(this.txtReUrl.Text.Trim()); info.MetaKeywords = Globals.HtmlEncode(this.txtkeyword.Text.Trim()); info.MetaDescription = Globals.HtmlEncode(this.txtMetaDescription.Text.Trim()); IList <int> list = new List <int>(); foreach (ListItem item in this.chlistProductTypes.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } info.ProductTypes = list; info.wid = this.wid; info.Description = (!string.IsNullOrEmpty(this.fckDescription.Text) && (this.fckDescription.Text.Length > 0)) ? this.fckDescription.Text : null; return(info); }
public BrandDetails() { int.TryParse(this.Page.Request.QueryString["brandId"], out this.brandId); BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.brandId); if (((brandCategory != null) && !string.IsNullOrEmpty(brandCategory.Theme)) && File.Exists(HiContext.Current.Context.Request.MapPath(HiContext.Current.GetSkinPath() + "/brandcategorythemes/" + brandCategory.Theme))) { this.SkinName = "/brandcategorythemes/" + brandCategory.Theme; } }
public static bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { bool result; if ((result = ProductProvider.Instance().UpdateBrandCategory(brandCategory)) && ProductProvider.Instance().DeleteBrandProductTypes(brandCategory.BrandId)) { ProductProvider.Instance().AddBrandProductTypes(brandCategory.BrandId, brandCategory.ProductTypes); } return(result); }
public static bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { bool flag = ProductProvider.Instance().UpdateBrandCategory(brandCategory); if (flag && ProductProvider.Instance().DeleteBrandProductTypes(brandCategory.BrandId)) { ProductProvider.Instance().AddBrandProductTypes(brandCategory.BrandId, brandCategory.ProductTypes); } return(flag); }
public static bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { bool flag = new BrandCategoryDao().UpdateBrandCategory(brandCategory); if (flag && new BrandCategoryDao().DeleteBrandProductTypes(brandCategory.BrandId)) { new BrandCategoryDao().AddBrandProductTypes(brandCategory.BrandId, brandCategory.ProductTypes); } return(flag); }
public static bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { bool flag = (new BrandCategoryDao()).UpdateBrandCategory(brandCategory); if ((!flag ? false : (new BrandCategoryDao()).DeleteBrandProductTypes(brandCategory.BrandId))) { (new BrandCategoryDao()).AddBrandProductTypes(brandCategory.BrandId, brandCategory.ProductTypes); } return(flag); }
public static bool AddBrandCategory(BrandCategoryInfo brandCategory) { BrandCategoryDao brandCategoryDao = new BrandCategoryDao(); int num = brandCategoryDao.AddBrandCategory(brandCategory); if (num > 0 && brandCategory.ProductTypes.Count > 0) { brandCategoryDao.AddBrandProductTypes(num, brandCategory.ProductTypes); } return(true); }
public static bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { BrandCategoryDao brandCategoryDao = new BrandCategoryDao(); bool flag = brandCategoryDao.Update(brandCategory, null); if (flag && brandCategoryDao.DeleteBrandProductTypes(brandCategory.BrandId)) { brandCategoryDao.AddBrandProductTypes(brandCategory.BrandId, brandCategory.ProductTypes); } return(flag); }
protected override void AttachChildControls() { this.litBrandName = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandName"); this.litBrandRemark = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandRemark"); this.rptProducts = (ThemedTemplatedRepeater)this.FindControl("rptProducts"); this.pager = (Pager)this.FindControl("pager"); this.cutdownSearch = (Common_CutdownSearch)this.FindControl("search_Common_CutdownSearch"); this.btnSortPrice = (Common_Search_SortPrice)this.FindControl("btn_Common_Search_SortPrice"); this.btnSortTime = (Common_Search_SortTime)this.FindControl("btn_Common_Search_SortTime"); this.btnSortPopularity = (Common_Search_SortPopularity)this.FindControl("btn_Common_Search_SortPopularity"); this.btnSortSaleCounts = (Common_Search_SortSaleCounts)this.FindControl("btn_Common_Search_SortSaleCounts"); this.cutdownSearch.ReSearch += new Common_CutdownSearch.ReSearchEventHandler(this.cutdownSearch_ReSearch); this.btnSortPrice.Sorting += new Common_Search_SortTime.SortingHandler(this.btnSortPrice_Sorting); this.btnSortTime.Sorting += new Common_Search_SortTime.SortingHandler(this.btnSortTime_Sorting); this.hotSale = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale");//销售排行 this.litSearchResultPage = (System.Web.UI.WebControls.Literal) this.FindControl("litSearchResultPage"); if (this.btnSortPopularity != null) { this.btnSortPopularity.Sorting += new Common_Search_SortPopularity.SortingHandler(this.btnSortPopularity_Sorting); } if (this.btnSortSaleCounts != null) { this.btnSortSaleCounts.Sorting += new Common_Search_SortSaleCounts.SortingHandler(this.btnSortSaleCounts_Sorting); } if (this.hotSale != null) { int cid = 0; int brandId = 0; if (!string.IsNullOrEmpty(this.Page.Request.QueryString["categoryId"])) { int.TryParse(this.Page.Request.QueryString["categoryId"], out cid); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["brand"])) { int.TryParse(this.Page.Request.QueryString["brand"], out brandId); } this.hotSale.DataSource = ProductBrowser.GetBrowseHotProductList(cid, brandId).DBHotSale; this.hotSale.DataBind(); } if (!this.Page.IsPostBack) { BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.brandId); if (brandCategory == null) { this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该品牌已经不存在")); return; } this.LoadCategoryHead(brandCategory); this.litBrandName.Text = brandCategory.BrandName; this.litBrandRemark.Text = brandCategory.Description; PageTitle.AddSiteNameTitle(brandCategory.BrandName); this.BindBrandProduct(); } }
public static bool AddBrandCategory(BrandCategoryInfo brandCategory) { BrandCategoryDao brandCategoryDao = new BrandCategoryDao(); brandCategory.DisplaySequence = brandCategoryDao.GetMaxDisplaySequence <BrandCategoryInfo>(); int num = (int)brandCategoryDao.Add(brandCategory, null); if (num > 0 && brandCategory.ProductTypes.Count > 0) { brandCategoryDao.AddBrandProductTypes(num, brandCategory.ProductTypes); } return(true); }
public BrandDetails() { if (!int.TryParse(base.GetParameter("brandId", false), out this.brandId)) { base.GotoResourceNotFound(); } BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.brandId); if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Theme) && File.Exists(HiContext.Current.Context.Request.MapPath(HiContext.Current.GetSkinPath() + "/brandcategorythemes/" + brandCategory.Theme))) { this.SkinName = "/brandcategorythemes/" + brandCategory.Theme; } }
public BrandDetails() { if (!int.TryParse(this.Page.Request.QueryString["brandId"], out this.brandId)) { base.GotoResourceNotFound(); } BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.brandId); if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Theme) && System.IO.File.Exists(Hidistro.Membership.Context.HiContext.Current.Context.Request.MapPath(Hidistro.Membership.Context.HiContext.Current.GetSkinPath() + "/brandcategorythemes/" + brandCategory.Theme))) { this.SkinName = "/brandcategorythemes/" + brandCategory.Theme; } }
public bool UpdateBrandCategory(BrandCategoryInfo brandCategory) { System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("UPDATE Hishop_BrandCategories SET BrandName = @BrandName, Logo = @Logo, CompanyUrl = @CompanyUrl,RewriteName=@RewriteName,MetaKeywords=@MetaKeywords,MetaDescription=@MetaDescription, Description = @Description WHERE BrandId = @BrandId"); this.database.AddInParameter(sqlStringCommand, "BrandId", System.Data.DbType.Int32, brandCategory.BrandId); this.database.AddInParameter(sqlStringCommand, "BrandName", System.Data.DbType.String, brandCategory.BrandName); this.database.AddInParameter(sqlStringCommand, "Logo", System.Data.DbType.String, brandCategory.Logo); this.database.AddInParameter(sqlStringCommand, "CompanyUrl", System.Data.DbType.String, brandCategory.CompanyUrl); this.database.AddInParameter(sqlStringCommand, "RewriteName", System.Data.DbType.String, brandCategory.RewriteName); this.database.AddInParameter(sqlStringCommand, "MetaKeywords", System.Data.DbType.String, brandCategory.MetaKeywords); this.database.AddInParameter(sqlStringCommand, "MetaDescription", System.Data.DbType.String, brandCategory.MetaDescription); this.database.AddInParameter(sqlStringCommand, "Description", System.Data.DbType.String, brandCategory.Description); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
public static bool AddBrandCategory(BrandCategoryInfo brandCategory) { int brandId = new BrandCategoryDao().AddBrandCategory(brandCategory); if (brandId <= 0) { return(false); } if (brandCategory.ProductTypes.Count > 0) { new BrandCategoryDao().AddBrandProductTypes(brandId, brandCategory.ProductTypes); } return(true); }