Пример #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 SALSalesReturnLineCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static SALSalesReturnLineCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            SALSalesReturnLineCollection list = new SALSalesReturnLineCollection();

            while (rdr.Read())
            {
                SALSalesReturnLine obj = new SALSalesReturnLine();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
Пример #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 SALSalesReturnLineCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static SALSalesReturnLineCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            SALSalesReturnLineCollection list = new SALSalesReturnLineCollection();

            if (rdr.Read())
            {
                SALSalesReturnLine obj = new SALSalesReturnLine();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new SALSalesReturnLine();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }