/// <summary> /// This method fetches a 'List<Adverb>' object. /// This method uses the 'Adverbs_FetchAll' procedure. /// </summary> /// <returns>A 'List<Adverb>'</returns> /// </summary> public List <Adverb> FetchAllAdverbs(FetchAllAdverbsStoredProcedure fetchAllAdverbsProc, DataConnector databaseConnector) { // Initial Value List <Adverb> adverbCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allAdverbsDataSet = this.DataHelper.LoadDataSet(fetchAllAdverbsProc, databaseConnector); // Verify DataSet Exists if (allAdverbsDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allAdverbsDataSet); // if table exists if (table != null) { // Load Collection adverbCollection = AdverbReader.LoadCollection(table); } } } // return value return(adverbCollection); }
/// <summary> /// This method creates an instance of a /// 'FetchAllAdverbsStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'Adverb_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllAdverbsStoredProcedure' object.</returns> public static FetchAllAdverbsStoredProcedure CreateFetchAllAdverbsStoredProcedure(Adverb adverb) { // Initial value FetchAllAdverbsStoredProcedure fetchAllAdverbsStoredProcedure = new FetchAllAdverbsStoredProcedure(); // return value return(fetchAllAdverbsStoredProcedure); }
/// <summary> /// This method fetches all 'Adverb' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'Adverb' to delete. /// <returns>A PolymorphicObject object with all 'Adverbs' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <Adverb> adverbListCollection = null; // Create FetchAll StoredProcedure FetchAllAdverbsStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get AdverbParameter // Declare Parameter Adverb paramAdverb = null; // verify the first parameters is a(n) 'Adverb'. if (parameters[0].ObjectValue as Adverb != null) { // Get AdverbParameter paramAdverb = (Adverb)parameters[0].ObjectValue; } // Now create FetchAllAdverbsProc from AdverbWriter fetchAllProc = AdverbWriter.CreateFetchAllAdverbsStoredProcedure(paramAdverb); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure adverbListCollection = this.DataManager.AdverbManager.FetchAllAdverbs(fetchAllProc, dataConnector); // if dataObjectCollection exists if (adverbListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = adverbListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }