• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IQueryAdapter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ReloadQuests

        public void ReloadQuests(IQueryAdapter dbClient)
        {
            quests.Clear();

            //dbClient.setQuery("SELECT * FROM quests");
            //DataTable dTable = dbClient.getTable();

            //uint id;
            //string category;
            //int num;
            //int type;
            //uint goalData;
            //string name;
            //int reward;
            //string dataBit;
            //foreach (DataRow dRow in dTable.Rows)
            //{
            //    id = Convert.ToUInt32(dRow["id"]);
            //    category = (string)dRow["category"];
            //    num = (int)dRow["series_number"];
            //    type = (int)dRow["goal_type"];
            //    goalData = Convert.ToUInt32(dRow["goal_data"]);
            //    name = (string)dRow["name"];
            //    reward = (int)dRow["reward"];
            //    dataBit = (string)dRow["data_bit"];

            //    Quest quest = new Quest(id, category, num, (QuestType)type, goalData, name, reward, dataBit);
            //    quests.Add(id, quest);
            //    AddToCounter(category);
            //}
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:31,代码来源:QuestManager.cs


示例2: LoadTopics

        //internal void ClearCategories()
        //{
        //    Categories.Clear();
        //}

        internal void LoadTopics(IQueryAdapter dbClient)
        {
            Topics.Clear();
            DataTable TopicData = null;

            dbClient.setQuery("SELECT id, title, body, subject, known_issue FROM help_topics");
            TopicData = dbClient.getTable();

            if (TopicData == null)
            {
                return;
            }

            foreach (DataRow Row in TopicData.Rows)
            {
                HelpTopic NewTopic = new HelpTopic(Convert.ToUInt32(Row["id"]), (string)Row["title"], (string)Row["body"], Convert.ToUInt32(Row["subject"]));

                Topics.Add(Convert.ToUInt32(Row["id"]), NewTopic);

                int Importance = int.Parse(Row["known_issue"].ToString());

                if (Importance == 1)
                {
                    KnownIssues.Add(NewTopic);
                }
                else if (Importance == 2)
                {
                    ImportantTopics.Add(NewTopic);
                }
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:36,代码来源:HelpTool.cs


示例3: Group

        public Group(DataRow Data, IQueryAdapter dbClient)
        {
            this.ID = Convert.ToInt32(Data["id"]);
            this.Name = Data["name"].ToString();
            this.Description = Data["description"].ToString();
            this.DateCreated = Data["date_created"].ToString();
            this.OwnerID = Convert.ToInt32(Data["users_id"]);
            this.RoomID = Convert.ToInt32(Data["rooms_id"]);
            this.ColorID1 = Convert.ToInt32(Data["color1"]);
            this.ColorID2 = Convert.ToInt32(Data["color2"]);
            this.Type = Convert.ToInt32(Data["type"]);
            this.RightsType = Convert.ToInt32(Data["rights_type"]);

            // Parse badge data
            string[] rawData = Data["badge_data"].ToString().Split((char)1);
            List<Tuple<int, int, int>> badgeData = new List<Tuple<int,int,int>>();
            for (int i = 0; i < rawData.Length; i++)
            {
                int value1 = int.Parse(rawData[i++]);
                int value2 = int.Parse(rawData[i++]);
                int value3 = int.Parse(rawData[i]);
                badgeData.Add(new Tuple<int, int, int>(value1, value2, value3));
            }

            this.BadgeData = badgeData;
            this.Members = new List<int>();

            // Load members
            dbClient.setQuery("SELECT * FROM group_memberships WHERE groups_id = @id");
            dbClient.addParameter("id", ID);
            foreach (DataRow row in dbClient.getTable().Rows)
            {
                this.Members.Add((int)row["users_id"]);
            }
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:35,代码来源:Group.cs


示例4: Initialize

        internal void Initialize(IQueryAdapter dbClient)
        {
            quests = new Dictionary<uint, Quest>();
            questCount = new Dictionary<string, int>();

            ReloadQuests(dbClient);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:7,代码来源:QuestManager.cs


示例5: GetAchievementLevels

        /// <summary>
        ///     Gets the achievement levels.
        /// </summary>
        /// <param name="achievements">The achievements.</param>
        /// <param name="dbClient">The database client.</param>
        internal static void GetAchievementLevels(out Dictionary<string, Achievement> achievements,
            IQueryAdapter dbClient)
        {
            achievements = new Dictionary<string, Achievement>();

            dbClient.SetQuery("SELECT * FROM achievements_data");

            foreach (DataRow dataRow in dbClient.GetTable().Rows)
            {
                string achievementName = dataRow["achievement_name"].ToString();

                AchievementLevel level = new AchievementLevel((uint) dataRow["achievement_level"], (uint) dataRow["reward_pixels"],
                    (uint) dataRow["reward_points"], (uint) dataRow["progress_needed"]);

                if (!achievements.ContainsKey(achievementName))
                    achievements.Add(achievementName,
                        new Achievement((uint) dataRow["id"], achievementName,
                            dataRow["achievement_category"].ToString()));

                if (!achievements[achievementName].CheckLevel(level))
                    achievements[achievementName].AddLevel(level);
                else
                    YupiWriterManager.WriteLine(
                        "Was Found a Duplicated Level for: " + achievementName + ", Level: " + level.Level,
                        "Yupi.Achievements", ConsoleColor.Cyan);
            }
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:32,代码来源:AchievementLevelFactory.cs


示例6: Init

 /// <summary>
 ///     Initializes the specified database client.
 /// </summary>
 /// <param name="dbClient">The database client.</param>
 internal static void Init(IQueryAdapter dbClient)
 {
     dbClient.SetQuery("SELECT userpeak FROM server_status");
     _userPeak = dbClient.GetInteger();
     _lowPriorityStopWatch = new Stopwatch();
     _lowPriorityStopWatch.Start();
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:11,代码来源:LowPriorityWorker.cs


示例7: ReloadQuests

        private void ReloadQuests(IQueryAdapter dbClient)
        {
            quests.Clear();

            dbClient.setQuery("SELECT * FROM quests");
            DataTable dTable = dbClient.getTable();

            uint id;
            string category;
            int num;
            int type;
            uint goalData;
            string name;
            int reward;
            string dataBit;
            foreach (DataRow dRow in dTable.Rows)
            {
                id = Convert.ToUInt32(dRow["id"]);
                category = (string)dRow["category"];
                num = (int)dRow["series_number"];
                type = (int)dRow["goal_type"];
                goalData = Convert.ToUInt32(dRow["goal_data"]);
                name = (string)dRow["name"];
                reward = (int)dRow["reward"];
                dataBit = (string)dRow["data_bit"];

                Quest quest = new Quest(id, category, num, (QuestType)type, goalData, name, reward, dataBit);
                quests.Add(id, quest);
                AddToCounter(category);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:31,代码来源:QuestManager.cs


示例8: LoadBans

		internal void LoadBans(IQueryAdapter dbClient)
		{
			this.bannedUsernames.Clear();
			this.bannedIPs.Clear();
			this.bannedMachines.Clear();
			dbClient.setQuery("SELECT bantype,value,reason,expire FROM bans");
			DataTable table = dbClient.getTable();
			double num = (double)CyberEnvironment.GetUnixTimestamp();
			foreach (DataRow dataRow in table.Rows)
			{
				string text = (string)dataRow["value"];
				string reasonMessage = (string)dataRow["reason"];
				double num2 = (double)dataRow["expire"];
				string a = (string)dataRow["bantype"];
				ModerationBanType type;
				if (a == "user")
				{
					type = ModerationBanType.USERNAME;
				}
				else
				{
					if (a == "ip")
					{
						type = ModerationBanType.IP;
					}
					else
					{
						type = ModerationBanType.MACHINE;
					}
				}
				ModerationBan moderationBan = new ModerationBan(type, text, reasonMessage, num2);
				if (num2 > num)
				{
					if (moderationBan.Type == ModerationBanType.USERNAME)
					{
                        if (!this.bannedUsernames.Contains(text))
						{
							this.bannedUsernames.Add(text, moderationBan);
						}
					}
					else
					{
						if (moderationBan.Type == ModerationBanType.IP)
						{
                            if (!this.bannedIPs.Contains(text))
							{
								this.bannedIPs.Add(text, moderationBan);
							}
						}
						else
						{
							if (!this.bannedMachines.ContainsKey(text))
							{
								this.bannedMachines.Add(text, moderationBan);
							}
						}
					}
				}
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:60,代码来源:ModerationBanManager.cs


示例9: Init

        /// <summary>
        ///     Initializes the specified database client.
        /// </summary>
        /// <param name="dbClient">The database client.</param>
        internal void Init(IQueryAdapter dbClient)
        {
            Polls.Clear();

            dbClient.SetQuery("SELECT * FROM polls_data WHERE enabled = '1'");

            var table = dbClient.GetTable();

            if (table == null)
                return;

            foreach (DataRow dataRow in table.Rows)
            {
                var num = uint.Parse(dataRow["id"].ToString());

                dbClient.SetQuery($"SELECT * FROM polls_questions WHERE poll_id = {num}");

                var table2 = dbClient.GetTable();

                var list = (from DataRow dataRow2 in table2.Rows select new PollQuestion(uint.Parse(dataRow2["id"].ToString()), (string) dataRow2["question"], int.Parse(dataRow2["answertype"].ToString()), dataRow2["answers"].ToString().Split('|'), (string) dataRow2["correct_answer"])).ToList();

                var value = new Poll(num, uint.Parse(dataRow["room_id"].ToString()), (string) dataRow["caption"], (string) dataRow["invitation"], (string) dataRow["greetings"], (string) dataRow["prize"], int.Parse(dataRow["type"].ToString()), list);

                Polls.Add(num, value);
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:30,代码来源:PollManager.cs


示例10: LoadRights

        /// <summary>
        ///     Loads the rights.
        /// </summary>
        /// <param name="dbClient">The database client.</param>
        internal void LoadRights(IQueryAdapter dbClient)
        {
            ClearRights();

            dbClient.SetQuery("SELECT * FROM server_fuses;");

            DataTable table = dbClient.GetTable();

            if (table == null)
                return;

            foreach (DataRow dataRow in table.Rows)
                if (!_cmdRights.ContainsKey(dataRow["command"].ToString()))
                    _cmdRights.Add(dataRow["command"].ToString(), dataRow["rank"].ToString());
                else
                    Writer.WriteLine($"Duplicate Fuse Command \"{dataRow[0]}\" found", "Yupi.Fuses");

            dbClient.SetQuery("SELECT * FROM server_fuserights");

            DataTable table2 = dbClient.GetTable();

            if (table2 == null)
                return;

            foreach (DataRow dataRow2 in table2.Rows)
                if ((int) dataRow2["min_sub"] > 0)
                    _subRights.Add(dataRow2["fuse"].ToString(), (int) dataRow2["min_sub"]);
                else
                    if (!_rights.ContainsKey(dataRow2["fuse"].ToString()))
                        _rights.Add(dataRow2["fuse"].ToString(), (uint)dataRow2["min_rank"]);             
        }
开发者ID:sgf,项目名称:Yupi,代码行数:35,代码来源:RoleManager.cs


示例11: InitAchievementManager

        internal static void InitAchievementManager(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT achievements.*, achievement_categories.name " +
                                "FROM achievements " +
                                "JOIN achievement_categories " +
                                "ON achievement_categories.id = achievements.category");

            DataTable dTable = dbClient.getTable();

            achievements = new Dictionary<uint, AchievementBase>();

            uint achievementID;
            uint levels;
            uint badgelevel;
            string badge;
            int pixelBase;
            int pixelMMPORG;
            int pixelReward;
            string category;
            foreach (DataRow dRow in dTable.Rows)
            {
                achievementID = Convert.ToUInt32(dRow[0]);
                levels = Convert.ToUInt32(dRow[1]);
                badgelevel = Convert.ToUInt32(dRow[2]);
                badge = (string)dRow[3];
                pixelBase = (int)dRow[4];
                pixelMMPORG = (int)dRow[5];
                pixelReward = (int)dRow[6];
                category = (string)dRow[8];

                AchievementBase achivement = new AchievementBase(achievementID, levels, badgelevel, badge, pixelBase, pixelMMPORG, pixelReward, category);
                achievements.Add(achievementID, achivement);
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:34,代码来源:AchievementManager.cs


示例12: LoadFromDatabase

        public void LoadFromDatabase(IQueryAdapter dbClient, Room insideRoom)
        {
            dbClient.setQuery("SELECT trigger_data FROM trigger_item WHERE trigger_id = @id ");
            dbClient.addParameter("id", (int)this.itemID);
            DataRow dRow = dbClient.getRow();
            if (dRow != null)
            {
                this.delay = Convert.ToInt32(dRow[0].ToString());
            }
            else
            {
                delay = 20;
            }

            dbClient.setQuery("SELECT triggers_item FROM trigger_in_place WHERE original_trigger = " + this.itemID);
            DataTable dTable = dbClient.getTable();
            RoomItem targetItem;
            foreach (DataRow dRows in dTable.Rows)
            {
                targetItem = insideRoom.GetRoomItemHandler().GetItem(Convert.ToUInt32(dRows[0]));
                if (targetItem == null || this.items.Contains(targetItem))
                    continue;
                this.items.Add(targetItem);
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:25,代码来源:PositionReset.cs


示例13: Init

        internal static void Init(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT userpeak FROM server_status");
            UserPeak = dbClient.getInteger();

            _runFrequency = int.Parse(FirewindEnvironment.GetConfig().GetEntry("backgroundworker.interval", "10000")); // leon is crazy, 300!?! (THIS IS MADNESS!!)
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:7,代码来源:LowPriorityWorker.cs


示例14: GetAchievementLevels

		internal static void GetAchievementLevels(out Dictionary<string, Achievement> achievements, IQueryAdapter dbClient)
		{
			achievements = new Dictionary<string, Achievement>();
			dbClient.setQuery("SELECT * FROM achievements");
			DataTable table = dbClient.getTable();
			foreach (DataRow dataRow in table.Rows)
			{
				uint id = Convert.ToUInt32(dataRow["id"]);
				string category = (string)dataRow["category"];
				string text = (string)dataRow["group_name"];
				int level = (int)dataRow["level"];
				int rewardPixels = (int)dataRow["reward_pixels"];
				int rewardPoints = (int)dataRow["reward_points"];
				int requirement = (int)dataRow["progress_needed"];
				AchievementLevel level2 = new AchievementLevel(level, rewardPixels, rewardPoints, requirement);
				if (!achievements.ContainsKey(text))
				{
					Achievement achievement = new Achievement(id, text, category);
					achievement.AddLevel(level2);
					achievements.Add(text, achievement);
				}
				else
				{
					achievements[text].AddLevel(level2);
				}
			}
		}
开发者ID:kessiler,项目名称:habboServer,代码行数:27,代码来源:AchievementLevelFactory.cs


示例15: InitGroups

        internal void InitGroups(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT * FROM groups_elements");
            DataTable table = dbClient.getTable();
            string type;

            foreach (DataRow row in table.Rows)
            {
                type = (string)row["Type"];
                GuildsPartsData data = new GuildsPartsData((int)row["Id"], (string)row["ExtraData1"], (string)row["ExtraData2"]);

                if (type == "Base")
                {
                    baseBadges.Add(data);
                }
                else if (data.ExtraData1.StartsWith("symbol_"))
                {
                    symbolBadges.Add(data);
                }
                else if (type == "Color1")
                {
                    colorBadges1.Add(data);
                }
                else if (type == "Color2")
                {
                    colorBadges2.Add(data);
                }
                else if (type == "Color3")
                {
                    colorBadges3.Add(data);
                    htmlBadges.Add(data.Id, data.ExtraData1);
                }
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:34,代码来源:GroupManager.cs


示例16: GetAchievementLevels

 /// <summary>
 /// Gets the achievement levels.
 /// </summary>
 /// <param name="achievements">The achievements.</param>
 /// <param name="dbClient">The database client.</param>
 internal static void GetAchievementLevels(out Dictionary<string, Achievement> achievements, IQueryAdapter dbClient)
 {
     achievements = new Dictionary<string, Achievement>();
     dbClient.SetQuery("SELECT * FROM achievements_data");
     DataTable table = dbClient.GetTable();
     foreach (DataRow dataRow in table.Rows)
     {
         uint id = Convert.ToUInt32(dataRow["id"]);
         var category = (string)dataRow["category"];
         var text = (string)dataRow["group_name"];
         var level = (int)dataRow["level"];
         var rewardPixels = (int)dataRow["reward_pixels"];
         var rewardPoints = (int)dataRow["reward_points"];
         var requirement = (int)dataRow["progress_needed"];
         var level2 = new AchievementLevel(level, rewardPixels, rewardPoints, requirement);
         if (!achievements.ContainsKey(text))
         {
             Achievement achievement = new Achievement(id, text, category);
             achievement.AddLevel(level2);
             achievements.Add(text, achievement);
         }
         else
         {
             if (!achievements[text].CheckLevel(level2))
                 achievements[text].AddLevel(level2);
             else
                 Out.WriteLine("Was Found a Duplicated Level for: " + text + ", Level: " + level2.Level, "[Azure.Achievements]", ConsoleColor.Cyan);
         }
     }
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:35,代码来源:AchievementLevelFactory.cs


示例17: Init

		internal void Init(IQueryAdapter DBClient)
		{
			this.Polls.Clear();
			DBClient.setQuery("SELECT * FROM polls WHERE enabled = '1'");
			DataTable table = DBClient.getTable();
			if (table != null)
			{
				foreach (DataRow dataRow in table.Rows)
				{
					uint num = uint.Parse(dataRow["id"].ToString());
					DBClient.setQuery("SELECT * FROM poll_questions WHERE poll_id = " + num);
					DataTable table2 = DBClient.getTable();
					List<PollQuestion> list = new List<PollQuestion>();
					foreach (DataRow dataRow2 in table2.Rows)
					{
						list.Add(new PollQuestion(uint.Parse(dataRow2["id"].ToString()), (string)dataRow2["question"], int.Parse(dataRow2["answertype"].ToString()), dataRow2["answers"].ToString().Split(new char[]
						{
							'|'
						}), (string)dataRow2["correct_answer"]));
					}
					Poll value = new Poll(num, uint.Parse(dataRow["room_id"].ToString()), (string)dataRow["caption"], (string)dataRow["invitation"], (string)dataRow["greetings"], (string)dataRow["prize"], int.Parse(dataRow["type"].ToString()), list);
					this.Polls.Add(num, value);
				}
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:25,代码来源:PollManager.cs


示例18: LoadRights

        //internal void LoadRoles(DatabaseClient dbClient)
        //{
        //    ClearRoles();

        //    DataTable Data = dbClient.getTable("SELECT * FROM ranks ORDER BY id ASC;");

        //    if (Data != null)
        //    {
        //        foreach (DataRow Row in Data.Rows)
        //        {
        //            Roles.Add((uint)Row["id"], new Role((uint)Row["id"], (string)Row["name"]));
        //        }
        //    }
        //}

        internal void LoadRights(IQueryAdapter dbClient)
        {
            ClearRights();

            dbClient.setQuery("SELECT fuse, rank FROM fuserights;");
            DataTable Data = dbClient.getTable();

            dbClient.setQuery("SELECT fuse, sub FROM fuserights_subs;");
            DataTable SubData = dbClient.getTable();

            if (Data != null)
            {
                foreach (DataRow Row in Data.Rows)
                {
                    Rights.Add((string)Row["fuse"], Convert.ToUInt32(Row["rank"]));
                }
            }

            if (SubData != null)
            {
                foreach (DataRow Row in SubData.Rows)
                {
                    SubRights.Add((string)Row["fuse"], (string)Row["sub"]);
                }
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:41,代码来源:RoleManager.cs


示例19: SaveTrigger

 internal static void SaveTrigger(IQueryAdapter dbClient, int itemID, int triggetItemID)
 {
     dbClient.setQuery("INSERT INTO trigger_in_place (original_trigger,triggers_item) VALUES (@my_id,@trigger_item)");
     dbClient.addParameter("my_id", itemID);
     dbClient.addParameter("trigger_item", triggetItemID);
     dbClient.runQuery();
 }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:7,代码来源:WiredUtillity.cs


示例20: Initialize

        public void Initialize(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT id,caption,min_rank FROM navigator_flatcats WHERE enabled = 2");
            DataTable dPrivCats = dbClient.getTable();

            dbClient.setQuery("SELECT * FROM navigator_publics ORDER BY ordernum ASC");
            DataTable dPubItems = dbClient.getTable();

            if (dPrivCats != null)
            {
                PrivateCategories.Clear();
                foreach (DataRow Row in dPrivCats.Rows)
                {
                    PrivateCategories.Add((int)Row["id"], new FlatCat((int)Row["id"], (string)Row["caption"], (int)Row["min_rank"]));
                }
            }

            if (dPubItems != null)
            {
                PublicItems.Clear();
                foreach (DataRow Row in dPubItems.Rows)
                {
                    PublicItems.Add((int)Row["id"], new PublicItem((int)Row["id"], int.Parse(Row["bannertype"].ToString()), (string)Row["caption"], (string)Row["description"],
                        (string)Row["image"], ((Row["image_type"].ToString().ToLower() == "internal") ? PublicImageType.INTERNAL : PublicImageType.EXTERNAL),
                        Convert.ToUInt32(Row["room_id"]), (int)Row["category_id"], (int)Row["category_parent_id"], SilverwaveEnvironment.EnumToBool(Row["recommended"].ToString()), (int)Row["typeofdata"], (string)Row["tag"]));
                }
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:28,代码来源:Navigator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IQueryBuilder类代码示例发布时间:2022-05-24
下一篇:
C# IQuery类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap