示例#1
0
        public void TestPopulateDatabase(IApplicantDatabase appDatabase)
        {
            Applicant applicant1 = new Applicant("1910541231783", "Adrian", "Botez", 8, 8.75, 6, 7.75, 0.0);

            Applicant applicant2 = new Applicant("2342184593201", "Victor", "Rachieru", 7, 4.75, 4, 4.5, 0.0);

            Applicant applicant3 = new Applicant("1314541890188", "Marius", "Zavincu", 8, 9.75, 10, 6.75, 0.0);

            appDatabase.InsertRecord(applicant1);
            appDatabase.InsertRecord(applicant2);
            appDatabase.InsertRecord(applicant3);
        }
示例#2
0
        private void publishResults_Click(object sender, EventArgs e)
        {
            IApplicantDatabase appDatabase = ApplicantDatabase.InitializeDatabase("applicantTable.txt");

            TestPopulateDatabase(appDatabase);

            List <Applicant> listApplicants = appDatabase.SelectAllRecords();

            SortedList listApplicantsSortedByGrade = new SortedList();

            for (int iApp = 0; iApp < listApplicants.Count; iApp++)
            {
                Applicant applicant = listApplicants[iApp];

                double avgPonderateGrade = (applicant.BacGrade + applicant.InfoGrade + applicant.MathGrade) / 3;

                listApplicantsSortedByGrade.Add(avgPonderateGrade, applicant);
            }

            WriteResultsToPdfFile(listApplicantsSortedByGrade);
        }