Exemple #1
0
 public void RemoveSupervisorTest()
 {
     Supervisor supervisor = new Supervisor("TestName", "TestSurname");
     Assignment assignment = new Assignment("Test", supervisor);
     assignment.AssignmentSupervisor = null;
     Assert.AreEqual(null, assignment.AssignmentSupervisor);
 }
        public void Add(string name, Supervisor superv)
        {
            LoadAssignmentsFromDatabase();
            Assignment assignment = new Assignment(name, superv);

            using (ISession session = NhibernateService.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(assignment);
                    transaction.Commit();
                }
            }
            LoadAssignmentsFromDatabase();
            Notify();
        }
Exemple #3
0
 public void AddSupervisorTest()
 {
     Supervisor supervisor = new Supervisor("TestName", "TestSurname");
     Assignment assignment = new Assignment("Test", supervisor);
     Assert.AreEqual("TestName", assignment.AssignmentSupervisor.FirstName);
 }
        public void AddSupervisor(string fName, string lName)
        {
            LoadSupervisorsFromDatabase();
            Supervisor superv = new Supervisor(fName, lName);

            using (ISession session = NhibernateService.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(superv);
                    transaction.Commit();
                }
            }
            LoadSupervisorsFromDatabase();
            Notify();
        }
Exemple #5
0
 public Assignment(string name, Supervisor superv)
 {
     this.Name = name;
     this.AssignmentSupervisor = superv;
 }