Exemplo n.º 1
0
        /// <summary>
        /// Populates the fields for multiple objects from the columns found in an open reader.
        /// </summary>
        ///
        /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
        ///
        /// <returns>Object of MailSents</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/18/2010 6:41:13 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static MailSents PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper,string ConnectionString)
        {
            MailSents list = new MailSents();

            if (rdr.Read())
            {
                MailSent obj = new MailSent(ConnectionString);
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new MailSent(ConnectionString);
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return list;
            }
            else
            {
                oDatabaseHelper.Dispose();
                return null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Populates the fields for multiple objects from the columns found in an open reader.
        /// </summary>
        ///
        /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
        ///
        /// <returns>Object of MailSents</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			1/18/2010 6:41:13 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static MailSents PopulateObjectsFromReader(IDataReader rdr, string ConnectionString)
        {
            MailSents list = new MailSents();

            while (rdr.Read())
            {
                MailSent obj = new MailSent(ConnectionString);
                PopulateObjectFromReader(obj,rdr);
                list.Add(obj);
            }
            return list;
        }