Ejemplo n.º 1
0
        /// <summary>
        /// This method finds a  'Project' object.
        /// This method uses the 'Project_Find' procedure.
        /// </summary>
        /// <returns>A 'Project' object.</returns>
        /// </summary>
        public Project FindProject(FindProjectStoredProcedure findProjectProc, DataConnector databaseConnector)
        {
            // Initial Value
            Project project = null;

            // Verify database connection is connected
            if ((databaseConnector != null) && (databaseConnector.Connected))
            {
                // First Get Dataset
                DataSet projectDataSet = this.DataHelper.LoadDataSet(findProjectProc, databaseConnector);

                // Verify DataSet Exists
                if (projectDataSet != null)
                {
                    // Get DataTable From DataSet
                    DataRow row = this.DataHelper.ReturnFirstRow(projectDataSet);

                    // if row exists
                    if (row != null)
                    {
                        // Load Project
                        project = ProjectReader.Load(row);
                    }
                }
            }

            // return value
            return(project);
        }