Пример #1
0
        /// <summary>
        /// gets all the members of the nspot
        /// </summary>
        /// <param name="NSpotID"></param>
        /// <returns></returns>
        public static List <Member> GetNSpotMembersByNSpotIDWithJoin(int NSpotID)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetNSpotMembersByNSpotIDWithJoin");

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

            List <Member> arr = null;

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                arr = Member.PopulateObjectWithJoin(dr);
                dr.Close();
            }

            return(arr);
        }
Пример #2
0
        public static List <Member> GetMutualFriends(Member Member1, Member Member2)
        {
            Database db = DatabaseFactory.CreateDatabase();

            DbCommand dbCommand = db.GetStoredProcCommand("[HG_GetMutualFriends]");

            db.AddInParameter(dbCommand, "MemberID1", DbType.Int32, Member1.MemberID);
            db.AddInParameter(dbCommand, "MemberID2", DbType.Int32, Member2.MemberID);

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

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                MutualFriends = Member.PopulateObjectWithJoin(dr);
                dr.Close();
            }

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

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

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

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

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

                dr.Close();
            }

            return(members);
        }