Example #1
0
        /// <summary>
        /// This method fetches a  'List<DTNTable>' object.
        /// This method uses the 'DTNTables_FetchAll' procedure.
        /// </summary>
        /// <returns>A 'List<DTNTable>'</returns>
        /// </summary>
        public List <DTNTable> FetchAllDTNTables(FetchAllDTNTablesStoredProcedure fetchAllDTNTablesProc, DataConnector databaseConnector)
        {
            // Initial Value
            List <DTNTable> dTNTableCollection = null;

            // Verify database connection is connected
            if ((databaseConnector != null) && (databaseConnector.Connected))
            {
                // First Get Dataset
                DataSet allDTNTablesDataSet = this.DataHelper.LoadDataSet(fetchAllDTNTablesProc, databaseConnector);

                // Verify DataSet Exists
                if (allDTNTablesDataSet != null)
                {
                    // Get DataTable From DataSet
                    DataTable table = this.DataHelper.ReturnFirstTable(allDTNTablesDataSet);

                    // if table exists
                    if (table != null)
                    {
                        // Load Collection
                        dTNTableCollection = DTNTableReader.LoadCollection(table);
                    }
                }
            }

            // return value
            return(dTNTableCollection);
        }