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(); }
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(); }
public Assignment(string name, Supervisor superv) { this.Name = name; this.AssignmentSupervisor = superv; }