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


C# QueryTables类代码示例

本文整理汇总了C#中QueryTables的典型用法代码示例。如果您正苦于以下问题:C# QueryTables类的具体用法?C# QueryTables怎么用?C# QueryTables使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetFriends

        public FriendInfo[] GetFriends(UUID principalID)
        {
            List<FriendInfo> infos = new List<FriendInfo>();

            QueryTables tables = new QueryTables();
            tables.AddTable(m_realm, "my");
            tables.AddTable(m_realm, "his", JoinType.Inner,
                            new[,] {{"my.Friend", "his.PrincipalID"}, {"my.PrincipalID", "his.Friend"}});
            QueryFilter filter = new QueryFilter();
            filter.andFilters["my.PrincipalID"] = principalID;
            List<string> query = GD.Query(new string[]
                                              {
                                                  "my.Friend",
                                                  "my.Flags",
                                                  "his.Flags"
                                              }, tables, filter, null, null, null);

            //These are used to get the other flags below
            for (int i = 0; i < query.Count; i += 3)
            {
                FriendInfo info = new FriendInfo
                                      {
                                          PrincipalID = principalID,
                                          Friend = query[i],
                                          MyFlags = int.Parse(query[i + 1]),
                                          TheirFlags = int.Parse(query[i + 2])
                                      };
                infos.Add(info);
            }
            return infos.ToArray();
        }
开发者ID:emperorstarfinder,项目名称:Virtual-Universe,代码行数:31,代码来源:LocalFriendsConnector.cs

示例2: GetAgentGroupMemberships

        public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID)
        {
            object remoteValue = DoRemote(requestingAgentID, AgentID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupMembershipData>) remoteValue;

            QueryTables tables = new QueryTables();
            tables.AddTable("osgroup", "osg");
            tables.AddTable("osgroupmembership", "osgm", JoinType.Inner, new[,] {{"osg.GroupID", "osgm.GroupID"}});
            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] {{"osgm.SelectedRoleID", "osr.RoleID"}});

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgm.AgentID"] = AgentID;

            string[] fields = new[]
                                  {
                                      "osgm.AcceptNotices",
                                      "osgm.Contribution",
                                      "osgm.ListInProfile",
                                      "osgm.SelectedRoleID",
                                      "osr.Title",
                                      "osr.Powers",
                                      "osg.AllowPublish",
                                      "osg.Charter",
                                      "osg.FounderID",
                                      "osg.Name",
                                      "osg.InsigniaID",
                                      "osg.MaturePublish",
                                      "osg.MembershipFee",
                                      "osg.OpenEnrollment",
                                      "osg.ShowInList",
                                      "osg.GroupID"
                                  };
            List<string> Membership = data.Query(fields, tables, filter, null, null, null);
            List<GroupMembershipData> results = new List<GroupMembershipData>();
            for (int loop = 0; loop < Membership.Count; loop += fields.Length)
            {
                results.Add(new GroupMembershipData
                                {
                                    AcceptNotices = int.Parse(Membership[loop + 0]) == 1,
                                    Active = true,
                                    //TODO: Figure out what this is and its effects if false
                                    ActiveRole = UUID.Parse(Membership[loop + 3]),
                                    AllowPublish = int.Parse(Membership[loop + 6]) == 1,
                                    Charter = Membership[loop + 7],
                                    Contribution = int.Parse(Membership[loop + 1]),
                                    FounderID = UUID.Parse(Membership[loop + 8]),
                                    GroupID = UUID.Parse(Membership[loop + 15]),
                                    GroupName = Membership[loop + 9],
                                    GroupPicture = UUID.Parse(Membership[loop + 10]),
                                    GroupPowers = ulong.Parse(Membership[loop + 5]),
                                    GroupTitle = Membership[loop + 4],
                                    ListInProfile = int.Parse(Membership[loop + 2]) == 1,
                                    MaturePublish = int.Parse(Membership[loop + 11]) == 1,
                                    MembershipFee = int.Parse(Membership[loop + 12]),
                                    OpenEnrollment = int.Parse(Membership[loop + 13]) == 1,
                                    ShowInList = int.Parse(Membership[loop + 14]) == 1
                                });
            }
            return results;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:61,代码来源:LocalGroupsServiceConnector.cs

