Beispiel #1
0
        public void AddWorkshop()
        {
            personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
            OnlineWks owks = new OnlineWks("An Online Workshop", "How to give online workshops", DateTime.Now, 5, (Teacher)personlogic.GetPerson("159357"), "somelink");

            wkscrud.AddWorkshop(owks);
            Assert.AreEqual(owks, wkscrud.GetWorkshop(1));
        }
Beispiel #2
0
        public void AddAParticipantToAWks()
        {
            personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
            OnlineWks owks = new OnlineWks("An online workshop", "How to give online workshops", DateTime.Now, 5, (Teacher)personlogic.GetPerson("159357"), "somelink");
            Student   stu  = new Student("John", "Smith", "123456");

            personlogic.AddPerson(stu);
            wkslogic.AddParticipantToWks(owks, stu);
            List <Person> expected = new List <Person>()
            {
                stu
            };

            CollectionAssert.AreEqual(expected, owks.GetParticipants());
        }
Beispiel #3
0
 private void btnAddPeopleMan_Click(object sender, EventArgs e)
 {
     try
     {
         if (comboBoxPersonRole.SelectedIndex == 0)
         {
             personlogic.AddPerson(new Student(textBoxFName.Text, textBoxLName.Text, textBoxPCN.Text));
         }
         else
         {
             personlogic.AddPerson(new Teacher(textBoxFName.Text, textBoxLName.Text, textBoxPCN.Text));
         }
         UpdatePeopleListbox();
         textBoxFName.Text        = "";
         textBoxLName.Text        = "";
         textBoxPCN.Text          = "";
         btnSavePaopleMan.Visible = false;
         btnAddPeopleMan.Visible  = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
        public ReceptionistForm()
        {
            InitializeComponent();
            wslogic       = new WorkshopLogic();
            wscrudlogic   = new WorkshopCRUDLogic();
            personlogic   = new PersonLogic();
            enrollmentreq = new EnrollmentRequestLogic();

            PersonalForm pf = new PersonalForm(wslogic, wscrudlogic, personlogic, enrollmentreq);

            pf.Show();
            comboBoxTypeWsMan.SelectedIndex  = 0;
            comboBoxPersonRole.SelectedIndex = 0;

            enrollmentreq.EnrollmentRequestEvent += new IEnrollmentRequest.EnrollmentRequestHandler(enrollmentrequest_notification);

            //Dummy data
            personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
            personlogic.AddPerson(new Student("Sarah", "Student", "159359"));
            wscrudlogic.AddWorkshop(new OnlineWks("An Online Workshop", "How to give online workshops", DateTime.Now, 5, (Teacher)personlogic.GetPerson("159357"), "somelink"));
            UpdateLBER();
            UpdateWSListbox();
            UpdatePeopleListbox();
        }
Beispiel #5
0
 public void TitleEmptyTest()
 {
     personlogic.AddPerson(new Teacher("John", "Teacher", "159357"));
     OnlineWks owks = new OnlineWks("", "How to give online workshops", DateTime.Now, 5, (Teacher)personlogic.GetPerson("159357"), "somelink");
 }