/// <summary>
        /// ��ø��û������ĺ�������
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public IList<CY.UME.Core.Business.Friendship> GetAccountRequestList(CY.UME.Core.Business.Account account)
        {
            string sqlstr = "AccountId=" + account.Id;
            IList<Core.Business.Friendship> friendshiplist = new List<Core.Business.Friendship>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            string sqlwhere = "SELECT  * FROM [dbo].[Friendship] where ";
            sqlwhere += sqlstr + " ORDER BY [Id] desc";
            SqlDataReader reader = sql.ExecuteSqlReader(sqlwhere);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Friendship friendship = new Core.Business.Friendship();

                    if (!reader.IsDBNull(0)) friendship.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) friendship.AccountId = reader.GetInt64(1);
                    if (!reader.IsDBNull(2)) friendship.FriendId = reader.GetInt64(2);
                    if (!reader.IsDBNull(3)) friendship.GroupId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) friendship.IsChecked = reader.GetBoolean(4);
                    if (!reader.IsDBNull(5)) friendship.Remark = reader.GetString(5);
                    if (!reader.IsDBNull(6)) friendship.CommunicateNum = reader.GetInt32(6);
                    if (!reader.IsDBNull(7)) friendship.DateCreated = reader.GetDateTime(7);

                    friendship.MarkOld();
                    friendshiplist.Add(friendship);
                }
                reader.Close();
            }
            return friendshiplist;
        }
        public IList<Core.Business.Friendship> GetAllFriendship()
        {
            IList<Core.Business.Friendship> friendshiplist = new List<Core.Business.Friendship>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            SqlDataReader reader = sql.ExecuteSPReader("USP_Friendship_SelectAll");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Friendship friendship = new Core.Business.Friendship();

                    long id = reader.GetInt64(0);
                    friendship = Core.Business.Friendship.Load(id);

                    /*
                    if (!reader.IsDBNull(0)) friendship.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) friendship.AccountId = reader.GetInt64(1);
                    if (!reader.IsDBNull(2)) friendship.FriendId = reader.GetInt64(2);
                    if (!reader.IsDBNull(3)) friendship.GroupId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) friendship.CommunicateNum = reader.GetInt32(4);
                    if (!reader.IsDBNull(5)) friendship.DateCreated = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) friendship.IsChecked = reader.GetBoolean(6);
                    if (!reader.IsDBNull(7)) friendship.Remark = reader.GetString(7);
                    */

                    friendship.MarkOld();
                    friendshiplist.Add(friendship);
                }
                reader.Close();
            }
            return friendshiplist;
        }
        public IList<CY.UME.Core.Business.Friendship> GetRequestFriendList(CY.UME.Core.Business.Account account, CY.UME.Core.PagingInfo pagingInfo)
        {
            IList<Core.Business.Friendship> friendshiplist = new List<Core.Business.Friendship>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Tables", SqlDbType.VarChar, "Friendship");
            sql.AddParameter("@PK", SqlDbType.VarChar, "Id");
            sql.AddParameter("@Sort", SqlDbType.VarChar, "Id"); // CommunicateNum desc ���·�ҳ��Ч
            sql.AddParameter("@Fields", SqlDbType.VarChar, "[Id],[AccountId],[FriendId],[GroupId],[CommunicateNum],[DateCreated],[IsChecked],[Remark]");
            sql.AddParameter("@Filter", SqlDbType.VarChar, "[FriendId] = " + account.Id + " And [IsChecked]=0");
            sql.AddParameter("@PageNumber", SqlDbType.Int, pagingInfo.CurrentPage);
            sql.AddParameter("@PageSize", SqlDbType.Int, pagingInfo.PageSize);
            SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Friendship friendship = new Core.Business.Friendship();

                    long id = reader.GetInt64(0);
                    friendship = Core.Business.Friendship.Load(id);

                    /*
                    if (!reader.IsDBNull(0)) friendship.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) friendship.AccountId = reader.GetInt64(1);
                    if (!reader.IsDBNull(2)) friendship.FriendId = reader.GetInt64(2);
                    if (!reader.IsDBNull(3)) friendship.GroupId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) friendship.CommunicateNum = reader.GetInt32(4);
                    if (!reader.IsDBNull(5)) friendship.DateCreated = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) friendship.IsChecked = reader.GetBoolean(6);
                    if (!reader.IsDBNull(7)) friendship.Remark = reader.GetString(7);
                    */

                    friendship.MarkOld();
                    friendshiplist.Add(friendship);
                }
                reader.Close();
            }
            return friendshiplist;
        }