当前位置: 首页>>代码示例>>C#>>正文


C# JsonObject.Put方法代码示例

本文整理汇总了C#中JsonObject.Put方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.Put方法的具体用法?C# JsonObject.Put怎么用?C# JsonObject.Put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonObject的用法示例。


在下文中一共展示了JsonObject.Put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserPoll

 private string UserPoll(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     int num = Convert.ToInt32(context.Request.Form["UID"]);
     string str = context.Request.Form["Option"];
     string str2 = context.Request.Form["FID"];
     if (context.Request.Cookies["vote" + str2] != null)
     {
         HttpCookie cookie = context.Request.Cookies["vote" + str2];
         if ((cookie.Values["voteid"].ToString() != "") || (cookie.Values["voteid"].ToString() != null))
         {
             obj2.Put("STATUS", "FAILED");
         }
     }
     Maticsoft.BLL.Poll.UserPoll poll = new Maticsoft.BLL.Poll.UserPoll();
     string[] strArray = str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
     Maticsoft.Model.Poll.UserPoll model = null;
     for (int i = 0; i < strArray.Length; i++)
     {
         string[] strArray2 = strArray[i].Split(new char[0x5f], StringSplitOptions.RemoveEmptyEntries);
         model.CreatTime = new DateTime?(DateTime.Now);
         model.TopicID = new int?(int.Parse(strArray2[0]));
         model.UserID = num;
         model.UserIP = context.Request.UserHostAddress;
         model.OptionID = new int?(int.Parse(strArray2[1]));
         poll.Add(model);
     }
     obj2.Put("STATUS", "SUCCESS");
     return obj2.ToString();
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:30,代码来源:UserPollHandler.cs

示例2: ProcessSub

 protected override void ProcessSub(HttpContext context, string uploadPath, string fileName)
 {
     JsonObject obj2 = new JsonObject();
     obj2.Put("data", uploadPath + "T_" + fileName);
     obj2.Put("success", true);
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:7,代码来源:UploadGravatarHandler.cs

示例3: DeleteBrands

 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());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:33,代码来源:ShopHandler.cs

示例4: GetCategoryInfo

 public void GetCategoryInfo(HttpContext context)
 {
     Func<Maticsoft.Model.SNS.Categories, bool> predicate = null;
     string categoryId = context.Request.Params["CID"];
     int type = Globals.SafeInt(context.Request.Params["Type"], 0);
     JsonObject obj2 = new JsonObject();
     if (!string.IsNullOrWhiteSpace(categoryId))
     {
         if (predicate == null)
         {
             predicate = c => c.ParentID == Globals.SafeInt(categoryId, 0);
         }
         List<Maticsoft.Model.SNS.Categories> list2 = this.SNSCateBll.GetAllCateByCache(type).Where<Maticsoft.Model.SNS.Categories>(predicate).ToList<Maticsoft.Model.SNS.Categories>();
         if ((list2 != null) && (list2.Count > 0))
         {
             JsonArray data = new JsonArray();
             list2.ForEach(delegate (Maticsoft.Model.SNS.Categories info) {
                 data.Add(new JsonObject(new string[] { "CategoryId", "Name", "ParentID", "HasChildren" }, new object[] { info.CategoryId, info.Name, info.ParentID, info.HasChildren }));
             });
             obj2.Put("STATUS", "Success");
             obj2.Put("DATA", data);
         }
         else
         {
             obj2.Put("STATUS", "Fail");
         }
     }
     else
     {
         obj2.Put("STATUS", "Error");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:33,代码来源:CategoriesHandler.cs

示例5: AddRuleProduct

 private string AddRuleProduct(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     int num = Convert.ToInt32(context.Request.Form["ProductId"]);
     int ruleId = Convert.ToInt32(context.Request.Form["RuleId"]);
     string str = context.Request.Form["ProductName"];
     if (this.ruleProductBll.Exists(ruleId, (long) num))
     {
         obj2.Put("STATUS", "Presence");
         return obj2.ToString();
     }
     Maticsoft.Model.Shop.Sales.SalesRuleProduct model = new Maticsoft.Model.Shop.Sales.SalesRuleProduct {
         ProductId = num,
         RuleId = ruleId,
         ProductName = str
     };
     if (this.ruleProductBll.Add(model))
     {
         obj2.Put("STATUS", "SUCCESS");
         obj2.Put("DATA", "Approve");
         return obj2.ToString();
     }
     obj2.Put("STATUS", "NODATA");
     return obj2.ToString();
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:25,代码来源:ShopHandler.cs

示例6: ProcessRequest

 public override void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     string str = context.Request.Form["Action"];
     context.Response.Clear();
     context.Response.ContentType = "application/json";
     try
     {
         string str2 = str;
         if (str2 != null)
         {
             if (!(str2 == "GetSKUByProductId"))
             {
                 if (str2 == "MaxSequence")
                 {
                     goto Label_006B;
                 }
             }
             else
             {
                 this.GetSKUByProductId(context);
             }
         }
         return;
     Label_006B:
         this.GetMaxSequence(context);
     }
     catch (Exception exception)
     {
         JsonObject obj2 = new JsonObject();
         obj2.Put("STATUS", "ERROR");
         obj2.Put("DATA", exception);
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:35,代码来源:ProductHandler.cs

示例7: SaveSubscriber

        public JsonObject SaveSubscriber(string subscriberEmail, string subscriberMessage, bool subscriberIsDeleted, long subscriberId)
        {
            var retMessage = new JsonObject();

            bool valid = UtilsSecurity.IsValidEmail(DecodeUrl(subscriberEmail));
            if (valid == true)
            {
                string message;
                long retSubscriberID = DataInfoList.SaveLtdSubscriber(DecodeUrl(subscriberEmail), DecodeUrl(subscriberMessage), subscriberIsDeleted, subscriberId, out message);
                if ((retSubscriberID > 0) && (message.Trim().Length == 0))
                {
                    retMessage.Put("message", subscriberId == 0 ? "Successfully Added Subscriber" : "Successfully Updated Subscriber");
                }
                else
                {
                    if (message.Trim().Length == 0) message = "Error in Saving Subscriber. Return Subscriber ID is 0";
                    retMessage.Put("error", message);
                }
            }
            else
            {
                retMessage.Put("error", "Please enter a Valid Email to Subscribe");
            }

            return retMessage;
        }
开发者ID:Srid68,项目名称:Priya.InfoList,代码行数:26,代码来源:JsonSubscriberHandler.cs

示例8: GenerateHtml

 protected void GenerateHtml(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     string valueByCache = ConfigSystem.GetValueByCache("MainArea");
     int TaskId = Globals.SafeInt(context.Request.Form["TaskId"], 0);
     Maticsoft.Model.SysManage.TaskQueue model = TaskList.FirstOrDefault<Maticsoft.Model.SysManage.TaskQueue>(c => c.ID == TaskId);
     if (model != null)
     {
         string str2 = "";
         string str3 = PageSetting.GetCMSUrl(model.TaskId, "CMS", ApplicationKeyType.CMS);
         if (valueByCache == "CMS")
         {
             str2 = "/Article/Details/" + model.TaskId;
         }
         else
         {
             str2 = "/CMS/Article/Details/" + model.TaskId;
         }
         if (!string.IsNullOrWhiteSpace(str2) && !string.IsNullOrWhiteSpace(str3))
         {
             if (Maticsoft.BLL.CMS.GenerateHtml.HttpToStatic(str2, str3))
             {
                 model.RunDate = new DateTime?(DateTime.Now);
                 model.Status = 1;
                 this.taskBll.Update(model);
                 obj2.Put("STATUS", "SUCCESS");
             }
             else
             {
                 obj2.Put("STATUS", "FAILED");
             }
         }
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:35,代码来源:HttpToStaticHandler.cs

示例9: ProcessRequest

 public override void ProcessRequest(HttpContext context)
 {
     string str = context.Request.Form["Action"];
     context.Response.Clear();
     context.Response.ContentType = "application/json";
     try
     {
         string str2 = str;
         if (str2 != null)
         {
             if (!(str2 == "EditRecomend"))
             {
                 if (str2 == "EditStatus")
                 {
                     goto Label_005B;
                 }
             }
             else
             {
                 this.EditRecomend(context);
             }
         }
         return;
     Label_005B:
         this.EditStatus(context);
     }
     catch (Exception exception)
     {
         JsonObject obj2 = new JsonObject();
         obj2.Put("STATUS", "ERROR");
         obj2.Put("DATA", exception);
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:34,代码来源:PhotosHandler.cs

示例10: ContinueTask

 protected void ContinueTask(HttpContext context)
 {
     TaskList = this.taskBll.GetContinueTask(0);
     JsonObject obj2 = new JsonObject();
     obj2.Put("STATUS", "SUCCESS");
     Maticsoft.Model.SysManage.TaskQueue queue = TaskList.First<Maticsoft.Model.SysManage.TaskQueue>();
     obj2.Put("DATA", queue.ID);
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:9,代码来源:HttpToStaticHandler.cs

示例11: GetMaxSequence

 private void GetMaxSequence(HttpContext context)
 {
     ProductInfo info = new ProductInfo();
     JsonObject obj2 = new JsonObject();
     string categoryPath = context.Request.Form["CategoryPath"];
     obj2.Put("STATUS", "SUCCESS");
     obj2.Put("DATA", info.MaxSequence(categoryPath) + 1);
     context.Response.Write(obj2);
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:9,代码来源:ProductHandler.cs

示例12: Delete

 private string Delete()
 {
     JsonObject obj2 = new JsonObject();
     int iD = Globals.SafeInt(base.Request.Form["RecId"], 0);
     if (this.recBll.Delete(iD))
     {
         obj2.Put("STATUS", "SUCCESS");
     }
     else
     {
         obj2.Put("STATUS", "FAILED");
     }
     return obj2.ToString();
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:14,代码来源:RecList.cs

示例13: DeleteCategory

 private void DeleteCategory(HttpContext context)
 {
     string str = context.Request.Params["CID"];
     JsonObject obj2 = new JsonObject();
     if (!string.IsNullOrWhiteSpace(str))
     {
         this.SNSCateBll.DeleteCategory(Globals.SafeInt(str, 0));
         obj2.Put("STATUS", "Success");
     }
     else
     {
         obj2.Put("STATUS", "Error");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:15,代码来源:CategoriesHandler.cs

示例14: SaveInfoPage

        public JsonObject SaveInfoPage(string infoPageName, string infoPageDescription, long infoPageCategoryId, long accessGroupId, bool asyncLoading, bool isActive, DateTime expiryDate, bool commentable, string commentorRoleList, bool isPublic, bool isCommon, bool isDeleted, long sequence, long infoPageId)
        {
            var retMessage = new JsonObject();

            string message;
            long retID = DataInfoList.SaveLtdInfoPage(DecodeUrl(infoPageName), DecodeUrl(infoPageDescription), infoPageCategoryId, accessGroupId, asyncLoading, isActive, expiryDate, commentable, commentorRoleList, isPublic, isCommon, isDeleted, sequence, infoPageId, out message);
            if ((retID > 0) && (message.Trim().Length == 0))
            {
                retMessage.Put("message", infoPageId == 0 ? "Successfully Added Info Page" : "Successfully Updated Info Page");
            }
            else
            {
                if (message.Trim().Length == 0) message = "Error in Saving Info Page. Return Info Page ID is 0";
                retMessage.Put("error", message);
            }

            return retMessage;
        }
开发者ID:Srid68,项目名称:Priya.InfoList,代码行数:18,代码来源:JsonInfoPageHandler.cs

示例15: ContinueTask

 protected void ContinueTask(HttpContext context)
 {
     TaskList = this.taskBll.GetContinueTask(2);
     JsonObject obj2 = new JsonObject();
     obj2.Put("STATUS", "SUCCESS");
     Maticsoft.Model.SysManage.TaskQueue queue = (TaskList.Count == 0) ? null : TaskList.First<Maticsoft.Model.SysManage.TaskQueue>();
     if (queue == null)
     {
         this.taskBll.DeleteTask(2);
         obj2.Put("DATA", 0);
         context.Response.Write(obj2.ToString());
     }
     else
     {
         obj2.Put("DATA", queue.ID);
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:18,代码来源:ImageReGenHandler.cs


注:本文中的JsonObject.Put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。