/// <summary> /// This method finds a 'ProjectReference' object. /// This method uses the 'ProjectReference_Find' procedure. /// </summary> /// <returns>A 'ProjectReference' object.</returns> /// </summary> public ProjectReference FindProjectReference(FindProjectReferenceStoredProcedure findProjectReferenceProc, DataConnector databaseConnector) { // Initial Value ProjectReference projectReference = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet projectReferenceDataSet = this.DataHelper.LoadDataSet(findProjectReferenceProc, databaseConnector); // Verify DataSet Exists if (projectReferenceDataSet != null) { // Get DataTable From DataSet DataRow row = this.DataHelper.ReturnFirstRow(projectReferenceDataSet); // if row exists if (row != null) { // Load ProjectReference projectReference = ProjectReferenceReader.Load(row); } } } // return value return(projectReference); }
/// <summary> /// This method finds a 'ProjectReference' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'ProjectReference' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject FindProjectReference(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals ProjectReference projectReference = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Find StoredProcedure FindProjectReferenceStoredProcedure findProjectReferenceProc = null; // verify the first parameters is a 'ProjectReference'. if (parameters[0].ObjectValue as ProjectReference != null) { // Get ProjectReferenceParameter ProjectReference paramProjectReference = (ProjectReference)parameters[0].ObjectValue; // verify paramProjectReference exists if (paramProjectReference != null) { // Now create findProjectReferenceProc from ProjectReferenceWriter // The DataWriter converts the 'ProjectReference' // to the SqlParameter[] array needed to find a 'ProjectReference'. findProjectReferenceProc = ProjectReferenceWriter.CreateFindProjectReferenceStoredProcedure(paramProjectReference); } // Verify findProjectReferenceProc exists if (findProjectReferenceProc != null) { // Execute Find Stored Procedure projectReference = this.DataManager.ProjectReferenceManager.FindProjectReference(findProjectReferenceProc, dataConnector); // if dataObject exists if (projectReference != null) { // set returnObject.ObjectValue returnObject.ObjectValue = projectReference; } } } 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 /// 'FindProjectReferenceStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'ProjectReference_Find'. /// </summary> /// <param name="projectReference">The 'ProjectReference' to use to /// get the primary key parameter.</param> /// <returns>An instance of an FetchUserStoredProcedure</returns> public static FindProjectReferenceStoredProcedure CreateFindProjectReferenceStoredProcedure(ProjectReference projectReference) { // Initial Value FindProjectReferenceStoredProcedure findProjectReferenceStoredProcedure = null; // verify projectReference exists if (projectReference != null) { // Instanciate findProjectReferenceStoredProcedure findProjectReferenceStoredProcedure = new FindProjectReferenceStoredProcedure(); // Now create parameters for this procedure findProjectReferenceStoredProcedure.Parameters = CreatePrimaryKeyParameter(projectReference); } // return value return(findProjectReferenceStoredProcedure); }