Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 /// <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;
     }
 }