/// <summary> /// This method fetches a 'List<UserInterface>' object. /// This method uses the 'UserInterfaces_FetchAll' procedure. /// </summary> /// <returns>A 'List<UserInterface>'</returns> /// </summary> public List <UserInterface> FetchAllUserInterfaces(FetchAllUserInterfacesStoredProcedure fetchAllUserInterfacesProc, DataConnector databaseConnector) { // Initial Value List <UserInterface> userInterfaceCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allUserInterfacesDataSet = this.DataHelper.LoadDataSet(fetchAllUserInterfacesProc, databaseConnector); // Verify DataSet Exists if (allUserInterfacesDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allUserInterfacesDataSet); // if table exists if (table != null) { // Load Collection userInterfaceCollection = UserInterfaceReader.LoadCollection(table); } } } // return value return(userInterfaceCollection); }
/// <summary> /// This method creates an instance of a /// 'FetchAllUserInterfacesStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'UserInterface_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllUserInterfacesStoredProcedure' object.</returns> public static FetchAllUserInterfacesStoredProcedure CreateFetchAllUserInterfacesStoredProcedure(UserInterface userInterface) { // Initial value FetchAllUserInterfacesStoredProcedure fetchAllUserInterfacesStoredProcedure = new FetchAllUserInterfacesStoredProcedure(); // return value return(fetchAllUserInterfacesStoredProcedure); }
/// <summary> /// This method fetches all 'UserInterface' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'UserInterface' to delete. /// <returns>A PolymorphicObject object with all 'UserInterfaces' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <UserInterface> userInterfaceListCollection = null; // Create FetchAll StoredProcedure FetchAllUserInterfacesStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get UserInterfaceParameter // Declare Parameter UserInterface paramUserInterface = null; // verify the first parameters is a(n) 'UserInterface'. if (parameters[0].ObjectValue as UserInterface != null) { // Get UserInterfaceParameter paramUserInterface = (UserInterface)parameters[0].ObjectValue; } // Now create FetchAllUserInterfacesProc from UserInterfaceWriter fetchAllProc = UserInterfaceWriter.CreateFetchAllUserInterfacesStoredProcedure(paramUserInterface); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure userInterfaceListCollection = this.DataManager.UserInterfaceManager.FetchAllUserInterfaces(fetchAllProc, dataConnector); // if dataObjectCollection exists if (userInterfaceListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = userInterfaceListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }