Esempio n. 1
0
        /// <summary>
        /// 添加好友
        /// </summary>
        /// <param name="sNickName">好友昵称</param>
        private void add_friend(string sNickName)
        {
            UserBLL   udb      = new UserBLL();
            string    sReSql   = string.Empty;
            string    SorT     = string.Empty;
            DataTable dt       = new DataTable();
            string    FriendId = string.Empty;

            FriendId = udb.GetFriendID(sNickName);
            SorT     = udb.GetSorT(sNickName);
            bool bSuccess = udb.AddFriend(udb.user.UserID.ToString(), FriendId, SorT);

            if (bSuccess)
            {
                MessageBox.Show("添加好友成功!");
            }
            else
            {
                MessageBox.Show("该好友已存在!");
            }
        }