public RegistrationRequest SearchByRegistrationID(int id)
        {
            using (SqlConnection connection = new SqlConnection(connectionString)) {
                connection.Open();

                SqlCommand select = new SqlCommand("SELECT * FROM RegistrationRequest " +
                                                   "WHERE registrationID=@ID;");
                select.Parameters.AddWithValue("@ID", id);

                select.Connection = connection;
                SqlDataReader reader = select.ExecuteReader();

                if (reader.Read())
                {
                    CourseDAO    courseDAO    = new CourseDAO(connectionString);
                    UserTableDAO userTableDAO = new UserTableDAO(connectionString);

                    return(new RegistrationRequest(
                               Convert.ToInt32(reader["registrationID"]),

                               // Use the UserTableDAO to retrieve a User object
                               userTableDAO.SearchByEmail(Convert.ToString(reader["email"])),

                               // Use the CourseDAO to retrieve a Course object
                               courseDAO.SearchByCourseCode(Convert.ToString(reader["courseCode"])),

                               // Create a Status enum
                               (Status)Convert.ToInt32(reader["statusCode"])
                               ));
                }
            }
            return(null);
        }
        /// <summary>
        /// Retrieves all user requests based on a given user
        /// </summary>
        /// <param name="username">The username of the user</param>
        /// <returns>A list of all the user's request. Returns null if user has no requests, or user does not exist in database</returns>
        public List <RegistrationRequest> GetAllUserRequests(string username)
        {
            List <RegistrationRequest> requests = new List <RegistrationRequest>();

            using (SqlConnection connection = new SqlConnection(connectionString)) {
                connection.Open();

                SqlCommand select = new SqlCommand("SELECT * FROM RegistrationRequest WHERE email=@UEmail;");
                select.Parameters.AddWithValue("@UEmail", username);

                select.Connection = connection;
                SqlDataReader reader = select.ExecuteReader();

                while (reader.Read())
                {
                    CourseDAO    courseDAO    = new CourseDAO(connectionString);
                    UserTableDAO userTableDAO = new UserTableDAO(connectionString);

                    requests.Add(new RegistrationRequest(
                                     int.Parse(reader["registrationId"].ToString()),

                                     // Use the UserTableDAO to retrieve a User object
                                     userTableDAO.SearchByEmail(Convert.ToString(reader["email"])),

                                     // Use the CourseDAO to retrieve a Course object
                                     courseDAO.SearchByCourseCode(Convert.ToString(reader["courseCode"])),

                                     // Create a Status enum
                                     (Status)Convert.ToInt32(reader["statusCode"])
                                     ));
                }

                if (requests.Count < 0)
                {
                    return(null);
                }
            }
            return(requests);
        }