/// <summary> /// This method fetches a 'List<CustomReader>' object. /// This method uses the 'CustomReaders_FetchAll' procedure. /// </summary> /// <returns>A 'List<CustomReader>'</returns> /// </summary> public List <CustomReader> FetchAllCustomReaders(FetchAllCustomReadersStoredProcedure fetchAllCustomReadersProc, DataConnector databaseConnector) { // Initial Value List <CustomReader> customReaderCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allCustomReadersDataSet = this.DataHelper.LoadDataSet(fetchAllCustomReadersProc, databaseConnector); // Verify DataSet Exists if (allCustomReadersDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allCustomReadersDataSet); // if table exists if (table != null) { // Load Collection customReaderCollection = CustomReaderReader.LoadCollection(table); } } } // return value return(customReaderCollection); }
/// <summary> /// This method creates an instance of a /// 'FetchAllCustomReadersStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'CustomReader_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllCustomReadersStoredProcedure' object.</returns> public static FetchAllCustomReadersStoredProcedure CreateFetchAllCustomReadersStoredProcedure(CustomReader customReader) { // Initial value FetchAllCustomReadersStoredProcedure fetchAllCustomReadersStoredProcedure = new FetchAllCustomReadersStoredProcedure(); // return value return(fetchAllCustomReadersStoredProcedure); }
/// <summary> /// This method fetches all 'CustomReader' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'CustomReader' to delete. /// <returns>A PolymorphicObject object with all 'CustomReaders' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <CustomReader> customReaderListCollection = null; // Create FetchAll StoredProcedure FetchAllCustomReadersStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get CustomReaderParameter // Declare Parameter CustomReader paramCustomReader = null; // verify the first parameters is a(n) 'CustomReader'. if (parameters[0].ObjectValue as CustomReader != null) { // Get CustomReaderParameter paramCustomReader = (CustomReader)parameters[0].ObjectValue; } // Now create FetchAllCustomReadersProc from CustomReaderWriter fetchAllProc = CustomReaderWriter.CreateFetchAllCustomReadersStoredProcedure(paramCustomReader); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure customReaderListCollection = this.DataManager.CustomReaderManager.FetchAllCustomReaders(fetchAllProc, dataConnector); // if dataObjectCollection exists if (customReaderListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = customReaderListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }
/// <summary> /// This method creates an instance of a /// 'FetchAllCustomReadersStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'CustomReader_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllCustomReadersStoredProcedure' object.</returns> public static new FetchAllCustomReadersStoredProcedure CreateFetchAllCustomReadersStoredProcedure(CustomReader customReader) { // Initial value FetchAllCustomReadersStoredProcedure fetchAllCustomReadersStoredProcedure = new FetchAllCustomReadersStoredProcedure(); // If the customReader object exists if (customReader != null) { // if the TableId is set and FetchAllFortable is true if ((customReader.HasTableId) && (customReader.FetchAllForTable)) { // change the procedure name fetchAllCustomReadersStoredProcedure.ProcedureName = "CustomReader_FetchAllForTable"; // create the @TableId parameter fetchAllCustomReadersStoredProcedure.Parameters = SqlParameterHelper.CreateSqlParameters("@TableId", customReader.TableId); } } // return value return(fetchAllCustomReadersStoredProcedure); }