public Int32 GetAccountInviteInfosCountByAcountId(long accountId)
        {
            int count = 0;

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@InviterId", SqlDbType.BigInt, accountId);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAccountInviteInfoCountByAccountId);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.AccountInviteInfo accountInviteInfo = new Core.Business.AccountInviteInfo();

                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
        // ��̨ʹ��
        public IList<AccountInviteInfo> GetAllAccountInviteInfo(IList<long> AccountIdList, string IsAccepted, DateTime BeginTime, DateTime EndTime, CY.UME.Core.PagingInfo pagingInfo)
        {
            List<Core.Business.AccountInviteInfo> accountInviteInfolist = new List<Core.Business.AccountInviteInfo>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            string tables = "AccountInviteInfo";
            int pageNum = pagingInfo.CurrentPage;
            int pageSize = pagingInfo.PageSize;
            string fields = "[Id],[DateCreated],[IsAccepted],[InviterId],[InviteeEmail],[Remark]";

            String sbFilter = SetStrFilter(AccountIdList, IsAccepted, BeginTime, EndTime);

            sql.AddParameter("@Tables", SqlDbType.VarChar, tables);
            sql.AddParameter("@PK", SqlDbType.NVarChar, "Id");
            sql.AddParameter("@Sort", SqlDbType.VarChar, "DateCreated DESC");
            sql.AddParameter("@PageNumber", SqlDbType.Int, pageNum);
            sql.AddParameter("@PageSize", SqlDbType.Int, pageSize);
            sql.AddParameter("@Fields", SqlDbType.VarChar, fields);
            sql.AddParameter("@Filter", SqlDbType.VarChar, sbFilter);
            SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.AccountInviteInfo accountInviteInfo = new Core.Business.AccountInviteInfo();

                    if (!reader.IsDBNull(0)) accountInviteInfo.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) accountInviteInfo.DateCreated = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) accountInviteInfo.IsAccepted = reader.GetBoolean(2);
                    if (!reader.IsDBNull(3)) accountInviteInfo.InviterId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) accountInviteInfo.InviteeEmail = reader.GetString(4);
                    if (!reader.IsDBNull(5)) accountInviteInfo.Remark = reader.GetString(5);

                    accountInviteInfo.MarkOld();
                    accountInviteInfolist.Add(accountInviteInfo);
                }
                reader.Close();
            }
            return accountInviteInfolist;
        }
        public Core.Business.AccountInviteInfo Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_AccountInviteInfo_Select_By_Id");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.AccountInviteInfo accountInviteInfo = new Core.Business.AccountInviteInfo();

                if (!reader.IsDBNull(0)) accountInviteInfo.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) accountInviteInfo.DateCreated = reader.GetDateTime(1);
                if (!reader.IsDBNull(2)) accountInviteInfo.IsAccepted = reader.GetBoolean(2);
                if (!reader.IsDBNull(3)) accountInviteInfo.InviterId = reader.GetInt64(3);
                if (!reader.IsDBNull(4)) accountInviteInfo.InviteeEmail = reader.GetString(4);
                if (!reader.IsDBNull(5)) accountInviteInfo.Remark = reader.GetString(5);

                reader.Close();
                return accountInviteInfo;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
        public IList<Core.Business.AccountInviteInfo> GetAllAccountInviteInfo()
        {
            IList<Core.Business.AccountInviteInfo> accountInviteInfolist = new List<Core.Business.AccountInviteInfo>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

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

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.AccountInviteInfo accountInviteInfo = new Core.Business.AccountInviteInfo();

                    if (!reader.IsDBNull(0)) accountInviteInfo.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) accountInviteInfo.DateCreated = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) accountInviteInfo.IsAccepted = reader.GetBoolean(2);
                    if (!reader.IsDBNull(3)) accountInviteInfo.InviterId = reader.GetInt64(3);
                    if (!reader.IsDBNull(4)) accountInviteInfo.InviteeEmail = reader.GetString(4);
                    if (!reader.IsDBNull(5)) accountInviteInfo.Remark = reader.GetString(5);

                    accountInviteInfo.MarkOld();
                    accountInviteInfolist.Add(accountInviteInfo);
                }
                reader.Close();
            }
            return accountInviteInfolist;
        }