Esempio n. 1
0
 private void LoadAttributesvalues(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     string str = context.Request.Params["pid"];
     if (!string.IsNullOrWhiteSpace(str))
     {
         long productId = Globals.SafeLong(str, (long) (-1L));
         List<Maticsoft.Model.Shop.Products.SKUItem> list = new Maticsoft.BLL.Shop.Products.SKUItem().AttributeValueInfo(productId);
         if ((list != null) && (list.Count > 0))
         {
             JsonArray data = new JsonArray();
             list.ForEach(delegate (Maticsoft.Model.Shop.Products.SKUItem info) {
                 data.Add(new JsonObject(new string[] { "SpecId", "AttributeId", "ValueId", "ImageUrl", "ValueStr", "UserDefinedPic" }, new object[] { info.SpecId, info.AttributeId, info.ValueId, info.ImageUrl, info.ValueStr, info.UserDefinedPic }));
             });
             obj2.Put("STATUS", "SUCCESS");
             obj2.Put("DATA", data);
         }
         else
         {
             obj2.Put("STATUS", "FAILED");
         }
     }
     else
     {
         obj2.Put("STATUS", "FAILED");
     }
     context.Response.Write(obj2.ToString());
 }
Esempio n. 2
0
 private void EditValue(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     string str = context.Request.Form["ValueId"];
     if (!string.IsNullOrWhiteSpace(str))
     {
         long num = Convert.ToInt64(str);
         bool flag = new Maticsoft.BLL.Shop.Products.SKUItem().Exists(null, null, new long?(num));
         bool flag2 = new Maticsoft.BLL.Shop.Products.ProductAttribute().Exists(null, null, new long?(num));
         if (flag || flag2)
         {
             obj2.Put("STATUS", "FAILED");
         }
         else
         {
             Maticsoft.BLL.Shop.Products.ProductType type = new Maticsoft.BLL.Shop.Products.ProductType();
             if (type.DeleteManage(null, null, new long?(num)))
             {
                 obj2.Put("STATUS", "SUCCESS");
             }
             else
             {
                 obj2.Put("STATUS", "FAILED");
             }
         }
     }
     else
     {
         obj2.Put("STATUS", "FAILED");
     }
     context.Response.Write(obj2.ToString());
 }