/// <summary> /// This method fetches all 'Project' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'Project' to delete. /// <returns>A PolymorphicObject object with all 'Projects' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <Project> projectListCollection = null; // Create FetchAll StoredProcedure FetchAllProjectsStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get ProjectParameter // Declare Parameter Project paramProject = null; // verify the first parameters is a(n) 'Project'. if (parameters[0].ObjectValue as Project != null) { // Get ProjectParameter paramProject = (Project)parameters[0].ObjectValue; } // Now create FetchAllProjectsProc from ProjectWriter fetchAllProc = ProjectWriter.CreateFetchAllProjectsStoredProcedure(paramProject); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure projectListCollection = this.DataManager.ProjectManager.FetchAllProjects(fetchAllProc, dataConnector); // if dataObjectCollection exists if (projectListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = projectListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }