コード例 #1
0
        public static ParticipantInfo GetParticipantInfo(LoginUser loginUser, int id, ChatParticipantType type)
        {
            ParticipantInfo result = null;

            switch (type)
            {
            case ChatParticipantType.User:
                UsersViewItem user = UsersView.GetUsersViewItem(loginUser, id);
                if (user != null)
                {
                    result = new ParticipantInfo(user.FirstName, user.LastName, user.Email, user.Organization, user.IsOnline);
                }
                break;

            case ChatParticipantType.External:
                ChatClientsViewItem client = ChatClientsView.GetChatClientsViewItem(loginUser, id);
                if (client != null)
                {
                    result = new ParticipantInfo(client.FirstName, client.LastName, client.Email, client.CompanyName, client.IsOnline);
                }
                break;

            default:
                break;
            }
            return(result);
        }
コード例 #2
0
        public static ChatClientsViewItem GetChatClientsViewItem(LoginUser loginUser, int chatClientID)
        {
            ChatClientsView chatClientsView = new ChatClientsView(loginUser);

            chatClientsView.LoadByChatClientID(chatClientID);
            if (chatClientsView.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(chatClientsView[0]);
            }
        }
コード例 #3
0
 public ChatClientsViewItem(DataRow row, ChatClientsView chatClientsView) : base(row, chatClientsView)
 {
     _chatClientsView = chatClientsView;
 }