Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <PersonModel> > GetProfile()
        {
            var uid = new Guid(HttpContext.Request.Headers[AuthorizationHeaders.PersonUid].First());

            return(await _personLogic.GetPerson(uid));
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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");
 }
Exemplo n.º 5
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());
        }