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


C# SqlDatabaseClient.ExecuteNonQuery方法代码示例

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


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

示例1: DeleteRoom

        public static void DeleteRoom(SqlDatabaseClient MySqlClient, uint RoomId)
        {
            MySqlClient.SetParameter("id", RoomId);
            MySqlClient.ExecuteNonQuery("DELETE FROM rooms WHERE id = @id LIMIT 1");

            MySqlClient.SetParameter("id", RoomId);
            MySqlClient.ExecuteNonQuery("DELETE FROM navigator_frontpage WHERE room_id = @id");

            RoomInfoLoader.RemoveFromCache(RoomId);
            Navigator.ReloadOfficialItems(MySqlClient);
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:11,代码来源:RoomManager.cs

示例2: CreateFriendship

 public static void CreateFriendship(SqlDatabaseClient MySqlClient, uint UserId1, uint UserId2, bool Confirmed)
 {
     for (int i = 0; i < (Confirmed ? 2 : 1); i++)
     {
         MySqlClient.SetParameter("user1", (i == 1 ? UserId1 : UserId2));
         MySqlClient.SetParameter("user2", (i == 1 ? UserId2 : UserId1));
         MySqlClient.SetParameter("accepted", (int)(Confirmed ? 1 : 0));
         MySqlClient.ExecuteNonQuery("INSERT INTO messenger_friendships (user_1_id,user_2_id,confirmed) VALUES (@user1,@user2,@accepted)");
     }
 }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:10,代码来源:MessengerHandler.cs

示例3: DestroyFriendship

        public static bool DestroyFriendship(SqlDatabaseClient MySqlClient, uint UserId1, uint UserId2)
        {
            int aff = 0;

            for (int i = 0; i < 2; i++)
            {
                MySqlClient.SetParameter("user1", (i == 1 ? UserId1 : UserId2));
                MySqlClient.SetParameter("user2", (i == 1 ? UserId2 : UserId1));
                aff += MySqlClient.ExecuteNonQuery("DELETE FROM messenger_friendships WHERE user_1_id = @user1 AND user_2_id = @user2 LIMIT 1");
            }

            return (aff > 0);
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:13,代码来源:MessengerHandler.cs

示例4: BanUser

        public static void BanUser(SqlDatabaseClient MySqlClient, uint UserId, string MessageText, uint ModeratorId, double Length)
        {
            MySqlClient.SetParameter("userid", UserId);
            MySqlClient.SetParameter("reason", MessageText);
            MySqlClient.SetParameter("timestamp", UnixTimestamp.GetCurrent());
            MySqlClient.SetParameter("timestampex", UnixTimestamp.GetCurrent() + Length);
            MySqlClient.SetParameter("moderator", ModeratorId);
            MySqlClient.ExecuteNonQuery("INSERT INTO bans (user_id,reason_text,timestamp_created,timestamp_expire,moderator_id) VALUES (@userid,@reason,@timestamp,@timestampex,@moderator)");

            lock (mSyncRoot)
            {
                mCharacterBlacklist.Add(UserId);
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:14,代码来源:ModerationBanManager.cs

示例5: AddOrUpdateData

        public void AddOrUpdateData(SqlDatabaseClient MySqlClient, uint QuestId, int Progress, bool ActiveQuest)
        {
            if (ActiveQuest)
            {
                if (mCurrentQuest > 0)
                {
                    MySqlClient.SetParameter("userid", mUserId);
                    MySqlClient.SetParameter("questid", mCurrentQuest);
                    MySqlClient.ExecuteNonQuery("UPDATE user_quests SET is_current = '0' WHERE user_id = @userid AND quest_id = @questid LIMIT 1");
                }

                mCurrentQuest = QuestId;
            }
            else if (mCurrentQuest == QuestId)
            {
                mCurrentQuest = 0;
            }

            MySqlClient.SetParameter("userid", mUserId);
            MySqlClient.SetParameter("questid", QuestId);
            MySqlClient.SetParameter("progress", Progress);
            MySqlClient.SetParameter("iscurrent", ActiveQuest ? "1" : "0");

            lock (mSyncRoot)
            {
                if (mInner.ContainsKey(QuestId))
                {
                    mInner[QuestId] = Progress;
                    MySqlClient.ExecuteNonQuery("UPDATE user_quests SET progress = @progress, is_current = @iscurrent WHERE user_id = @userid AND quest_id = @questid LIMIT 1");
                }
                else
                {
                    mInner.Add(QuestId, Progress);
                    MySqlClient.ExecuteNonQuery("INSERT INTO user_quests (user_id,quest_id,progress,is_current) VALUES (@userid,@questid,@progress,@iscurrent)");
                }
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:37,代码来源:QuestCache.cs

示例6: AddOrUpdateData

        public void AddOrUpdateData(SqlDatabaseClient MySqlClient, string Group, int Level, int Progress)
        {
            MySqlClient.SetParameter("userid", mUserId);
            MySqlClient.SetParameter("group", Group);
            MySqlClient.SetParameter("level", Level);
            MySqlClient.SetParameter("progress", Progress);

            lock (mSyncRoot)
            {
                if (mInner.ContainsKey(Group))
                {
                    mInner[Group].Level = Level;
                    mInner[Group].Progress = Progress;

                    MySqlClient.ExecuteNonQuery("UPDATE user_achievements SET level = @level, progress = @progress WHERE user_id = @userid AND group_id = @group LIMIT 1");
                }
                else
                {
                    mInner.Add(Group, new UserAchievement(Group, Level, Progress));

                    MySqlClient.ExecuteNonQuery("INSERT INTO user_achievements (user_id,group_id,level,progress) VALUES (@userid,@group,@level,@progress)");
                }
            }
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:24,代码来源:AchievementCache.cs

示例7: UpdateWeed

        public void UpdateWeed(SqlDatabaseClient MySqlClient, int Amount)
        {
            mWeed += Amount;

            MySqlClient.SetParameter("userid", mId);
            MySqlClient.SetParameter("weed", mWeed);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET weed = @weed WHERE id = @userid LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例8: UpdateWanted

        public void UpdateWanted(SqlDatabaseClient MySqlClient, int Value)
        {
            Wanted = Value;

            MySqlClient.SetParameter("id", Id);
            MySqlClient.SetParameter("wanted", Wanted);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET wanted = @wanted WHERE id = @id LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例9: Stop

        public void Stop(SqlDatabaseClient MySqlClient)
        {
            if (Stopped)
            {
                return;
            }

            mSocket.Close();
            mSocket = null;

            if (Authenticated)
            {
                mCharacterInfo.SynchronizeStatistics(MySqlClient);

                if (CurrentRoomId > 0)
                {
                    RoomManager.RemoveUserFromRoom(this, false);
                }

                MySqlClient.SetParameter("userid", CharacterId);
                MySqlClient.ExecuteNonQuery("UPDATE users SET online = 0 WHERE id = @userid");
                MessengerHandler.MarkUpdateNeeded(this, 0, true);
            }

            Output.WriteLine("Stopped and disconnected client " + Id + ".", OutputLevel.DebugInformation);

            mStoppedTimestamp = UnixTimestamp.GetCurrent();
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:28,代码来源:Session.cs

示例10: UpdateAchievementBadge

        public void UpdateAchievementBadge(SqlDatabaseClient MySqlClient, string AchievementGroup, Badge NewBadge)
        {
            MySqlClient.SetParameter("userid", mUserId);
            MySqlClient.SetParameter("sourcetype", "achievement");
            MySqlClient.SetParameter("sourcedata", AchievementGroup);
            MySqlClient.SetParameter("badgeid", NewBadge.Id);

            lock (mSyncRoot)
            {
                if (mAchievementBadges.ContainsKey(AchievementGroup))
                {
                    Badge OldBadge = mAchievementBadges[AchievementGroup];

                    if (OldBadge == NewBadge)
                    {
                        MySqlClient.ClearParameters();
                        return;
                    }

                    mIndexCache.Remove(OldBadge.Code);
                    mAchievementBadges[AchievementGroup] = NewBadge;

                    MySqlClient.ExecuteNonQuery("UPDATE badges SET badge_id = @badgeid WHERE user_id = @userid AND source_type = @sourcetype AND source_data = @sourcedata LIMIT 1");

                    foreach (KeyValuePair<int, Badge> Badge in mEquippedBadges)
                    {
                        if (Badge.Value.Id == OldBadge.Id)
                        {
                            mEquippedBadges[Badge.Key] = NewBadge;
                            break;
                        }
                    }
                }
                else
                {
                    mAchievementBadges.Add(AchievementGroup, NewBadge);
                    MySqlClient.ExecuteNonQuery("INSERT INTO badges (user_id,badge_id,source_type,source_data) VALUES (@userid,@badgeid,@sourcetype,@sourcedata)");
                }

                mRightsCache = RegenerateRights();
                mIndexCache.Add(NewBadge.Code);
            }
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:43,代码来源:BadgeCache.cs

示例11: UpdateLicence

        public void UpdateLicence(SqlDatabaseClient MySqlClient, int Value)
        {
            Licence = Value;

            MySqlClient.SetParameter("id", Id);
            MySqlClient.SetParameter("licence", Licence);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET licence = @licence WHERE id = @id LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例12: UpdateShotgun

        public void UpdateShotgun(SqlDatabaseClient MySqlClient, int Value)
        {
            Shotgun = Value;

            MySqlClient.SetParameter("id", Id);
            MySqlClient.SetParameter("shotgun", Shotgun);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET shotgun = @shotgun WHERE id = @id LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例13: UpdateScore

        public void UpdateScore(SqlDatabaseClient MySqlClient, int Amount)
        {
            mScore += Amount;

            MySqlClient.SetParameter("userid", mId);
            MySqlClient.SetParameter("score", mScore);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET score = @score WHERE id = @userid LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例14: UpdatePhone

        public void UpdatePhone(SqlDatabaseClient MySqlClient, int Value)
        {
            Phone = Value;

            MySqlClient.SetParameter("id", Id);
            MySqlClient.SetParameter("phone", Phone);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET phone = @phone WHERE id = @id LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs

示例15: UpdatePellet

        public void UpdatePellet(SqlDatabaseClient MySqlClient, int Value)
        {
            Pellet = Value;

            MySqlClient.SetParameter("id", Id);
            MySqlClient.SetParameter("pellet", Pellet);
            MySqlClient.ExecuteNonQuery("UPDATE characters SET pellet = @pellet WHERE id = @id LIMIT 1");
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:CharacterInfo.cs


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