private void LoadExistAttributes(HttpContext context) { JsonObject obj2 = new JsonObject(); string str = context.Request.Params["pid"]; if (!string.IsNullOrWhiteSpace(str)) { long productId = Globals.SafeLong(str, (long) (-1L)); List<AttributeHelper> list = new Maticsoft.BLL.Shop.Products.AttributeInfo().ProductAttributeInfo(productId); if ((list != null) && (list.Count > 0)) { JsonArray data = new JsonArray(); list.ForEach(delegate (AttributeHelper info) { data.Add(new JsonObject(new string[] { "AttributeId", "ValueId", "UsageMode" }, new object[] { info.AttributeId, info.ValueId, info.UsageMode })); }); obj2.Put("STATUS", "SUCCESS"); obj2.Put("DATA", data); } else { obj2.Put("STATUS", "FAILED"); } } else { obj2.Put("STATUS", "FAILED"); } context.Response.Write(obj2.ToString()); }
private void GetAttributesList(HttpContext context) { JsonArray data; JsonObject obj2 = new JsonObject(); Maticsoft.BLL.Shop.Products.AttributeInfo info = new Maticsoft.BLL.Shop.Products.AttributeInfo(); string str = context.Request.Form["DataMode"]; int num = Globals.SafeInt(context.Request.Form["ProductTypeId"], -1); if (string.IsNullOrWhiteSpace(str) || (num < 1)) { obj2.Put("STATUS", "ERROR"); context.Response.Write(obj2.ToString()); } else { SearchType extAttribute; if (str == "0") { extAttribute = SearchType.ExtAttribute; } else { extAttribute = SearchType.Specification; } List<Maticsoft.Model.Shop.Products.AttributeInfo> attributeInfoList = info.GetAttributeInfoList(new int?(num), extAttribute); data = new JsonArray(); attributeInfoList.ForEach(delegate (Maticsoft.Model.Shop.Products.AttributeInfo info) { data.Add(new JsonObject(new string[] { "AttributeId", "AttributeName", "AttributeUsageMode", "AttributeValues", "UserDefinedPic" }, new object[] { info.AttributeId, info.AttributeName, info.UsageMode, info.AttributeValues, info.UserDefinedPic })); }); obj2.Put("STATUS", "SUCCESS"); obj2.Put("DATA", data); context.Response.Write(obj2.ToString()); } }
public PartialViewResult AttrList(int cid, int Top = -1, string viewName = "_AttrList") { List<Maticsoft.Model.Shop.Products.AttributeInfo> attributeListByCateID = new Maticsoft.BLL.Shop.Products.AttributeInfo().GetAttributeListByCateID(cid, true); return this.PartialView(viewName, attributeListByCateID); }
private void ShowInfo() { Maticsoft.Model.Shop.Products.AttributeInfo model = new Maticsoft.BLL.Shop.Products.AttributeInfo().GetModel(this.AttId); if (model != null) { this.Literal1.Text = model.AttributeName; } }
public ActionResult OptionAttr(long productId, string viewName = "_OptionAttr") { if (productId < 1L) { return new EmptyResult(); } Maticsoft.BLL.Shop.Products.AttributeInfo info = new Maticsoft.BLL.Shop.Products.AttributeInfo(); return base.View(viewName, info.GetAttributeInfoListByProductId(productId)); }