/// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetMappingRelationPages(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1") { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <IStandardGeneralRoleMappingRelationInfo> list = this.service.GetMappingRelationPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <IStandardGeneralRoleMappingRelationInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); // 兼容 ExtJS 设置 outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
/// <summary>查找好友</summary> /// <param name="doc">Xml 文档对象</param> /// <returns></returns> public string FindFriends(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); paging.Query.Variables["scence"] = "FindFriends"; paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <IAccountInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <IAccountInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1" && AppsSecurity.IsAdministrator(KernelContext.Current.User, TasksConfiguration.ApplicationName)) { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <TaskCategoryInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <TaskCategoryInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1" && AppsSecurity.IsAdministrator(KernelContext.Current.User, BugConfiguration.ApplicationName)) { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <BugCategoryQueryInfo> list = this.service.GetQueryObjectPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <BugCategoryQueryInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1") { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <ApplicationEventInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <ApplicationEventInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + ","); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + "}"); return(outString.ToString()); }
public PaginatedList <ChitGroupModel> Get(int PageIndex, int PageSize) { var data = _context.ChitGroups.ProjectTo <ChitGroupModel>(MyMapper.config).OrderBy(x => x.AccessId.Substring(0, 1)).ThenBy(x => Convert.ToInt64(x.AccessId.Substring(1, x.AccessId.Length))); var paged = PagingHelper <ChitGroupModel> .Create(data, PageIndex, PageSize); return(paged); }
/// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回一个相关的实例列表.</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1") { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <TaskWorkItemInfo> list = this.service.GetPaging(KernelContext.Current.User.Id, paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":["); foreach (TaskWorkItemInfo item in list) { outString.Append("{"); outString.Append("\"id\":\"" + item.Id + "\","); outString.Append("\"applicationId\":\"" + item.ApplicationId + "\","); outString.Append("\"taskCode\":\"" + item.TaskCode + "\","); outString.Append("\"type\":\"" + item.Type + "\","); outString.Append("\"title\":\"" + StringHelper.ToSafeJson(item.Title) + "\","); outString.Append("\"tags\":\"" + item.Tags + "\","); outString.Append("\"content\":\"" + StringHelper.ToSafeJson(item.Content) + "\","); outString.Append("\"senderId\":\"" + StringHelper.ToSafeJson(item.SenderId) + "\","); outString.Append("\"receiverId\":\"" + item.ReceiverId + "\","); outString.Append("\"status\":\"" + item.Status + "\","); outString.Append("\"isRead\":\"" + item.IsRead + "\","); outString.Append("\"finishTime\":\"" + StringHelper.ToDate(item.FinishTime) + "\", "); outString.Append("\"createDate\":\"" + StringHelper.ToDate(item.CreateDate) + "\" "); outString.Append("},"); } if (outString.ToString().Substring(outString.Length - 1, 1) == ",") { outString.Remove(outString.Length - 1, 1); } outString.Append("],"); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); // 设置当前用户权限 if (XmlHelper.Fetch("su", doc) == "1") { paging.Query.Variables["elevatedPrivileges"] = "1"; } paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; IList <IMemberInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":["); int index = 0; foreach (IMemberInfo item in list) { index = outString.Length; outString.Append(AjaxUtil.Parse <IMemberInfo>(item)); outString.Insert(index + 1, string.Format("\"account\":{0},", AjaxUtil.Parse <IAccountInfo>(item.Account))); outString.Append(","); } if (outString.ToString().Substring(outString.Length - 1, 1) == ",") { outString = outString.Remove(outString.Length - 1, 1); } outString.Append("],"); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); // 兼容 ExtJS 设置 outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
/// <summary>获取加我好友请求信息</summary> /// <param name="doc"></param> /// <returns></returns> public string GetAcceptListPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); paging.Query.Variables["scence"] = "QueryAcceptList"; paging.Query.Variables["accountId"] = KernelContext.Current.User.Id; int rowCount = -1; DataTable table = this.service.GetAcceptListPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; // outString.Append("{\"data\":" + AjaxUtil.Parse<AccountFriendInfo>(list) + ","); outString.Append("{\"data\":["); foreach (DataRow row in table.Rows) { IAccountInfo friend = MembershipUtil.GetAccount(row["FriendAccountId"].ToString()); outString.Append("{"); outString.Append("\"accountId\":\"" + row["AccountId"].ToString() + "\","); outString.Append("\"friendAccountId\":\"" + row["FriendAccountId"].ToString() + "\","); outString.Append("\"friendAccountName\":\"" + friend.Name + "\","); outString.Append("\"friendCertifiedAvatar\":\"" + friend.CertifiedAvatar + "\","); outString.Append("\"friendCertifiedAvatarView\":\"" + friend.CertifiedAvatarView + "\","); outString.Append("\"reason\":\"" + StringHelper.ToSafeJson(row["Reason"].ToString()) + "\","); outString.Append("\"status\":" + row["Status"].ToString() + ","); outString.Append("\"createdDateView\":\"" + ((DateTime)row["CreatedDate"]).ToString("yyyy-MM-dd") + "\""); outString.Append("},"); } outString = StringHelper.TrimEnd(outString, ","); outString.Append("],"); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回一个相关的实例列表.</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper pages = PagingHelper.Create(XmlHelper.Fetch("pages", doc, "xml")); int rowCount = -1; IList <TaskWorkItemInfo> list = this.service.GetPaging(pages.RowIndex, pages.PageSize, pages.WhereClause, pages.OrderBy, out rowCount); pages.RowCount = rowCount; outString.Append("{\"data\":["); foreach (TaskWorkItemInfo item in list) { outString.Append("{"); outString.Append("\"id\":\"" + item.Id + "\","); outString.Append("\"applicationId\":\"" + item.ApplicationId + "\","); outString.Append("\"taskCode\":\"" + item.TaskCode + "\","); outString.Append("\"type\":\"" + item.Type + "\","); outString.Append("\"title\":\"" + StringHelper.ToSafeJson(item.Title) + "\","); outString.Append("\"content\":\"" + StringHelper.ToSafeJson(item.Content) + "\","); outString.Append("\"tags\":\"" + StringHelper.ToSafeJson(item.Tags) + "\","); outString.Append("\"senderId\":\"" + StringHelper.ToSafeJson(item.SenderId) + "\","); outString.Append("\"receiverId\":\"" + StringHelper.ToSafeJson(item.ReceiverId) + "\","); outString.Append("\"status\":\"" + item.Status + "\","); outString.Append("\"createDate\":\"" + item.CreateDate.ToString("yyyy,MM,dd,HH,mm,ss") + "\","); outString.Append("\"createDateView\":\"" + item.CreateDate.ToString("yyyy-MM-dd") + "\""); outString.Append("},"); } if (outString.ToString().Substring(outString.Length - 1, 1) == ",") { outString.Remove(outString.Length - 1, 1); } outString.Append("],"); outString.Append("\"pages\":" + pages + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
public void TestCreate() { string outString = @"<?xml version=""1.0"" encoding=""utf-8"" ?> <root> <action><![CDATA[getPaging]]></action> <paging><rowIndex>100</rowIndex><pageSize>15</pageSize><rowCount>1000</rowCount><pageCount>100</pageCount><currentPage>10</currentPage><firstPage>0</firstPage><previousPage>0</previousPage><nextPage>0</nextPage><lastPage>0</lastPage><whereClause></whereClause><orderBy></orderBy></paging> </root>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(outString); string pagingXml = XmlHelper.Fetch("paging", doc, "xml"); PagingHelper paging = PagingHelper.Create(pagingXml); Assert.AreEqual(15, paging.PageSize); Assert.AreEqual(10, paging.CurrentPage); }
public string ReportRoleTreeView(XmlDocument doc) { StringBuilder outString = new StringBuilder(); string corporationLeaderId = XmlHelper.Fetch("corporationLeaderId", doc); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); int rowCount = -1; IList <IRoleInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":["); int index = 0; foreach (IRoleInfo item in list) { index = outString.Length; outString.Append(AjaxUtil.Parse <IRoleInfo>(item)); outString.Append(","); } if (outString.ToString().Substring(outString.Length - 1, 1) == ",") { outString = outString.Remove(outString.Length - 1, 1); } outString.Append("],"); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); // 兼容 ExtJS 设置 outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
public string GetPages(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper pages = PagingHelper.Create(XmlHelper.Fetch("pages", doc, "xml")); int rowCount = -1; IList <ApplicationPackageInfo> list = this.service.GetPaging(pages.RowIndex, pages.PageSize, pages.WhereClause, pages.OrderBy, out rowCount); pages.RowCount = rowCount; outString.Append("{\"ajaxStorage\":" + AjaxUtil.Parse <ApplicationPackageInfo>(list) + ","); outString.Append("\"pages\":" + pages + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); int rowCount = -1; IList <ApplicationMethodInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <ApplicationMethodInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
public string GetPages(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper pages = PagingHelper.Create(XmlHelper.Fetch("pages", doc, "xml")); int rowCount = -1; IList <NavigationPortalShortcutGroupInfo> list = this.service.GetPages(pages.RowIndex, pages.PageSize, pages.WhereClause, pages.OrderBy, out rowCount); pages.RowCount = rowCount; outString.Append("{\"ajaxStorage\":" + AjaxUtil.Parse <NavigationPortalShortcutGroupInfo>(list) + ","); outString.Append("\"pages\":" + pages + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"��ѯ�ɹ���\"}}"); return(outString.ToString()); }
/// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回一个相关的实例列表.</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper pages = PagingHelper.Create(XmlHelper.Fetch("pages", doc, "xml")); int rowCount = -1; IList <TaskHistoryItemInfo> list = this.service.GetPaging(KernelContext.Current.User.Id, pages.RowIndex, pages.PageSize, pages.WhereClause, pages.OrderBy, out rowCount); pages.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <TaskHistoryItemInfo>(list) + ","); outString.Append("\"pages\":" + pages + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("pages", doc, "xml")); int rowCount = -1; IList <AccountLogInfo> list = this.service.GetPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <AccountLogInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 自定义功能 // ------------------------------------------------------- #region 函数:GetPaging(XmlDocument doc) /// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string GetPaging(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "xml")); int rowCount = -1; IList <ForumThreadQueryInfo> list = this.service.GetQueryObjectPaging(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":" + AjaxUtil.Parse <ForumThreadQueryInfo>(list) + ","); outString.Append("\"paging\":" + paging + ","); outString.Append("\"message\":{\"returnCode\":0,\"value\":\"查询成功。\"},"); outString.Append("\"metaData\":{\"root\":\"data\",\"idProperty\":\"id\",\"totalProperty\":\"total\",\"successProperty\":\"success\",\"messageProperty\": \"message\"},"); outString.Append("\"total\":" + paging.RowCount + ","); outString.Append("\"success\":1,"); outString.Append("\"msg\":\"success\"}"); return(outString.ToString()); }
/// <summary>获取分页内容</summary> /// <param name="doc">Xml 文档对象</param> /// <returns></returns> public string GetAuthorizationObjects(XmlDocument doc) { StringBuilder outString = new StringBuilder(); PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml")); int rowCount = -1; DataTable table = MembershipManagement.Instance.AuthorizationObjectService.Filter(paging.RowIndex, paging.PageSize, paging.Query, out rowCount); paging.RowCount = rowCount; outString.Append("{\"data\":["); foreach (DataRow row in table.Rows) { outString.Append("{"); outString.Append("\"authorizationObjectId\":\"" + StringHelper.ToSafeJson(row["AuthorizationObjectId"].ToString()) + "\","); outString.Append("\"authorizationObjectName\":\"" + StringHelper.ToSafeJson(row["AuthorizationObjectName"].ToString()) + "\","); outString.Append("\"authorizationObjectType\":\"" + StringHelper.ToSafeJson(row["AuthorizationObjectType"].ToString()) + "\","); outString.Append("\"accountId\":\"" + StringHelper.ToSafeJson(row["AccountId"].ToString()) + "\","); outString.Append("\"accountGlobalName\":\"" + StringHelper.ToSafeJson(row["AccountGlobalName"].ToString()) + "\","); outString.Append("\"accountLoginName\":\"" + StringHelper.ToSafeJson(row["AccountLoginName"].ToString()) + "\"},"); } if (outString.ToString().Substring(outString.Length - 1, 1) == ",") { outString = outString.Remove(outString.Length - 1, 1); } outString.Append("],"); outString.Append("\"paging\":" + paging + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }