コード例 #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 AdvancedImportJobs</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/4/2012 2:42:12 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static AdvancedImportJobs PopulateObjectsFromReaderWithCheckingReader(string ConnectionString,IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            AdvancedImportJobs list = new AdvancedImportJobs();

            if (rdr.Read())
            {
                AdvancedImportJob obj = new AdvancedImportJob(ConnectionString);
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new AdvancedImportJob(ConnectionString);
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return list;
            }
            else
            {
                oDatabaseHelper.Dispose();
                return null;
            }
        }
コード例 #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 AdvancedImportJobs</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			7/4/2012 2:42:12 PM		Created function
        /// 
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static AdvancedImportJobs PopulateObjectsFromReader(IDataReader rdr,string ConnectionString)
        {
            AdvancedImportJobs list = new AdvancedImportJobs();

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