/// <summary> /// This method fetches a 'List<Adjective>' object. /// This method uses the 'Adjectives_FetchAll' procedure. /// </summary> /// <returns>A 'List<Adjective>'</returns> /// </summary> public List <Adjective> FetchAllAdjectives(FetchAllAdjectivesStoredProcedure fetchAllAdjectivesProc, DataConnector databaseConnector) { // Initial Value List <Adjective> adjectiveCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allAdjectivesDataSet = this.DataHelper.LoadDataSet(fetchAllAdjectivesProc, databaseConnector); // Verify DataSet Exists if (allAdjectivesDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allAdjectivesDataSet); // if table exists if (table != null) { // Load Collection adjectiveCollection = AdjectiveReader.LoadCollection(table); } } } // return value return(adjectiveCollection); }
/// <summary> /// This method creates an instance of a /// 'FetchAllAdjectivesStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'Adjective_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllAdjectivesStoredProcedure' object.</returns> public static FetchAllAdjectivesStoredProcedure CreateFetchAllAdjectivesStoredProcedure(Adjective adjective) { // Initial value FetchAllAdjectivesStoredProcedure fetchAllAdjectivesStoredProcedure = new FetchAllAdjectivesStoredProcedure(); // return value return(fetchAllAdjectivesStoredProcedure); }
/// <summary> /// This method fetches all 'Adjective' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'Adjective' to delete. /// <returns>A PolymorphicObject object with all 'Adjectives' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <Adjective> adjectiveListCollection = null; // Create FetchAll StoredProcedure FetchAllAdjectivesStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get AdjectiveParameter // Declare Parameter Adjective paramAdjective = null; // verify the first parameters is a(n) 'Adjective'. if (parameters[0].ObjectValue as Adjective != null) { // Get AdjectiveParameter paramAdjective = (Adjective)parameters[0].ObjectValue; } // Now create FetchAllAdjectivesProc from AdjectiveWriter fetchAllProc = AdjectiveWriter.CreateFetchAllAdjectivesStoredProcedure(paramAdjective); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure adjectiveListCollection = this.DataManager.AdjectiveManager.FetchAllAdjectives(fetchAllProc, dataConnector); // if dataObjectCollection exists if (adjectiveListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = adjectiveListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }