Esempio n. 1
0
        /// <summary>
        /// This method finds a  'User' object.
        /// This method uses the 'User_Find' procedure.
        /// </summary>
        /// <returns>A 'User' object.</returns>
        /// </summary>
        public User FindUser(FindUserStoredProcedure findUserProc, DataConnector databaseConnector)
        {
            // Initial Value
            User user = null;

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

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

                    // if row exists
                    if (row != null)
                    {
                        // Load User
                        user = UserReader.Load(row);
                    }
                }
            }

            // return value
            return(user);
        }