/// ----------------------------------------------------------------------------- /// <summary> /// Gets whether the user in question is online /// </summary> /// <remarks> /// </remarks> /// <param name="user">The user.</param> /// <returns>A Boolean indicating whether the user is online.</returns> /// ----------------------------------------------------------------------------- public override bool IsUserOnline(UserInfo user) { bool isOnline = false; var objUsersOnline = new UserOnlineController(); if (objUsersOnline.IsEnabled()) { Hashtable userList = objUsersOnline.GetUserList(); var onlineUser = (OnlineUserInfo) userList[user.UserID.ToString()]; if (onlineUser != null) { isOnline = true; } else { //Next try the Database onlineUser = CBO.FillObject<OnlineUserInfo>(_dataProvider.GetOnlineUser(user.UserID)); if (onlineUser != null) { isOnline = true; } } } return isOnline; }
/// <summary> /// Gets whether the user in question is online /// </summary> /// <remarks> /// </remarks> /// <param name="user">The user.</param> /// <returns>A Boolean indicating whether the user is online.</returns> /// <history> /// [cnurse] 03/14/2006 created /// </history> public override bool IsUserOnline( UserInfo user ) { bool isOnline = false; UserOnlineController objUsersOnline = new UserOnlineController(); if( objUsersOnline.IsEnabled() ) { //First try the Cache Hashtable userList = objUsersOnline.GetUserList(); OnlineUserInfo onlineUser = userList[user.UserID.ToString()] as OnlineUserInfo; if( onlineUser != null ) { isOnline = true; } else { //Next try the Database onlineUser = (OnlineUserInfo)CBO.FillObject( dataProvider.GetOnlineUser( user.UserID ), typeof( OnlineUserInfo ) ); if( onlineUser != null ) { isOnline = true; } } } return isOnline; }