示例3: GetGroupTitles

        public List<GroupTitlesData> GetGroupTitles(UUID requestingAgentID, UUID GroupID)
        {
            object remoteValue = DoRemote(requestingAgentID, GroupID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupTitlesData>) remoteValue;

            QueryTables tables = new QueryTables();
            tables.AddTable("osgroupmembership", "osgm");
            tables.AddTable("osgrouprolemembership", "osgrm", JoinType.Inner,
                            new[,] {{"osgm.AgentID", "osgrm.AgentID"}, {"osgm.GroupID", "osgrm.GroupID"}});
            tables.AddTable("osrole", "osr", JoinType.Inner,
                            new[,] {{"osgrm.RoleID", "osr.RoleID"}, {"osgm.GroupID", "osr.GroupID"}});

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgm.AgentID"] = requestingAgentID;
            filter.andFilters["osgm.GroupID"] = GroupID;

            List<string> Membership = data.Query(new[]
                                                     {
                                                         "osgm.SelectedRoleID",
                                                         "osgrm.RoleID",
                                                         "osr.Name"
                                                     }, tables, filter, null, null, null);

            List<GroupTitlesData> titles = new List<GroupTitlesData>();
            for (int loop = 0; loop < Membership.Count(); loop += 3)
            {
                titles.Add(new GroupTitlesData
                               {
                                   Name = Membership[loop + 2],
                                   UUID = UUID.Parse(Membership[loop + 1]),
                                   Selected = Membership[loop + 0] == Membership[loop + 1]
                               });
            }
            return titles;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:36,代码来源:LocalGroupsServiceConnector.cs

示例4: GetGroupRoleMembers

        public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
        {
            object remoteValue = DoRemote(requestingAgentID, GroupID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupRoleMembersData>) remoteValue;

            List<GroupRoleMembersData> RoleMembers = new List<GroupRoleMembersData>();

            QueryTables tables = new QueryTables();
            tables.AddTable("osgrouprolemembership", "osgrm");
            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] {{"osr.RoleID", "osgrm.RoleID"}});

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgrm.GroupID"] = GroupID;
            string[] fields = new[]
                                  {
                                      "osgrm.RoleID",
                                      "osgrm.AgentID",
                                      "osr.Powers"
                                  };
            List<string> Roles = data.Query(fields, tables, filter, null, null, null);

            GroupMembersData GMD = GetAgentGroupMemberData(requestingAgentID, GroupID, requestingAgentID);
            const long canViewMemebersBit = 140737488355328L;
            for (int i = 0; i < Roles.Count; i += fields.Length)
            {
                GroupRoleMembersData RoleMember = new GroupRoleMembersData
                                                      {
                                                          RoleID = UUID.Parse(Roles[i]),
                                                          MemberID = UUID.Parse(Roles[i + 1])
                                                      };

                // if they are a member, they can see everyone, otherwise, only the roles that are supposed to be shown
                if (GMD != null ||
                    ((long.Parse(Roles[i + 2]) & canViewMemebersBit) == canViewMemebersBit ||
                     RoleMember.MemberID == requestingAgentID))
                    RoleMembers.Add(RoleMember);
            }

            return RoleMembers;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:41,代码来源:LocalGroupsServiceConnector.cs

示例5: QueryFullData

 public abstract List<string> QueryFullData(string whereClause, QueryTables tables, string wantedValue);
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:1,代码来源:DataManagerBase.cs

示例6: QueryData

 public abstract DataReaderConnection QueryData(string whereClause, QueryTables tables, string wantedValue);
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:1,代码来源:DataManagerBase.cs

示例7: QueryNames

 public abstract Dictionary<string, List<string>> QueryNames(string[] keyRow, object[] keyValue,
                                                             QueryTables tables, string wantedValue);
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:2,代码来源:DataManagerBase.cs

示例8: QueryData

 public override IDataReader QueryData(string whereClause, QueryTables tables, string wantedValue)
 {
     string query = string.Format("SELECT {0} FROM {1} {2}", wantedValue, tables, whereClause);
     return QueryData2(query);
 }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:5,代码来源:SQLiteDataManager.cs

示例9: QueryNames

 public override Dictionary<string, List<string>> QueryNames(string[] keyRow, object[] keyValue,
     QueryTables tables, string wantedValue)
 {
     string query = string.Format("SELECT {0} FROM {1} where ", wantedValue, tables.ToSQL());
     return QueryNames2(keyRow, keyValue, query);
 }
开发者ID:BillBarnhill,项目名称:WhiteCore-Dev,代码行数:6,代码来源:MySQLDataManager.cs

示例10: QueryFullData

 public override List<string> QueryFullData(string whereClause, QueryTables tables, string wantedValue)
 {
     string query = string.Format("SELECT {0} FROM {1} {2}", wantedValue, tables.ToSQL(), whereClause);
     return QueryFullData2(query);
 }
开发者ID:BillBarnhill,项目名称:WhiteCore-Dev,代码行数:5,代码来源:MySQLDataManager.cs

