/// <summary>
        /// The load buddy list.
        /// </summary>
        /// <param name="charId">
        /// The char Id.
        /// </param>
        /// <returns>
        /// Buddy list
        /// </returns>
        public static Collection<BuddyListEntry> LoadBuddyList(int charId)
        {
            Collection<BuddyListEntry> buddyList = new Collection<BuddyListEntry>();
            SqlWrapper ms = new SqlWrapper();
            string sqlQuery = "SELECT `BuddyID` FROM `buddylist` WHERE PlayerID = " + "'" + charId + "'";
            DataTable dt = ms.ReadDatatable(sqlQuery);

            foreach (DataRow buddyRow in dt.Rows)
            {
                BuddyListEntry buddylistentry = new BuddyListEntry();
                buddylistentry.BuddyId = uint.Parse(buddyRow["BuddyID"].ToString());
                buddyList.Add(buddylistentry);
            }

            return buddyList;
        }
Beispiel #2
0
        /// <summary>
        /// The load buddy list.
        /// </summary>
        /// <param name="charId">
        /// The char Id.
        /// </param>
        /// <returns>
        /// Buddy list
        /// </returns>
        public static Collection <BuddyListEntry> LoadBuddyList(int charId)
        {
            Collection <BuddyListEntry> buddyList = new Collection <BuddyListEntry>();
            SqlWrapper ms       = new SqlWrapper();
            string     sqlQuery = "SELECT `BuddyID` FROM `buddylist` WHERE PlayerID = " + "'" + charId + "'";
            DataTable  dt       = ms.ReadDatatable(sqlQuery);

            foreach (DataRow buddyRow in dt.Rows)
            {
                BuddyListEntry buddylistentry = new BuddyListEntry();
                buddylistentry.BuddyId = uint.Parse(buddyRow["BuddyID"].ToString());
                buddyList.Add(buddylistentry);
            }

            return(buddyList);
        }