Esempio n. 1
0
 public override bool GetBoolean(int ordinal)
 {
     return(rdr.GetBoolean(ordinal));
 }
        /// <summary>
        /// Create a MembershipUser object from a data reader.
        /// </summary>
        /// <param name="sqlDataReader">Data reader.</param>
        /// <returns>MembershipUser object.</returns>
        private MembershipUser GetUserFromReader(
      OracleDataReader oracleDataReader
        )
        {
            object idPersonne = oracleDataReader.GetValue(0);
            string courriel = oracleDataReader.GetString(1);
            string motDePasse = oracleDataReader.GetString(2);
            string username = String.Empty;

            string passwordQuestion = String.Empty;
            if (oracleDataReader.GetValue(3) != DBNull.Value)
            {
                passwordQuestion = oracleDataReader.GetString(3);
            }

            string comment = String.Empty;
            if (oracleDataReader.GetValue(4) != DBNull.Value)
            {
                comment = oracleDataReader.GetString(4);
            }

            bool isApproved = true;
            if (oracleDataReader.GetBoolean(5) != null)
            {
                isApproved = oracleDataReader.GetBoolean(5);
            }
            bool isLockedOut = oracleDataReader.GetBoolean(6);
            if (oracleDataReader.GetBoolean(6) != null)
            {
                isLockedOut = oracleDataReader.GetBoolean(6);
            }
            DateTime creationDate = new DateTime();
            if (oracleDataReader.GetValue(7) != DBNull.Value)
            {
                creationDate = oracleDataReader.GetDateTime(7);
            }

            DateTime lastLoginDate = new DateTime();
            if (oracleDataReader.GetValue(8) != DBNull.Value)
            {
                lastLoginDate = oracleDataReader.GetDateTime(8);
            }

            DateTime lastActivityDate = new DateTime();
            if (oracleDataReader.GetValue(9) != DBNull.Value)
            {
                lastActivityDate = oracleDataReader.GetDateTime(9);
            }
            DateTime lastPasswordChangedDate = new DateTime();
            if (oracleDataReader.GetValue(10) != DBNull.Value)
            {
                lastPasswordChangedDate = oracleDataReader.GetDateTime(10);
            }

            DateTime lastLockedOutDate = new DateTime();
            if (oracleDataReader.GetValue(11) != DBNull.Value)
            {
                lastLockedOutDate = oracleDataReader.GetDateTime(11);
            }

            MembershipUser membershipUser = new MembershipUser(
              this.Name,
             username,
             idPersonne,
             courriel,
             passwordQuestion,
             comment,
             isApproved,
             isLockedOut,
             creationDate,
             lastLoginDate,
             lastActivityDate,
             lastPasswordChangedDate,
             lastLockedOutDate
              );

            return membershipUser;
        }