コード例 #1
0
ファイル: admin.aspx.cs プロジェクト: Drysen1/Uppgift_4
        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);
        }
コード例 #2
0
        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;
        }