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); }
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]); } }
public ChatClientsViewItem(DataRow row, ChatClientsView chatClientsView) : base(row, chatClientsView) { _chatClientsView = chatClientsView; }