Пример #1
0
        /// <summary>
        /// hamids chat reference
        /// </summary>
        /// <param name="MemberID"></param>
        /// <returns></returns>
        public static List <Member> GetAllFriendsByMemberIDForPageLister(int MemberID)
        {
            Database db = DatabaseFactory.CreateDatabase();

            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetAllFriendsByMemberIDForPageLister");

            db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID);

            List <Member> members = new List <Member>();

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                members = Member.PopulateMemberWithJoin(dr);

                dr.Close();
            }

            return(members);
        }
Пример #2
0
        public static Member GetMemberViaNicknameNoEx(string Nickname)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMemberViaNickname");

            db.AddInParameter(dbCommand, "Nickname", DbType.String, Nickname);

            //execute the stored procedure
            IDataReader dr = db.ExecuteReader(dbCommand);

            List <Member> members = Member.PopulateMemberWithJoin(dr);

            dr.Close();

            if (members.Count == 0)
            {
                return(null);
            }

            return(members[0]);
        }
Пример #3
0
        public static List <Member> GetMembersByFullSearch2(string Keyword,
                                                            string FirstName, string LastName, string NickName,
                                                            int Gender, string Country, string City,
                                                            bool HasAvatarPhoto, string email,
                                                            int trade, int hobby, string ProfileKeyWords, string order)
        {
            if (string.IsNullOrEmpty(Keyword))
            {
                Keyword = null;
            }

            if (string.IsNullOrEmpty(FirstName))
            {
                FirstName = null;
            }

            if (string.IsNullOrEmpty(LastName))
            {
                LastName = null;
            }

            if (string.IsNullOrEmpty(NickName))
            {
                NickName = null;
            }

            if (string.IsNullOrEmpty(Country))
            {
                Country = null;
            }

            if (string.IsNullOrEmpty(City))
            {
                City = null;
            }

            if (string.IsNullOrEmpty(email))
            {
                email = null;
            }

            if (string.IsNullOrEmpty(ProfileKeyWords))
            {
                ProfileKeyWords = null;
            }

            Database db = DatabaseFactory.CreateDatabase();

            DbCommand dbcommand = db.GetStoredProcCommand("HG_GetMembersByFullSearch2");

            db.AddInParameter(dbcommand, "Keyword", DbType.String, Keyword);
            db.AddInParameter(dbcommand, "FirstName", DbType.String, FirstName);
            db.AddInParameter(dbcommand, "LastName", DbType.String, LastName);
            db.AddInParameter(dbcommand, "NickName", DbType.String, NickName);
            db.AddInParameter(dbcommand, "Gender", DbType.Int16, Gender);
            db.AddInParameter(dbcommand, "Country", DbType.String, Country);
            db.AddInParameter(dbcommand, "City", DbType.String, City);
            db.AddInParameter(dbcommand, "HasAvatarPhoto", DbType.Int16, HasAvatarPhoto == true ? 1 : -1);
            db.AddInParameter(dbcommand, "Email", DbType.String, email);
            db.AddInParameter(dbcommand, "Hobby", DbType.Int16, hobby);
            db.AddInParameter(dbcommand, "Trade", DbType.Int16, trade);
            db.AddInParameter(dbcommand, "ProfileKeywords", DbType.String, ProfileKeyWords);
            db.AddInParameter(dbcommand, "OrderByClause", DbType.String, order);

            List <Member> Members;

            using (IDataReader dr = db.ExecuteReader(dbcommand))
            {
                Members = Member.PopulateMemberWithJoin(dr);
                dr.Close();
            }

            return(Members);
        }