/// <summary>
        /// This method fetches a  'List<RawImport>' object.
        /// This method uses the 'RawImports_FetchAll' procedure.
        /// </summary>
        /// <returns>A 'List<RawImport>'</returns>
        /// </summary>
        public List <RawImport> FetchAllRawImports(FetchAllRawImportsStoredProcedure fetchAllRawImportsProc, DataConnector databaseConnector)
        {
            // Initial Value
            List <RawImport> rawImportCollection = null;

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

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

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

            // return value
            return(rawImportCollection);
        }
Esempio n. 2
0
        /// <summary>
        /// This method creates an instance of a
        /// 'FetchAllRawImportsStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'RawImport_FetchAll'.
        /// </summary>
        /// <returns>An instance of a(n) 'FetchAllRawImportsStoredProcedure' object.</returns>
        public static FetchAllRawImportsStoredProcedure CreateFetchAllRawImportsStoredProcedure(RawImport rawImport)
        {
            // Initial value
            FetchAllRawImportsStoredProcedure fetchAllRawImportsStoredProcedure = new FetchAllRawImportsStoredProcedure();

            // return value
            return(fetchAllRawImportsStoredProcedure);
        }
Esempio n. 3
0
        /// <summary>
        /// This method fetches all 'RawImport' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete.
        /// <returns>A PolymorphicObject object with all  'RawImports' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <RawImport> rawImportListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllRawImportsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get RawImportParameter
                // Declare Parameter
                RawImport paramRawImport = null;

                // verify the first parameters is a(n) 'RawImport'.
                if (parameters[0].ObjectValue as RawImport != null)
                {
                    // Get RawImportParameter
                    paramRawImport = (RawImport)parameters[0].ObjectValue;
                }

                // Now create FetchAllRawImportsProc from RawImportWriter
                fetchAllProc = RawImportWriter.CreateFetchAllRawImportsStoredProcedure(paramRawImport);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                rawImportListCollection = this.DataManager.RawImportManager.FetchAllRawImports(fetchAllProc, dataConnector);

                // if dataObjectCollection exists
                if (rawImportListCollection != null)
                {
                    // set returnObject.ObjectValue
                    returnObject.ObjectValue = rawImportListCollection;
                }
            }
            else
            {
                // Raise Error Data Connection Not Available
                throw new Exception("The database connection is not available.");
            }

            // return value
            return(returnObject);
        }