private void GetTeamMembers(string userName) { DatabaseConnection dr = new DatabaseConnection(); string query = "SELECT firstname, lastname, testtype, date, score, passed, username " + "FROM person p LEFT JOIN testoccasion t ON p.id = t.id_user " + "WHERE id_testadmin = (SELECT id FROM person WHERE username = @userName) "; List<Person> teamMembers = dr.GetTeamMembers(query, userName); List<Person> personsWithUndoneTests = new List<Person>(); personsWithUndoneTests = GetPersonsWithTestToDo(teamMembers); PopulateChart(personsWithUndoneTests, teamMembers); }
private List<Person> GetTeamMembers(string userName) { DatabaseConnection dr = new DatabaseConnection(); string query = "SELECT firstname, lastname, testtype, date, score, passed, username " + "FROM person p LEFT JOIN testoccasion t ON p.id = t.id_user " + "WHERE id_testadmin = (SELECT id FROM person WHERE username = @userName) "+ "ORDER BY lastname, firstname, username, date DESC "; List<Person> teamMembers = dr.GetTeamMembers(query, userName); return teamMembers; }