示例11: QueryData

 public override DataReaderConnection QueryData(string whereClause, QueryTables tables, string wantedValue)
 {
     string query = string.Format("SELECT {0} FROM {1} {2}", wantedValue, tables.ToSQL(), whereClause);
     return new DataReaderConnection {DataReader = QueryData2(query)};
 }
开发者ID:BillBarnhill,项目名称:WhiteCore-Dev,代码行数:5,代码来源:MySQLDataManager.cs

示例12: Query

 public override List<string> Query(string[] wantedValue, QueryTables tables, QueryFilter queryFilter,
     Dictionary<string, bool> sort, uint? start, uint? count)
 {
     string query = string.Format("SELECT {0} FROM {1}", string.Join(", ", wantedValue), tables.ToSQL());
     return Query2(query, queryFilter, sort, start, count);
 }
开发者ID:BillBarnhill,项目名称:WhiteCore-Dev,代码行数:6,代码来源:MySQLDataManager.cs

示例13: QueryData

 public override DataReaderConnection QueryData(string whereClause, QueryTables tables, string wantedValue)
 {
     string query = string.Format("SELECT {0} FROM {1} {2}", wantedValue, tables, whereClause);
     SqliteConnection conn;
     var data = QueryData2(query, out conn);
     return new DataReaderConnection {DataReader = data, Connection = conn};
 }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:7,代码来源:SQLiteDataManager.cs

示例14: GetAgentGroupRoles

        public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID agentID, UUID groupID)
        {
            if (m_doRemoteOnly) {
                object remoteValue = DoRemote (requestingAgentID, agentID, groupID);
                return remoteValue != null ? (List<GroupRolesData>)remoteValue : new List<GroupRolesData> ();
            }

            //No permissions check necessary, we are checking only roles that they are in, so if they arn't in the group, that isn't a problem

            QueryTables tables = new QueryTables();
            tables.AddTable(_MEMBERSHIPROLEREALM, "osgm");
            tables.AddTable(_ROLEREALM, "osr", JoinType.Inner, new[,] {{"osgm.RoleID", "osr.RoleID"}});

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgm.AgentID"] = agentID;
            filter.andFilters["osgm.GroupID"] = groupID;

            string[] fields = new[]
                                  {
                                      "osr.Name",
                                      "osr.Description",
                                      "osr.Title",
                                      "osr.Powers",
                                      "osr.RoleID"
                                  };
            List<string> Roles = GD.Query(fields, tables, filter, null, null, null);

            filter = new QueryFilter();

            List<GroupRolesData> RolesData = new List<GroupRolesData>();

            for (int loop = 0; loop < Roles.Count; loop += fields.Length)
            {
                RolesData.Add(new GroupRolesData
                                  {
                                      RoleID = UUID.Parse(Roles[loop + 4]),
                                      Name = Roles[loop + 0],
                                      Description = Roles[loop + 1],
                                      Powers = ulong.Parse(Roles[loop + 3]),
                                      Title = Roles[loop + 2]
                                  });
            }

            return RolesData;
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:45,代码来源:LocalGroupsServiceConnector.cs

示例15: GetAgentGroupRoles

        public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID)
        {
            // I couldn't actually get this function to call when testing changes
            object remoteValue = DoRemote(requestingAgentID, AgentID, GroupID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupRolesData>) remoteValue;

            //No permissions check necessary, we are checking only roles that they are in, so if they arn't in the group, that isn't a problem

            QueryTables tables = new QueryTables();
            tables.AddTable("osgrouprolemembership", "osgm");
            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] {{"osgm.RoleID", "osr.RoleID"}});

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgm.AgentID"] = AgentID;
            filter.andFilters["osgm.GroupID"] = GroupID;

            string[] fields = new[]
                                  {
                                      "osr.Name",
                                      "osr.Description",
                                      "osr.Title",
                                      "osr.Powers",
                                      "osr.RoleID"
                                  };
            List<string> Roles = data.Query(fields, tables, filter, null, null, null);

            filter = new QueryFilter();

            List<GroupRolesData> RolesData = new List<GroupRolesData>();

            for (int loop = 0; loop < Roles.Count; loop += fields.Length)
            {
                RolesData.Add(new GroupRolesData
                                  {
                                      RoleID = UUID.Parse(Roles[loop + 4]),
                                      Name = Roles[loop + 0],
                                      Description = Roles[loop + 1],
                                      Powers = ulong.Parse(Roles[loop + 3]),
                                      Title = Roles[loop + 2]
                                  });
            }

            return RolesData;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:45,代码来源:LocalGroupsServiceConnector.cs


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