private void DeleteBrands(HttpContext context) { JsonObject obj2 = new JsonObject(); string str = context.Request.Params["idList"]; if (!string.IsNullOrWhiteSpace(str)) { Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); Maticsoft.BLL.Shop.Products.ProductInfo info2 = new Maticsoft.BLL.Shop.Products.ProductInfo(); Maticsoft.BLL.Shop.Products.ProductTypeBrand brand = new Maticsoft.BLL.Shop.Products.ProductTypeBrand(); int brandId = Globals.SafeInt(str, 0); if (info2.ExistsBrands(brandId)) { obj2.Put("STATUS", "FAILED"); obj2.Put("DATA", "该品牌正在使用中!"); } if (info.DeleteList(str)) { brand.Delete(null, new int?(brandId)); obj2.Put("STATUS", "SUCCESS"); } else { obj2.Put("STATUS", "FAILED"); obj2.Put("DATA", "系统忙,请稍后再试!"); } } else { obj2.Put("STATUS", "FAILED"); obj2.Put("DATA", "系统忙,请稍后再试!"); } context.Response.Write(obj2.ToString()); }
public override void DataBind() { this.Items.Clear(); Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); foreach (Maticsoft.Model.Shop.Products.BrandInfo info2 in info.GetBrands()) { base.Items.Add(new ListItem(info2.BrandName, info2.BrandId.ToString())); } }
public ActionResult Detail(int id, string viewName = "Detail") { Func<Maticsoft.Model.Shop.Products.CategoryInfo, bool> predicate = null; ProductModel model = new ProductModel { ProductInfo = this.productManage.GetModel((long) id) }; model.ProductImages = new Maticsoft.BLL.Shop.Products.ProductImage().ProductImagesList((long) id); model.ProductSkus = this.skuBll.GetProductSkuInfo((long) id); Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); if (model.ProductInfo == null) { return base.RedirectToAction("Index", "Home"); } Maticsoft.Model.Shop.Products.BrandInfo modelByCache = info.GetModelByCache(model.ProductInfo.BrandId); if (modelByCache != null) { ((dynamic) base.ViewBag).BrandName = modelByCache.BrandName; } Maticsoft.Model.Shop.Products.ProductCategories categoryModel = new Maticsoft.BLL.Shop.Products.ProductCategories().GetModel((long) id); if (categoryModel != null) { List<Maticsoft.Model.Shop.Products.CategoryInfo> allCateList = Maticsoft.BLL.Shop.Products.CategoryInfo.GetAllCateList(); if (predicate == null) { predicate = c => c.CategoryId == categoryModel.CategoryId; } Maticsoft.Model.Shop.Products.CategoryInfo info3 = allCateList.FirstOrDefault<Maticsoft.Model.Shop.Products.CategoryInfo>(predicate); if (info3 != null) { string[] cateIds = info3.Path.Split(new char[] { '|' }); List<Maticsoft.Model.Shop.Products.CategoryInfo> list2 = (from c in allCateList where cateIds.Contains<string>(c.CategoryId.ToString()) orderby c.Depth select c).ToList<Maticsoft.Model.Shop.Products.CategoryInfo>(); StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); if ((list2 != null) && (list2.Count > 0)) { foreach (Maticsoft.Model.Shop.Products.CategoryInfo info4 in list2) { builder2.AppendFormat("<a href='/Product/" + info4.CategoryId + "'>{0}</a> > ", info4.Name); } } ((dynamic) base.ViewBag).Cid = categoryModel.CategoryId; ((dynamic) base.ViewBag).PathInfo = builder.ToString(); ((dynamic) base.ViewBag).CategoryStr = builder2.ToString(); } } PageSetting setting = PageSetting.GetProductSetting(model.ProductInfo, "Product", ApplicationKeyType.Shop); ((dynamic) base.ViewBag).Title = setting.Title; ((dynamic) base.ViewBag).Keywords = setting.Keywords; ((dynamic) base.ViewBag).Description = setting.Description; ((dynamic) base.ViewBag).ConsultCount = this.conBll.GetRecordCount("Status=1 and ProductId=" + id); ((dynamic) base.ViewBag).CommentCount = this.reviewsBll.GetRecordCount("Status=1 and ProductId=" + id); return base.View(viewName, model); }
private void BindBrands() { DataSet list = new BrandInfo().GetList(string.Empty); if (!DataSetTools.DataSetIsNull(list)) { this.dropBrands.DataSource = list; this.dropBrands.DataTextField = "BrandName"; this.dropBrands.DataValueField = "BrandId"; this.dropBrands.DataBind(); } this.dropBrands.Items.Insert(0, string.Empty); }
private void BindBrands() { DataSet list = new Maticsoft.BLL.Shop.Products.BrandInfo().GetList(string.Empty); if (!DataSetTools.DataSetIsNull(list)) { this.dropBrands.DataSource = list; this.dropBrands.DataTextField = "BrandName"; this.dropBrands.DataValueField = "BrandId"; this.dropBrands.DataBind(); } this.dropBrands.Items.Insert(0, this.dropItem0Value); }
private void ShowInfo(int BrandId) { Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); Maticsoft.Model.Shop.Products.BrandInfo model = info.GetModel(BrandId); this.lblBrandId.Text = model.BrandId.ToString(); this.lblBrandName.Text = model.BrandName; this.lblBrandSpell.Text = model.BrandSpell; this.lblMeta_Description.Text = model.Meta_Description; this.lblMeta_Keywords.Text = model.Meta_Keywords; this.imgLogo.ImageUrl = model.Logo; this.lblCompanyUrl.Text = model.CompanyUrl; Maticsoft.Model.Shop.Products.BrandInfo relatedProduct = info.GetRelatedProduct(new int?(BrandId), null); foreach (ListItem item in this.chkProductTpyes.Items) { if (relatedProduct.ProductTypeIdOrBrandsId.Contains(int.Parse(item.Value))) { item.Selected = true; } } this.lblDescription.Text = model.Description; this.lblDisplaySequence.Text = model.DisplaySequence.ToString(); this.lblTheme.Text = model.Theme; }
private void GetBrandsKVList(HttpContext context) { List<Maticsoft.Model.Shop.Products.BrandInfo> brands; JsonObject obj2 = new JsonObject(); Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); int productTypeId = Globals.SafeInt(context.Request.Form["ProductTypeId"], -1); if (productTypeId < 1) { brands = info.GetBrands(); } else { brands = info.GetModelListByProductTypeId(productTypeId, -1); } JsonArray data = new JsonArray(); brands.ForEach(delegate (Maticsoft.Model.Shop.Products.BrandInfo info) { data.Add(new JsonObject(new string[] { "BrandId", "BrandName" }, new object[] { info.BrandId, info.BrandName })); }); obj2.Put("STATUS", "SUCCESS"); obj2.Put("DATA", data); context.Response.Write(obj2.ToString()); }
private void GetBrandsInfo(HttpContext context) { string str = context.Request.Params["ProductTypeId"]; string s = context.Request.Params["pageIndex"]; string text = context.Request.Params["TabNum"]; int num = Globals.SafeInt(text, 0); int result = 0; if (!int.TryParse(s, out result)) { result = 1; } int pageSize = Globals.SafeInt(context.Request.Params["pageSize"], 1); int rowCount = 0; int pageCount = 0; if (!string.IsNullOrWhiteSpace(str)) { Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo(); List<Maticsoft.Model.Shop.Products.BrandInfo> list = null; if (num == 0) { list = info.GetListByProductTypeId(out rowCount, out pageCount, int.Parse(str), result, pageSize, 1); } else { list = info.GetListByProductTypeId(out rowCount, out pageCount, int.Parse(str), result, pageSize, 1); } JsonObject obj2 = new JsonObject(); JsonArray data = new JsonArray(); list.ForEach(delegate (Maticsoft.Model.Shop.Products.BrandInfo info) { data.Add(new JsonObject(new string[] { "BrandId", "BrandName", "DisplaySequence", "Logo", "Description" }, new object[] { info.BrandId, info.BrandName, info.DisplaySequence, info.Logo, info.Description })); }); obj2.Put("STATUS", "SUCCESS"); obj2.Put("DATA", data); obj2.Put("rowCount", rowCount); obj2.Put("pageCount", pageCount); context.Response.Write(obj2.ToString()); } }
private void ShowInfo() { Maticsoft.Model.Shop.Products.ProductType model = this.bll.GetModel(this.ProductTypeId); if (model != null) { this.txtTypeName.Text = model.TypeName; this.txtRemark.Text = model.Remark; Maticsoft.Model.Shop.Products.BrandInfo relatedProduct = new Maticsoft.BLL.Shop.Products.BrandInfo().GetRelatedProduct(null, new int?(this.ProductTypeId)); foreach (ListItem item in this.chkBrandsCheckBox.Items) { if (relatedProduct.ProductTypeIdOrBrandsId.Contains(int.Parse(item.Value))) { item.Selected = true; } } } }