protected void btnaddtag_Click(object sender, System.EventArgs e) { string str = Globals.HtmlEncode(this.txtaddtagname.Text.Trim()); if (string.IsNullOrEmpty(str)) { this.ShowMsg("标签名称不允许为空!", false); } else { if (CatalogHelper.AddTags(str) > 0) { this.ShowMsg("添加商品标签成功!", true); this.ProductTagsBind(); } else { this.ShowMsg("添加商品标签失败,请确认是否存在重名标签名称", false); } } }
protected void grdBrandCategriesList_RowDeleting(object sender, GridViewDeleteEventArgs e) { int brandId = (int)this.grdBrandCategriesList.DataKeys[e.RowIndex].Value; if (CatalogHelper.BrandHvaeProducts(brandId)) { this.ShowMsg("选择的品牌分类下还有商品,删除失败", false); } else { if (CatalogHelper.DeleteBrandCategory(brandId)) { this.ShowMsg("成功删除品牌分类", true); } else { this.ShowMsg("删除品牌分类失败", false); } this.BindBrandCategories(); } }
public override void DataBind() { this.Items.Clear(); this.Items.Add(new ListItem(base.NullToDisplay, string.Empty)); if (base.IsTopCategory) { IList <CategoryInfo> list = CatalogHelper.GetMainCategories(); foreach (CategoryInfo current in list) { this.Items.Add(new ListItem(Globals.HtmlDecode(current.Name), current.CategoryId.ToString())); } } else { IList <CategoryInfo> list = CatalogHelper.GetSequenceCategories(); for (int i = 0; i < list.Count; i++) { this.Items.Add(new ListItem(this.FormatDepth(list[i].Depth, Globals.HtmlDecode(list[i].Name)), list[i].CategoryId.ToString(CultureInfo.InvariantCulture))); } } }
protected void Page_Load(object sender, System.EventArgs e) { if (string.IsNullOrEmpty(this.Page.Request.QueryString["ThemName"])) { base.GotoResourceNotFound(); return; } this.themName = base.Request.QueryString["ThemName"]; this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); if (!base.IsPostBack) { this.dropSystemPageDropDownList.DataBind(); this.listProductCategories.DataBind(); this.listBrandCategories.DataBind(); this.radProductTags.DataSource = CatalogHelper.GetTags(); this.radProductTags.DataTextField = "TagName"; this.radProductTags.DataValueField = "TagID"; this.radProductTags.DataBind(); this.radProductTags.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--任意--", "0")); } }
private void btnSaveCategory_Click(object sender, System.EventArgs e) { if (!this.dropCategoryFrom.SelectedValue.HasValue || !this.dropCategoryTo.SelectedValue.HasValue) { this.ShowMsgToTarget("请选择需要转移商品的分类或需要转移至的商品分类!", false, "parent"); return; } if (this.dropCategoryFrom.SelectedValue.Value == this.dropCategoryTo.SelectedValue.Value) { this.ShowMsgToTarget("请选择不同的商品分类进行转移!", false, "parent"); return; } if (CatalogHelper.DisplaceCategory(this.dropCategoryFrom.SelectedValue.Value, this.dropCategoryTo.SelectedValue.Value) == 0) { this.ShowMsgToTarget("此分类下没有可以转移的商品!", false, "parent"); return; } HiCache.Remove("DataCache-Categories"); HiCache.Remove("DataCache-CategoryList"); this.ShowMsgToTarget("商品批量转移成功!", true, "parent"); }
public override void DataBind() { this.Items.Clear(); ProductQuery query = new ProductQuery(); query.Keywords = this.productName; query.ProductCode = this.productCode; query.CategoryId = this.categoryId; query.SaleStatus = ProductSaleStatus.OnSale; if (this.categoryId.HasValue) { query.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } DataTable groupBuyProducts = ProductHelper.GetGroupBuyProducts(query); base.Items.Add(new ListItem("--请选择--", string.Empty)); foreach (DataRow row in groupBuyProducts.Rows) { base.Items.Add(new ListItem(row["ProductName"].ToString(), row["ProductId"].ToString())); } }
protected void grdUnitList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { ManagerHelper.CheckPrivilege(Privilege.UnitsDelete); int UnitId = (int)this.grdUnitList.DataKeys[e.RowIndex].Value; var member = HiContext.Current.User; if (member == null || member.IsLockedOut) { return; } if (CatalogHelper.DeleteUnit(UnitId, member.Username + "_" + member.UserId)) { this.ShowMsg("成功删除计量单位", true); } else { this.ShowMsg("删除计量单位失败", false); } this.BindUnits(); }
private void BindProducts() { ProductQuery productQuery = new ProductQuery(); productQuery.Keywords = this.keywords; productQuery.CategoryId = this.categoryId; if (this.categoryId.HasValue) { productQuery.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } productQuery.PageSize = 10; productQuery.PageIndex = this.pager.PageIndex; productQuery.SaleStatus = ProductSaleStatus.OnSale; productQuery.SortOrder = SortAction.Desc; productQuery.SortBy = "DisplaySequence"; DbQueryResult products = ProductHelper.GetProducts(productQuery); this.dlstProducts.DataSource = products.Data; this.dlstProducts.DataBind(); this.pager.TotalRecords = products.TotalRecords; }
private void btnUpoad_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (this.fileUpload.HasFile) { try { ResourcesHelper.DeleteImage(brandCategoryInfo.Logo); brandCategoryInfo.Logo = CatalogHelper.UploadBrandCategorieImage(this.fileUpload.PostedFile); this.ViewState["Logo"] = brandCategoryInfo.Logo; } catch { this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false); return; } CatalogHelper.UpdateBrandCategory(brandCategoryInfo); } this.loadData(); }
protected void DoCallback() { this.LoadParameters(); ProductQuery productQuery = new ProductQuery(); productQuery.PageSize = this.pager.PageSize; productQuery.PageIndex = this.pager.PageIndex; productQuery.SaleStatus = ProductSaleStatus.All; //下架、出售中、仓库中的商品 productQuery.MulSaleStatus = "1,2,3"; productQuery.IsIncludePromotionProduct = new bool?(false); productQuery.Keywords = this.productName; if (this.brandId.HasValue) { productQuery.BrandId = new int?(this.brandId.Value); } productQuery.CategoryId = this.categoryId; if (this.categoryId.HasValue) { productQuery.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } productQuery.IsIncludeBundlingProduct = new bool?(false); productQuery.SaleType = 1; productQuery.HasStock = true; DbQueryResult products = ProductHelper.GetProducts(productQuery); this.pager1.TotalRecords = (this.pager.TotalRecords = products.TotalRecords); //System.Data.DataTable dataSource = (System.Data.DataTable)products.Data; //DataRow[] rows = dataSource.Select(" stock > 0 "); //DataTable dt = dataSource.Clone(); //for (int i = 0; i < rows.Length; i++) //{ // dt.ImportRow(rows[i]); //} this.rp_bindproduct.DataSource = products.Data; this.rp_bindproduct.DataBind(); }
private void DoCallback() { base.Response.Clear(); base.Response.ContentType = "application/json"; string str = base.Request.QueryString["action"]; if (str.Equals("getGroupBuyProducts")) { ProductQuery query = new ProductQuery(); if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { int num; int.TryParse(base.Request.QueryString["categoryId"], out num); if (num > 0) { query.CategoryId = new int?(num); query.MaiCategoryPath = CatalogHelper.GetCategory(num).Path; } } string str2 = base.Request.QueryString["sku"]; string str3 = base.Request.QueryString["productName"]; query.Keywords = str3; query.ProductCode = str2; query.SaleStatus = ProductSaleStatus.OnSale; DataTable groupBuyProducts = ProductHelper.GetGroupBuyProducts(query); if ((groupBuyProducts == null) || (groupBuyProducts.Rows.Count == 0)) { base.Response.Write("{\"Status\":\"0\"}"); } else { StringBuilder builder = new StringBuilder(); builder.Append("{\"Status\":\"OK\","); builder.AppendFormat("\"Product\":[{0}]", this.GenerateBrandString(groupBuyProducts)); builder.Append("}"); base.Response.Write(builder.ToString()); } } base.Response.End(); }
private int UpDateUnrecExp(DataTable dtUnrecExpUpdate, DataRow drUpdated, MySqlConnection masterConnection, Unrecexp expression) { int DelCount = 0; if (!Convert.IsDBNull(drUpdated["UEPriorProductId"]) && CatalogHelper.IsHiddenProduct(masterConnection, Convert.ToInt64(drUpdated["UEPriorProductId"]))) { //Производим проверку того, что синоним может быть сопоставлен со скрытым каталожным наименованием //Если в процессе распознования каталожное наименование скрыли, то сбрасываем распознавание resolver.UnresolveProduct(drUpdated); stat.HideSynonymCount++; } if (Convert.IsDBNull(drUpdated["UEProductSynonymId"]) && CatalogHelper.IsSynonymExists(masterConnection, priceId, drUpdated["UEName1"].ToString())) { //Производим проверку того, что синоним может быть уже вставлен в таблицу синонимов //Если в процессе распознования синоним уже кто-то добавил, то сбрасываем распознавание drUpdated["UEPriorProductId"] = DBNull.Value; drUpdated["UEStatus"] = (int)((FormMask)Convert.ToByte(drUpdated["UEStatus"]) & (~FormMask.NameForm)); var synonym = dtSynonym.NewRow(); synonym["SynonymCode"] = MySqlHelper.ExecuteScalar( masterConnection, "select SynonymCode from farm.synonym where synonym = ?SynonymName and PriceCode = ?LockedSynonymPriceCode", new MySqlParameter("?LockedSynonymPriceCode", priceId), new MySqlParameter("?SynonymName", String.Format("{0} ", drUpdated["UEName1"].ToString()))); expression.CreatedProductSynonym = synonym; stat.DuplicateSynonymCount++; } var drNew = dtUnrecExpUpdate.Rows.Find(Convert.ToUInt32(drUpdated["UERowID"])); if (drNew != null) { dtUnrecExpUpdate.Rows.Remove(drNew); DelCount++; } return(DelCount); }
protected override void AttachChildControls() { this.litBrandName = (Literal)this.FindControl("litBrandName"); this.litBrandRemark = (Literal)this.FindControl("litBrandRemark"); this.rptProduct = (ThemedTemplatedRepeater)this.FindControl("rptProduct"); this.pager = (Pager)this.FindControl("pager"); this.litBrandProductResult = (Literal)this.FindControl("litBrandProductResult"); 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 += this.cutdownSearch_ReSearch; this.btnSortPrice.Sorting += this.btnSortPrice_Sorting; this.btnSortTime.Sorting += this.btnSortTime_Sorting; if (this.btnSortPopularity != null) { this.btnSortPopularity.Sorting += this.btnSortPopularity_Sorting; } if (this.btnSortSaleCounts != null) { this.btnSortSaleCounts.Sorting += this.btnSortSaleCounts_Sorting; } if (!this.Page.IsPostBack) { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.brandId); if (brandCategory == null) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该品牌已经不存在")); } else { this.LoadCategoryHead(brandCategory); this.litBrandName.Text = brandCategory.BrandName; this.litBrandRemark.Text = brandCategory.Description; PageTitle.AddSiteNameTitle(brandCategory.BrandName); this.BindBrandProduct(); } } }
private List <InvoiceCategoryModel> ConvertToInvoiceCategoryModel( IEnumerable <CategoryProductModel> productList, int rootCategoryId, string locale, bool isCustomer) { var categoryModels = new List <InvoiceCategoryModel>(); var allSKUS = CatalogProvider.GetAllSKU(locale); foreach (var categoryProductModel in productList) { var categoryModel = new InvoiceCategoryModel { RootCategoryId = rootCategoryId, Id = categoryProductModel.Category.ID, Name = Regex.Replace(CatalogHelper.getBreadCrumbText(categoryProductModel.Category, categoryProductModel.RootCategory, categoryProductModel.Product), "<.*?>", string.Empty) }; var products = from p in categoryProductModel.Product.SKUs from a in allSKUS.Keys where a == p.SKU && p.SKU != "9909" select allSKUS[a]; var invoiceLineModels = products.Select(product => new InvoiceLineModel { Sku = product.SKU, StockingSku = product.CatalogItem.StockingSKU, ProductType = product.CatalogItem.ProductType.ToString(), ProductCategory = product.CatalogItem.TaxCategory, RetailPrice = isCustomer && (locale == "en-GB" || locale == "ko-KR") ? GetCustomerRetailPrice(product.SKU, locale): product.CatalogItem.ListPrice, DisplayRetailPrice = isCustomer && (locale == "en-GB" || locale == "ko-KR") ? GetCustomerRetailPrice(product.SKU, locale).FormatPrice() : product.CatalogItem.ListPrice.FormatPrice(), ProductName = WebUtility.HtmlDecode(string.Format("{0} {1}", Regex.Replace(categoryProductModel.Product.DisplayName, "<.*?>", string.Empty), Regex.Replace(product.Description, "<.*?>", string.Empty))) }).ToList(); categoryModel.Products = invoiceLineModels; categoryModels.Add(categoryModel); } return(categoryModels); }
private void BindProducts() { ProductQuery query = new ProductQuery(); query.Keywords = txtSearchText.Text; query.CategoryId = dropCategories.SelectedValue; if (categoryId.HasValue) { query.MaiCategoryPath = CatalogHelper.GetCategory(categoryId.Value).Path; } query.PageSize = 10; query.PageIndex = pager.PageIndex; query.SaleStatus = ProductSaleStatus.OnSale; query.SortOrder = SortAction.Desc; query.SortBy = "DisplaySequence"; DbQueryResult products = ProductHelper.GetProducts(query); dlstProducts.DataSource = products.Data; dlstProducts.DataBind(); pager.TotalRecords = products.TotalRecords; }
/// <summary> /// Initializes a new instance of the <see cref="LineItemModel"/> class. /// </summary> /// <param name="lineItem">The line item.</param> /// <param name="catalogItem">The catalog item.</param> /// <param name="parentCatalogItem">The parent catalog item.</param> /// <param name="currency"></param> /// <exception cref="System.ArgumentNullException">catalogItem</exception> public LineItemModel(LineItem lineItem, Item catalogItem, Item parentCatalogItem, string currency) { _lineItem = lineItem; _currency = currency; if (catalogItem == null) { throw new ArgumentNullException("catalogItem"); } { var propertySet = CatalogHelper.CatalogClient.GetPropertySet(catalogItem.PropertySetId); _item = CatalogHelper.CreateItemModel(catalogItem, propertySet); } if (parentCatalogItem != null) { var propertySet = CatalogHelper.CatalogClient.GetPropertySet(parentCatalogItem.PropertySetId); _parentItem = CatalogHelper.CreateItemModel(parentCatalogItem, propertySet); _item.ParentItemId = parentCatalogItem.ItemId; } }
private void BindProducts() { this.LoadParameters(); ProductQuery productQuery = new ProductQuery { Keywords = this.productName, ProductCode = this.productCode, CategoryId = this.categoryId, ProductLineId = this.lineId, PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortOrder = SortAction.Desc, SortBy = "DisplaySequence", StartDate = this.startDate, BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, TagId = this.dropTagList.SelectedValue.HasValue ? this.dropTagList.SelectedValue : null, TypeId = this.typeId, UserId = this.distributorId, IsAlert = this.isAlert, SaleStatus = this.saleStatus, PenetrationStatus = this.penetrationStatus, EndDate = this.endDate }; if (this.categoryId.HasValue) { productQuery.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } Globals.EntityCoding(productQuery, true); DbQueryResult shareProducts = ProductHelper.GetShareProducts(productQuery, false, this.shareId); this.rp_shareproduct.DataSource = shareProducts.Data; this.rp_shareproduct.DataBind(); this.txtSearchText.Text = productQuery.Keywords; this.dropCategories.SelectedValue = productQuery.CategoryId; this.dropType.SelectedValue = productQuery.TypeId; this.chkIsAlert.Checked = productQuery.IsAlert; this.pager1.TotalRecords = (this.pager.TotalRecords = shareProducts.TotalRecords); }
public static string GetConnectionString(string host, string database, string username, string password, int port) { CatalogHelper.ValidateCatalog(database); NpgsqlConnectionStringBuilder connectionStringBuilder = new NpgsqlConnectionStringBuilder { Host = host, Database = database, UserName = username, Password = password, Port = port, SyncNotification = true, Pooling = true, SSL = true, SslMode = SslMode.Prefer, MinPoolSize = 10, MaxPoolSize = 100, ApplicationName = "MixERP" }; return(connectionStringBuilder.ConnectionString); }
protected void grdBrandCategriesList_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int brandId = (int)this.grdBrandCategriesList.DataKeys[rowIndex].Value; if (e.CommandName == "Rise") { if (rowIndex != this.grdBrandCategriesList.Rows.Count) { CatalogHelper.UpdateBrandCategorieDisplaySequence(brandId, SortAction.Asc); this.BindBrandCategories(); } } else { if (e.CommandName == "Fall") { CatalogHelper.UpdateBrandCategorieDisplaySequence(brandId, SortAction.Desc); this.BindBrandCategories(); } } }
public void SupplierDataBind(int?supplierId) { this.Items.Clear(); ProductQuery productQuery = new ProductQuery(); productQuery.Keywords = this.productName; productQuery.ProductCode = this.productCode; productQuery.CategoryId = this.categoryId; productQuery.SaleStatus = ProductSaleStatus.OnSale; productQuery.SupplierId = supplierId; if (this.categoryId.HasValue) { productQuery.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } DataTable groupBuyProducts = ProductHelper.GetGroupBuyProducts(productQuery); base.Items.Add(new ListItem("--请选择--", string.Empty)); foreach (DataRow dataRow in groupBuyProducts.Rows) { base.Items.Add(new ListItem(dataRow["ProductName"].ToString(), dataRow["ProductId"].ToString())); } }
private void BindProducts() { this.LoadParameters(); ProductQuery entity = new ProductQuery { Keywords = this.productName, ProductCode = this.productCode, CategoryId = this.categoryId, PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortOrder = SortAction.Desc, SortBy = "DisplaySequence", StartDate = this.startDate, BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, TwoSaleStatus = "OnStock", TypeId = this.typeId, SaleStatus = this.saleStatus, EndDate = this.endDate }; if (this.categoryId.HasValue && (this.categoryId > 0)) { entity.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } Globals.EntityCoding(entity, true); DbQueryResult products = ProductHelper.GetProducts(entity); this.grdProducts.DataSource = products.Data; this.grdProducts.DataBind(); this.txtSearchText.Text = entity.Keywords; this.txtSKU.Text = entity.ProductCode; this.dropCategories.SelectedValue = entity.CategoryId; DataTable productNum = ProductHelper.GetProductNum(); this.LitOnSale.Text = "出售中(" + productNum.Rows[0]["OnSale"].ToString() + ")"; this.LitOnStock.Text = "仓库中(" + productNum.Rows[0]["OnStock"].ToString() + ")"; this.LitZero.Text = "已售罄(" + productNum.Rows[0]["Zero"].ToString() + ")"; this.pager.TotalRecords = products.TotalRecords; }
protected override void Render(HtmlTextWriter writer) { base.Text = ""; string arg_10_0 = string.Empty; DataTable tags = CatalogHelper.GetTags(); if (tags.Rows.Count < 0) { base.Text = "无"; return; } foreach (DataRow dataRow in tags.Rows) { string text = ""; if (this._selectvalue != null) { foreach (int current in this._selectvalue) { if (current == Convert.ToInt32(dataRow["TagID"].ToString())) { text = "checked=\"checked\""; } } } string text2 = base.Text; base.Text = string.Concat(new string[] { text2, "<label><input type=\"checkbox\" onclick=\"CheckTagId(this)\" value=\"", dataRow["TagID"].ToString(), "\" ", text, "/>", dataRow["TagName"].ToString(), "</label>\u3000" }); } base.Render(writer); }
protected void btnUpdateBrandCategory_Click(object sender, System.EventArgs e) { string value = Globals.HtmlEncode(Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtBrandName.Text.Trim())).Replace("\\", "")); if (string.IsNullOrEmpty(value)) { this.ShowMsg("请填写品牌标签,品牌标签名称中不能包含HTML字符,脚本字符,以及\\", false); return; } BrandTagInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (!this.ValidationBrandCategory(brandCategoryInfo)) { return; } if (CatalogHelper.UpdateBrandTag(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/BrandType.aspx"), true); return; } this.ShowMsg("编辑品牌标签失败", true); }
private void btnSetCategories_Click(object sender, EventArgs e) { if (this.dropMoveToCategories.SelectedValue.HasValue) { int local1 = this.dropMoveToCategories.SelectedValue.Value; } string str = base.Request.Form["CheckBoxGroup"]; if (string.IsNullOrEmpty(str)) { this.ShowMsg("请选择要设置的商品", false); } else { string[] strArray; if (!str.Contains(",")) { strArray = new string[] { str }; } else { strArray = str.Split(new char[] { ',' }); } foreach (string str2 in strArray) { if (this.dropAddToAllCategories.SelectedValue.HasValue) { CatalogHelper.SetProductExtendCategory(Convert.ToInt32(str2), CatalogHelper.GetCategory(this.dropAddToAllCategories.SelectedValue.Value).Path + "|"); } else { CatalogHelper.SetProductExtendCategory(Convert.ToInt32(str2), null); } } this.ReBind(false); this.ShowMsg("批量设置扩展分类成功", true); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["isCallback"]) && base.Request.QueryString["isCallback"] == "true") { base.DoCallback(); } else { if (!int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId)) { base.GotoResourceNotFound(); } else { if (!this.Page.IsPostBack) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId); CategoryInfo category = CatalogHelper.GetCategory(this.categoryId); if (category == null) { base.GotoResourceNotFound(); } else { if (!string.IsNullOrEmpty(this.litralProductTag.Text)) { this.l_tags.Visible = true; } this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); this.dropProductTypes.DataBind(); this.dropProductTypes.SelectedValue = category.AssociatedProductType; this.dropBrandCategories.DataBind(); this.txtProductCode.Text = (this.txtSku.Text = category.SKUPrefix + new System.Random(System.DateTime.Now.Millisecond).Next(1, 99999).ToString(System.Globalization.CultureInfo.InvariantCulture).PadLeft(5, '0')); } } } } }
protected void btnUpdateBrandCategory_Click(object sender, System.EventArgs e) { BrandCategoryInfo brandCategoryInfo = this.GetBrandCategoryInfo(); if (string.IsNullOrEmpty(brandCategoryInfo.Logo)) { this.ShowMsg("请上传一张品牌LOGO图片", false); } else { if (this.ValidationBrandCategory(brandCategoryInfo)) { if (CatalogHelper.UpdateBrandCategory(brandCategoryInfo)) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/BrandCategories.aspx"), true); } else { this.ShowMsg("编辑品牌分类失败", true); } } } }
protected void btnupdatetag_Click(object sender, EventArgs e) { string str = this.hdtagId.Value.Trim(); string str2 = Globals.HtmlEncode(this.txttagname.Text.Trim()); if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)) { this.ShowMsg("请选择要修改的商品标签或输入商品标签名称", false); } else if (Convert.ToInt32(str) <= 0) { this.ShowMsg("选择的商品标签有误", false); } else if (CatalogHelper.UpdateTags(Convert.ToInt32(str), str2)) { this.ShowMsg("修改商品标签成功", true); this.ProductTagsBind(); } else { this.ShowMsg("修改商品标签失败,请确认输入的商品标签名称是否存在同名", false); } }
/// <summary> /// The get bread crumb. /// </summary> /// <param name="currentCategory"> /// The current category. /// </param> /// <param name="rootCategory"> /// The root category. /// </param> /// <returns> /// The get bread crumb. /// </returns> private string getBreadCrumb(Category_V02 currentCategory, Category_V02 rootCategory) { if (currentCategory == null || rootCategory == null) { return(string.Empty); } try { Category_V02 category = rootCategory; var listCategory = new List <Category_V02>(); while (category != null) { category = CatalogHelper.getCategory(currentCategory, category, ref listCategory); } return(createHyperLink(currentCategory, rootCategory, listCategory)); } catch { LoggerHelper.Error(string.Format("Error getBreadCrumb catID : {0}", currentCategory.ID)); } return(string.Empty); }
private void btnbtnAddCountDown_Click(object sender, System.EventArgs e) { CountDownCategoriesInfo countDownInfo = new CountDownCategoriesInfo(); countDownInfo.StartTime = Convert.ToDateTime("2015-1-1 " + this.drophours.SelectedValue.Value + ":00:00.0000000"); countDownInfo.EndTime = Convert.ToDateTime("2015-1-1 " + this.HourDropDownList1.SelectedValue.Value + ":00:00.0000000"); if (System.DateTime.Compare(countDownInfo.StartTime, countDownInfo.EndTime) >= 0 && this.HourDropDownList1.SelectedValue.Value != 0) { this.ShowMsg("开始日期必须要早于结束日期", false); return; } countDownInfo.Title = this.txtTitle.Text.Trim(); countDownInfo.AdImageUrl = CatalogHelper.UploadActiveCategorieImage(this.fileUpload.PostedFile); countDownInfo.AdImageLinkUrl = this.txtActiveImgUrl.Text.Trim(); if (PromoteHelper.AddCountDownCategories(countDownInfo)) { this.ShowMsg("添加限时管理成功", true); return; } this.ShowMsg("添加限时管理失败", true); }
protected void btnupdatetag_Click(object sender, System.EventArgs e) { string value = this.hdtagId.Value.Trim(); string text = Globals.HtmlEncode(this.txttagname.Text.Trim()); if (string.IsNullOrEmpty(value) || string.IsNullOrEmpty(text)) { this.ShowMsg("请选择要修改的商品标签或输入商品标签名称", false); return; } if (System.Convert.ToInt32(value) <= 0) { this.ShowMsg("选择的商品标签有误", false); return; } if (CatalogHelper.UpdateTags(System.Convert.ToInt32(value), text)) { this.ShowMsg("修改商品标签成功", true); this.ProductTagsBind(); return; } this.ShowMsg("修改商品标签失败,请确认输入的商品标签名称是否存在同名", false); }