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 UsersViewItem GetUsersViewItem(LoginUser loginUser, int userID) { UsersView usersView = new UsersView(loginUser); usersView.LoadByUserID(userID); if (usersView.IsEmpty) { return(null); } else { return(usersView[0]); } }
public UsersViewItem(DataRow row, UsersView usersView) : base(row, usersView) { _usersView = usersView; }