/// <summary>
 /// Takes, as input, a user name and a Boolean value indicating whether to update the LastActivityDate value for the user to show that the user is currently online. The GetUser method returns a MembershipUser object populated with current values from the data source for the specified user. If the user name is not found in the data source, the GetUser method returns null (Nothing in Visual Basic).
 /// </summary>
 /// <param name="username"></param>
 /// <param name="userIsOnline"></param>
 /// <returns></returns>
 public override MembershipUser GetUser(string username, bool userIsOnline)
 {
     using (SecurityDAO secDAO = new SecurityDAO())
     {
         User dbUser = secDAO.ReadUserByName(username);
         MembershipUser user = secDAO.ConvertUserToMembershipUser(dbUser, this.Name);
         if (userIsOnline)
         {
             secDAO.RecordUserActivity(dbUser);
         }
         return user;
     }
 }
 public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
 {
     using (SecurityDAO secDAO = new SecurityDAO())
     {
         Int32 id = Convert.ToInt32(providerUserKey);
         User dbUser = secDAO.ReadUserById(id);
         MembershipUser user = secDAO.ConvertUserToMembershipUser(dbUser, this.Name);
         if (userIsOnline)
         {
             secDAO.RecordUserActivity(dbUser);
         }
         return user;
     }
 }
 public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize,
     out int totalRecords)
 {
     MembershipUserCollection collection = new MembershipUserCollection();
     using (SecurityDAO secDAO = new SecurityDAO())
     {
         IList<User> users = secDAO.ListUsersByName(usernameToMatch, pageIndex, pageSize);
         foreach (User user in users)
         {
             collection.Add(secDAO.ConvertUserToMembershipUser(user, this.Name));
         }
         totalRecords = users.Count;
     }
     return collection;
 }