Exemple #1
0
        private void AddDummyData()
        {
            // Add Dummy Department
            Department a = new Department(1, "Computer Science", 5);
            Department b = new Department(2, "Computer Engineering", 5);
            Department c = new Department(3, "Electrical", 5);
            Department d = new Department(4, "CIVIL", 5);

            departments.Add(a);
            departments.Add(b);
            departments.Add(c);
            departments.Add(d);
            // Add Dummy Applications
            StudentApplication sa1    = new StudentApplication(1, "Muhammad Adnan", "Hafiz Mohib Ali", "*****@*****.**", "123456", 73.95);
            List <Preference>  PList1 = new List <Preference>();

            PList1.Add(new Preference("Computer Science", "First"));
            PList1.Add(new Preference("Computer Engineering", "Second"));
            PList1.Add(new Preference("Electrical Engineering", "Third"));
            sa1.preferences = PList1;
            applications.Add(sa1);

            StudentApplication sa2    = new StudentApplication(2, "Saqib Ameen", "Muhammad Ameen", "*****@*****.**", "123456", 90);
            List <Preference>  PList2 = new List <Preference>();

            PList2.Add(new Preference("Computer Engineering", "First"));
            PList2.Add(new Preference("Computer Science", "Second"));
            PList2.Add(new Preference("Electrical Engineering", "Third"));
            sa2.preferences = PList2;
            applications.Add(sa2);

            StudentApplication sa3    = new StudentApplication(3, "Muhammad Ramzan", "Nawab Ali", "*****@*****.**", "123456", 74.344);
            List <Preference>  PList3 = new List <Preference>();

            PList3.Add(new Preference("Computer Science", "First"));
            PList3.Add(new Preference("Computer Engineering", "Second"));
            PList3.Add(new Preference("Electrical Engineering", "Third"));
            sa3.preferences = PList3;
            applications.Add(sa3);

            StudentApplication sa4    = new StudentApplication(4, "Aurangzaib Sial", "Muhammad Nawaz", "*****@*****.**", "123456", 72.95);
            List <Preference>  PList4 = new List <Preference>();

            PList1.Add(new Preference("Electrical Engineering", "First"));
            PList1.Add(new Preference("Computer Engineering", "Second"));
            PList4.Add(new Preference("Computer Science", "Third"));


            sa4.preferences = PList4;
            applications.Add(sa4);
            //StudentApplication sa5 = new StudentApplication(1, "Adnan", "Hafiz Mohib Ali", "*****@*****.**", 73.95);
            //StudentApplication sa6 = new StudentApplication(1, "Adnan", "Hafiz Mohib Ali", "*****@*****.**", 73.95);
        }
Exemple #2
0
 // Add Student Application if it is not already added into the database
 public static bool AddStudentApplication(StudentApplication app)
 {
     foreach (StudentApplication std in applications)
     {
         // check on the behalf of the Uniquely identified ID Card number
         if (std.std_id_card.Equals(app.std_id_card))
         {
             return(false);
         }
     }
     applications.Add(app);
     // code to insert in the database
     return(true);
 }