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


C# JsonObject.Accumulate方法代码示例

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


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

示例1: AddAttention

 public void AddAttention(FormCollection collection)
 {
     if (!base.HttpContext.User.Identity.IsAuthenticated || (base.CurrentUser == null))
     {
         base.RedirectToAction("Login");
     }
     else
     {
         JsonObject obj2 = new JsonObject();
         string str = collection["PassiveUserID"];
         if (!string.IsNullOrWhiteSpace(str))
         {
             if (PageValidate.IsNumberSign(str) && this.bllUserShip.AddAttention(base.CurrentUser.UserID, int.Parse(str)))
             {
                 obj2.Accumulate("STATUS", "SUCC");
             }
             else
             {
                 obj2.Accumulate("STATUS", "FAIL");
             }
         }
         else
         {
             obj2.Accumulate("STATUS", "FAIL");
         }
         base.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:28,代码来源:PartialController.cs

示例2: GetDepartmentMapById

 protected virtual void GetDepartmentMapById(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     int departmentId = Globals.SafeInt(context.Request.Params["DepartmentId"], 0);
     if (departmentId < 1)
     {
         obj2.Accumulate("ERROR", "NOENTERPRISEID");
         context.Response.Write(obj2.ToString());
     }
     else
     {
         MapInfo modelByDepartmentId = this.mapInfoManage.GetModelByDepartmentId(departmentId);
         if (modelByDepartmentId == null)
         {
             obj2.Accumulate("STATUS", "NODATA");
             context.Response.Write(obj2.ToString());
         }
         else
         {
             obj2.Accumulate("STATUS", "OK");
             obj2.Accumulate("DATA", modelByDepartmentId);
             context.Response.Write(obj2.ToString());
         }
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:25,代码来源:MapHandlerBase.cs

示例3: GetDepthNode

 private void GetDepthNode(HttpContext context)
 {
     DataSet list;
     int regionId = Globals.SafeInt(context.Request.Params["NodeId"], 0);
     JsonObject obj2 = new JsonObject();
     if (regionId > 0)
     {
         Maticsoft.Model.Ms.Regions model = this.RegionBll.GetModel(regionId);
         list = this.RegionBll.GetList("Depth=" + model.Depth);
     }
     else
     {
         list = this.RegionBll.GetList("Depth=1");
     }
     if (list.Tables[0].Rows.Count < 1)
     {
         obj2.Accumulate("STATUS", "NODATA");
         context.Response.Write(obj2.ToString());
     }
     else
     {
         obj2.Accumulate("STATUS", "OK");
         obj2.Accumulate("DATA", list.Tables[0]);
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:26,代码来源:RegionHandle.cs

示例4: EditRecomend

 private void EditRecomend(HttpContext context)
 {
     int productId = Globals.SafeInt(context.Request.Params["ProductId"], 0);
     int recomend = Globals.SafeInt(context.Request.Params["Recomend"], 0);
     JsonObject obj2 = new JsonObject();
     if (this.productBll.UpdateRecomend(productId, recomend))
     {
         obj2.Accumulate("STATUS", "OK");
     }
     else
     {
         obj2.Accumulate("STATUS", "NODATA");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:15,代码来源:ProductHandler.cs

示例5: EditStatus

 private void EditStatus(HttpContext context)
 {
     int photoID = Globals.SafeInt(context.Request.Params["PhotoID"], 0);
     int status = Globals.SafeInt(context.Request.Params["Status"], 0);
     JsonObject obj2 = new JsonObject();
     if (this.photoBll.UpdateStatus(photoID, status))
     {
         obj2.Accumulate("STATUS", "OK");
     }
     else
     {
         obj2.Accumulate("STATUS", "NODATA");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:15,代码来源:PhotosHandler.cs

示例6: SetAdmin

 private void SetAdmin(HttpContext context)
 {
     int groupID = Globals.SafeInt(context.Request.Params["GroupID"], 0);
     int userID = Globals.SafeInt(context.Request.Params["UserID"], 0);
     int role = Globals.SafeInt(context.Request.Params["Role"], 0);
     JsonObject obj2 = new JsonObject();
     if (this.groupUserBll.UpdateRole(groupID, userID, role))
     {
         obj2.Accumulate("STATUS", "OK");
     }
     else
     {
         obj2.Accumulate("STATUS", "NODATA");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:16,代码来源:GroupUserHandler.cs

示例7: SubmitPoll

 public void SubmitPoll(FormCollection collection)
 {
     JsonObject obj2 = new JsonObject();
     if (base.Request.Cookies["vote" + collection["FID"]] != null)
     {
         obj2.Accumulate("STATUS", "805");
         obj2.Accumulate("DATA", "您已经投过票,请不要重复投票!");
     }
     else
     {
         Maticsoft.Model.Poll.UserPoll model = new Maticsoft.Model.Poll.UserPoll();
         Maticsoft.BLL.Poll.UserPoll poll2 = new Maticsoft.BLL.Poll.UserPoll();
         model.UserID = Globals.SafeInt(collection["UID"], 0);
         model.UserIP = base.Request.UserHostAddress;
         string str = collection["Option"];
         if (!string.IsNullOrWhiteSpace(str))
         {
             string[] strArray = str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
             int num = 0;
             foreach (string str2 in strArray)
             {
                 string[] strArray2 = str2.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
                 model.TopicID = new int?(Globals.SafeInt(strArray2[0], -1));
                 model.OptionID = new int?(Globals.SafeInt(strArray2[1], -1));
                 poll2.Add(model);
                 num++;
             }
             if (num == strArray.Length)
             {
                 HttpCookie cookie = new HttpCookie("vote" + collection["FID"]);
                 cookie.Values.Add("voteid", collection["FID"]);
                 cookie.Expires = DateTime.Now.AddHours(240.0);
                 base.Response.Cookies.Add(cookie);
                 obj2.Accumulate("STATUS", "800");
             }
             else
             {
                 obj2.Accumulate("STATUS", "804");
             }
         }
         else
         {
             obj2.Accumulate("STATUS", "804");
         }
     }
     base.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:47,代码来源:PollController.cs

示例8: SetDepartmentMap

 protected void SetDepartmentMap(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     User user = context.Session[Globals.SESSIONKEY_ENTERPRISE] as User;
     if (user != null)
     {
         int num = Globals.SafeInt(context.Request.Params["DepartmentId"], 0);
         string str = context.Request.Params["MarkersLongitude"];
         string str2 = context.Request.Params["MarkersDimension"];
         string target = context.Request.Params["PointerTitle"];
         string content = context.Request.Params["PointerContent"];
         string str5 = context.Request.Params["PointImg"];
         int num2 = Globals.SafeInt(context.Request.Params["MapId"], 0);
         if (num < 1)
         {
             obj2.Accumulate("ERROR", "NOENTERPRISEID");
             context.Response.Write(obj2.ToString());
         }
         else
         {
             MapInfo model = new MapInfo {
                 UserId = user.UserID,
                 DepartmentId = num,
                 MarkersLongitude = str,
                 MarkersDimension = str2,
                 PointerTitle = Globals.HtmlEncode(target),
                 PointerContent = Globals.HtmlEncodeForSpaceWrap(content)
             };
             if (!string.IsNullOrWhiteSpace(str5))
             {
                 model.PointImg = str5;
             }
             if (num2 < 1)
             {
                 model.MapId = base.mapInfoManage.Add(model);
             }
             else
             {
                 model.MapId = num2;
                 base.mapInfoManage.Update(model);
             }
             obj2.Accumulate("STATUS", "OK");
             obj2.Accumulate("DATA", model);
             context.Response.Write(obj2.ToString());
         }
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:47,代码来源:MapHandle.cs

示例9: GetChildNode

 private void GetChildNode(HttpContext context)
 {
     string str = context.Request.Params["ParentId"];
     JsonObject obj2 = new JsonObject();
     DataSet regionName = this.RegionBll.GetRegionName(string.IsNullOrWhiteSpace(str) ? "0" : str);
     if (regionName.Tables[0].Rows.Count < 1)
     {
         obj2.Accumulate("STATUS", "NODATA");
         context.Response.Write(obj2.ToString());
     }
     else
     {
         obj2.Accumulate("STATUS", "OK");
         obj2.Accumulate("DATA", regionName.Tables[0]);
         context.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:17,代码来源:RegionHandle.cs

示例10: ProcessRequest

 public void ProcessRequest(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     context.Response.ContentType = "application/json";
     if (!this.CheckUser(context))
     {
         context.Response.Write("{\"STATUS\":\"NOLONGIN\"}");
         obj2.Accumulate("STATUS", "NOLONGIN");
     }
     else
     {
         try
         {
             string actionName = context.Request["Action"];
             string str2 = actionName;
             if (str2 == null)
             {
                 goto Label_009E;
             }
             if (!(str2 == "CkeckLogin"))
             {
                 if (str2 == "GetDepartmentMapById")
                 {
                     goto Label_0095;
                 }
                 goto Label_009E;
             }
             obj2.Accumulate("STATUS", "OK");
             context.Response.Write(obj2.ToString());
             return;
         Label_0095:
             this.GetDepartmentMapById(context);
             return;
         Label_009E:
             this.ProcessAction(actionName, context);
         }
         catch (Exception exception)
         {
             obj2.Accumulate("ERROR", exception.Message.Replace("\"", "'"));
             context.Response.Write(obj2.ToString());
         }
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:43,代码来源:MapHandlerBase.cs

示例11: DeleteFile

 private void DeleteFile(HttpContext context)
 {
     JsonObject obj2 = new JsonObject();
     string str = context.Request.Form["FilePath"];
     if (!string.IsNullOrWhiteSpace(str))
     {
         if (FileManage.DeleteFile(context.Server.MapPath(str)))
         {
             obj2.Accumulate("STATUS", "SUCCESS");
         }
         else
         {
             obj2.Accumulate("STATUS", "FAILED");
         }
     }
     else
     {
         obj2.Accumulate("STATUS", "ERROR");
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:21,代码来源:CMSContentHandler.cs

示例12: ContentAttachmentUpload

 private void ContentAttachmentUpload(HttpRequest Request, HttpResponse Response)
 {
     HttpPostedFile file = Request.Files["Filedata"];
     Response.Charset = "utf-8";
     string valueByCache = ConfigSystem.GetValueByCache("UploadAttachmentPath");
     if (file != null)
     {
         string path = HttpContext.Current.Server.MapPath("/" + valueByCache);
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         string str3 = Path.GetExtension(file.FileName).ToLower();
         string str4 = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture) + str3;
         string filename = path + str4;
         JsonObject obj2 = new JsonObject();
         try
         {
             file.SaveAs(filename);
             obj2.Accumulate("Status", "OK");
             obj2.Accumulate("SavePath", valueByCache + str4);
             Response.Write("1|" + obj2.ToString());
         }
         catch (Exception)
         {
             obj2.Accumulate("Status", "Failed");
             obj2.Accumulate("ErrorMessage", "ERROR501,请联系管理员!");
             Response.Write("0|" + obj2.ToString());
         }
     }
     else
     {
         JsonObject obj3 = new JsonObject();
         obj3.Accumulate("Status", "Failed");
         obj3.Accumulate("ErrorMessage", "ERROR502,请联系管理员!");
         Response.Write("0|" + obj3.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:38,代码来源:CMSContentHandle.cs

示例13: GetUserName

 public string GetUserName(string prefixText, int limit)
 {
     if (string.IsNullOrWhiteSpace(prefixText))
     {
         return string.Empty;
     }
     string strUName = this.HtmlEncode(prefixText);
     DataSet userName = new UsersExp().GetUserName(strUName, limit);
     JsonArray array = new JsonArray();
     if (userName.Tables[0].Rows.Count > 0)
     {
         for (int i = 0; i < userName.Tables[0].Rows.Count; i++)
         {
             string tmpStr = userName.Tables[0].Rows[i]["UserName"].ToString();
             if (this.CheckHtmlCode(ref tmpStr, prefixText))
             {
                 JsonObject obj2 = new JsonObject();
                 obj2.Accumulate("name", tmpStr);
                 array.Add(obj2);
             }
         }
     }
     return array.ToString();
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:24,代码来源:GetData.cs

示例14: CheckNickName

 public void CheckNickName(FormCollection collection)
 {
     JsonObject obj2 = new JsonObject();
     if ((base.HttpContext.User.Identity.IsAuthenticated && (base.CurrentUser != null)) && (base.CurrentUser.UserType != "AA"))
     {
         string str = collection["NickName"];
         if (!string.IsNullOrWhiteSpace(str))
         {
             Maticsoft.BLL.Members.Users users = new Maticsoft.BLL.Members.Users();
             if (users.ExistsNickName(base.CurrentUser.UserID, str))
             {
                 obj2.Accumulate("STATUS", "EXISTS");
             }
             else
             {
                 obj2.Accumulate("STATUS", "OK");
             }
         }
         else
         {
             obj2.Accumulate("STATUS", "NOTNULL");
         }
         base.Response.Write(obj2.ToString());
     }
     else
     {
         obj2.Accumulate("STATUS", "NOTNULL");
         base.Response.Write(obj2.ToString());
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:30,代码来源:UserCenterController.cs

示例15: GetTaoBaoParentNode

 private void GetTaoBaoParentNode(HttpContext context)
 {
     int categoryId = Globals.SafeInt(context.Request.Params["NodeId"], 0);
     JsonObject obj2 = new JsonObject();
     DataSet set = this.taoBaoCateBll.GetList("");
     if ((set != null) && (set.Tables.Count > 0))
     {
         DataTable table = set.Tables[0];
         Maticsoft.Model.SNS.CategorySource model = this.taoBaoCateBll.GetModel(3, categoryId);
         if (model != null)
         {
             string[] strArray = model.Path.TrimEnd(new char[] { '|' }).Split(new char[] { '|' });
             if (strArray.Length > 0)
             {
                 List<DataRow[]> list = new List<DataRow[]>();
                 for (int i = 0; i <= strArray.Length; i++)
                 {
                     DataRow[] item = null;
                     if (i == 0)
                     {
                         item = table.Select("ParentId=0");
                     }
                     else
                     {
                         item = table.Select("ParentId=" + strArray[i - 1]);
                     }
                     if (item.Length > 0)
                     {
                         list.Add(item);
                     }
                 }
                 obj2.Accumulate("STATUS", "OK");
                 obj2.Accumulate("DATA", list);
                 obj2.Accumulate("PARENT", strArray);
             }
             else
             {
                 obj2.Accumulate("STATUS", "NODATA");
                 context.Response.Write(obj2.ToString());
                 return;
             }
         }
     }
     context.Response.Write(obj2.ToString());
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:45,代码来源:ShopHandler.cs


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