コード例 #1
0
ファイル: Logic.cs プロジェクト: xuchuansheng/GenXSource
        /// <summary>
        /// Starts a chat session by creating an inbox instance
        /// </summary>
        /// <param name="MemberID"></param>
        public static AjaxMember LoginToChatServer(string EmailAddress,string Password)
        {
            Next2Friends.Data.Member member = Login( EmailAddress,Password);

            AjaxMember m = new AjaxMember();
            m.WebMemberID = member.WebMemberID;
            m.FirstName = member.FirstName;
            m.LastName = member.LastName;
            m.NickName = member.NickName;
            m.Email = member.Email;
            m.OnlineStatus = OnlineStatus.Online;

            ChatInbox inbox = GetInbox(m.WebMemberID);            

            // if no existing instances exist then create one
            if (inbox == null)
            {               
                //log the user in
                inbox = new ChatInbox();
                inbox.MemberID = member.MemberID;
                inbox.MemberInfo = m;
                ChatInboxList.Add(inbox);
            }
            else
            {
                inbox.MemberInfo = m;
            }

            return m;
        }
コード例 #2
0
ファイル: Logic.cs プロジェクト: Shine6Z/GenXSource
        /// <summary>
        /// Starts a chat session by creating an inbox instance
        /// </summary>
        /// <param name="MemberID"></param>
        public static AjaxMember LoginToChatServer(string EmailAddress, string Password)
        {
            Next2Friends.Data.Member member = Login(EmailAddress, Password);

            AjaxMember m = new AjaxMember();

            m.WebMemberID  = member.WebMemberID;
            m.FirstName    = member.FirstName;
            m.LastName     = member.LastName;
            m.NickName     = member.NickName;
            m.Email        = member.Email;
            m.OnlineStatus = OnlineStatus.Online;

            ChatInbox inbox = GetInbox(m.WebMemberID);

            // if no existing instances exist then create one
            if (inbox == null)
            {
                //log the user in
                inbox            = new ChatInbox();
                inbox.MemberID   = member.MemberID;
                inbox.MemberInfo = m;
                ChatInboxList.Add(inbox);
            }
            else
            {
                inbox.MemberInfo = m;
            }

            return(m);
        }
コード例 #3
0
ファイル: Logic.cs プロジェクト: Shine6Z/GenXSource
        /// <summary>
        /// returns a list off all the members friends.
        /// </summary>
        /// <param name="MemberID">The MemberId of the requester</param>
        /// <returns>A list of AjaxMember</returns>
        public static List <AjaxMember> GetFriends(string WebMemberID)
        {
            ChatInbox         inbox      = GetInbox(WebMemberID);
            List <AjaxMember> retMembers = new List <AjaxMember>();

            if (inbox == null)
            {
                return(retMembers);
            }

            List <Next2Friends.Data.Member> members = Next2Friends.Data.Member.GetAllFriendsByMemberID(inbox.MemberID);

            foreach (Next2Friends.Data.Member member in members)
            {
                AjaxMember m = new AjaxMember();
                m.WebMemberID = member.WebMemberID;
                m.FirstName   = member.FirstName;
                m.LastName    = member.LastName;
                m.NickName    = member.NickName;
                m.Email       = member.Email;

                retMembers.Add(m);
            }


            return(retMembers);
        }
コード例 #4
0
ファイル: Logic.cs プロジェクト: xuchuansheng/GenXSource
        /// <summary>
        /// returns a list off all the members friends.
        /// </summary>
        /// <param name="MemberID">The MemberId of the requester</param>        
        /// <returns>A list of AjaxMember</returns>
        public static List<AjaxMember> GetFriends(string WebMemberID)
        {
            ChatInbox inbox = GetInbox(WebMemberID);
            List<AjaxMember> retMembers = new List<AjaxMember>();            

            if (inbox == null)
                return retMembers;

            List<Next2Friends.Data.Member> members =  Next2Friends.Data.Member.GetAllFriendsByMemberID(inbox.MemberID);

            foreach (Next2Friends.Data.Member member in members)
            {
                AjaxMember m = new AjaxMember();
                m.WebMemberID = member.WebMemberID;
                m.FirstName = member.FirstName;
                m.LastName = member.LastName;
                m.NickName = member.NickName;
                m.Email = member.Email;

                retMembers.Add(m);
            }


            return retMembers; 
        }