当前位置: 首页>>代码示例>>C#>>正文


C# SqliteDataReader.GetBoolean方法代码示例

本文整理汇总了C#中Mono.Data.Sqlite.SqliteDataReader.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# SqliteDataReader.GetBoolean方法的具体用法?C# SqliteDataReader.GetBoolean怎么用?C# SqliteDataReader.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Data.Sqlite.SqliteDataReader的用法示例。


在下文中一共展示了SqliteDataReader.GetBoolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetUserFromReader

		/// <summary>
		/// A helper function that takes the current row from the SqliteDataReader
		/// and hydrates a MembershipUser from the values. Called by the 
		/// MembershipUser.GetUser implementation.
		/// </summary>
		/// <param name="reader">SqliteDataReader object</param>
		/// <returns>MembershipUser object</returns>
		MembershipUser GetUserFromReader(SqliteDataReader reader)
		{
			object providerUserKey = reader.GetValue(0);
			string username = reader.GetString(1);
			string email = string.Empty;
			if (!reader.IsDBNull(2))
				email = reader.GetString(2);

			string passwordQuestion = string.Empty;
			if (!reader.IsDBNull(3))
				passwordQuestion = reader.GetString(3);
			
			string comment = string.Empty;
			if (!reader.IsDBNull(4))
				comment = reader.GetString(4);

			bool isApproved = reader.GetBoolean(5);
			bool isLockedOut = reader.GetBoolean(6);
			DateTime creationDate = reader.GetDateTime(7);

			DateTime lastLoginDate = new DateTime();
			if (!reader.IsDBNull(8))
				lastLoginDate = reader.GetDateTime(8);

			DateTime lastActivityDate = reader.GetDateTime(9);
			DateTime lastPasswordChangedDate = reader.GetDateTime(10);

			DateTime lastLockedOutDate = new DateTime();
			if (!reader.IsDBNull(11))
				lastLockedOutDate = reader.GetDateTime(11);

			MembershipUser u = new MembershipUser(this.Name,
												  username,
												  providerUserKey,
												  email,
												  passwordQuestion,
												  comment,
												  isApproved,
												  isLockedOut,
												  creationDate,
												  lastLoginDate,
												  lastActivityDate,
												  lastPasswordChangedDate,
												  lastLockedOutDate);
			
			return u;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:54,代码来源:SqliteMembershipProvider.cs

示例2: LoadCrlRecord

        X509CrlRecord LoadCrlRecord(SqliteDataReader reader, X509CrlParser parser, ref byte[] buffer)
        {
            var record = new X509CrlRecord ();

            for (int i = 0; i < reader.FieldCount; i++) {
                switch (reader.GetName (i)) {
                case "CRL":
                    record.Crl = DecodeX509Crl (reader, parser, i, ref buffer);
                    break;
                case "THISUPDATE":
                    record.ThisUpdate = reader.GetDateTime (i);
                    break;
                case "NEXTUPDATE":
                    record.NextUpdate = reader.GetDateTime (i);
                    break;
                case "DELTA":
                    record.IsDelta = reader.GetBoolean (i);
                    break;
                case "ID":
                    record.Id = reader.GetInt32 (i);
                    break;
                }
            }

            return record;
        }
开发者ID:vdaron,项目名称:MimeKit,代码行数:26,代码来源:X509CertificateDatabase.cs

示例3: GetUserFromReader

        //
        // GetUserFromReader
        //    A helper function that takes the current row from the SQLiteDataReader
        // and hydrates a MembershipUser from the values. Called by the
        // MembershipUser.GetUser implementation.
        //
        private MembershipUser GetUserFromReader(SqliteDataReader reader)
        {
            if (reader.GetString(1)=="") return null;
            object providerUserKey=null;
            string strGooid=Guid.NewGuid().ToString();
            if (reader.GetValue(0).ToString().Length > 0)
                providerUserKey = new Guid(reader.GetValue(0).ToString());
            else
                providerUserKey = new Guid(strGooid);
            string username = reader.GetString(1);
            string email = reader.GetString(2);

            string passwordQuestion = "";
            if (reader.GetValue(3) != DBNull.Value)
                passwordQuestion = reader.GetString(3);

            string comment = "";
            if (reader.GetValue(4) != DBNull.Value)
                comment = reader.GetString(4);

            bool tmpApproved = (reader.GetValue(5) == null);
             bool isApproved=false;
            if(tmpApproved)
            isApproved = reader.GetBoolean(5);

            bool tmpLockedOut = (reader.GetValue(6) == null);
            bool isLockedOut = false;
            if(tmpLockedOut)
            isLockedOut = reader.GetBoolean(6);

            DateTime creationDate = DateTime.Now;
            try
            {
                if (reader.GetValue(6) != DBNull.Value)
                    creationDate = reader.GetDateTime(7);
            }
            catch { }

            DateTime lastLoginDate = DateTime.Now;
            try
            {
                if (reader.GetValue(8) != DBNull.Value)
                    lastLoginDate = reader.GetDateTime(8);
            }
            catch { }

            DateTime lastActivityDate = DateTime.Now;
            try
            {
                if (reader.GetValue(9) != DBNull.Value)
                    lastActivityDate = reader.GetDateTime(9);
            }
            catch { }
            DateTime lastPasswordChangedDate = DateTime.Now;
            try
            {
                if (reader.GetValue(10) != DBNull.Value)
                    lastPasswordChangedDate = reader.GetDateTime(10);
            }
            catch { }

            DateTime lastLockedOutDate = DateTime.Now;
            try
            {
                if (reader.GetValue(11) != DBNull.Value)
                    lastLockedOutDate = reader.GetDateTime(11);
            }
            catch { }

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

            return u;
        }
开发者ID:samwa,项目名称:mcms,代码行数:91,代码来源:SQLiteMembershipProvider.cs

示例4: LoadCertificateRecord

        X509CertificateRecord LoadCertificateRecord(SqliteDataReader reader, X509CertificateParser parser, ref byte[] buffer)
        {
            var record = new X509CertificateRecord ();

            for (int i = 0; i < reader.FieldCount; i++) {
                switch (reader.GetName (i)) {
                case "CERTIFICATE":
                    record.Certificate = DecodeCertificate (reader, parser, i, ref buffer);
                    break;
                case "PRIVATEKEY":
                    record.PrivateKey = DecodePrivateKey (reader, i, ref buffer);
                    break;
                case "ALGORITHMS":
                    record.Algorithms = DecodeEncryptionAlgorithms (reader, i);
                    break;
                case "ALGORITHMSUPDATED":
                    record.AlgorithmsUpdated = reader.GetDateTime (i);
                    break;
                case "TRUSTED":
                    record.IsTrusted = reader.GetBoolean (i);
                    break;
                case "ID":
                    record.Id = reader.GetInt32 (i);
                    break;
                }
            }

            return record;
        }
开发者ID:vdaron,项目名称:MimeKit,代码行数:29,代码来源:X509CertificateDatabase.cs


注:本文中的Mono.Data.Sqlite.SqliteDataReader.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。