Exemplo n.º 1
0
        private MembershipUser GetUserFromReader(DataObject data)
        {
            object providerUserKey = data.getPrimaryKey();
            string username = (string) _User_Name.GetValue(data, null);
            string email = (string)_User_Email.GetValue(data, null);
            string passwordQuestion = (string)_User_PasswordQuestion.GetValue(data, null);
            string comment = (string)_User_Comment.GetValue(data, null);
            bool isApproved = (bool)_User_IsApproved.GetValue(data, null);
            bool isLockedOut = (bool)_User_IsLockedOut.GetValue(data, null);
            DateTime creationDate = (DateTime)_User_CreationDate.GetValue(data, null);
            DateTime lastLoginDate = (DateTime)_User_LastLoginDate.GetValue(data, null);
            DateTime lastActivityDate = (DateTime)_User_LastActivityDate.GetValue(data, null);
            DateTime lastPasswordChangedDate = (DateTime)_User_LastPasswordChangedDate.GetValue(data, null);
            DateTime lastLockedOutDate = (DateTime)_User_LastLockedOutDate.GetValue(data, null);

            MembershipUser u = new MembershipUser(this.Name,
                                                  username,
                                                  providerUserKey,
                                                  email,
                                                  passwordQuestion,
                                                  comment,
                                                  isApproved,
                                                  isLockedOut,
                                                  creationDate,
                                                  lastLoginDate,
                                                  lastActivityDate,
                                                  lastPasswordChangedDate,
                                                  lastLockedOutDate);

            return u;
        }
Exemplo n.º 2
0
 internal void BeforeInsert(DataObject sender)
 {
     if ((sender.getPrimaryKey() != null) && ((int)sender.getPrimaryKey() != 0))
     {
         remove(sender);
     }
 }