Esempio n. 1
0
 public bool addRoster_has_employees(int rosterID, int employeeID)
 {
     try
     {
         IRoster_has_employees theRoster = Roster_has_employeesFactory.GetRoster_has_employees(rosterID, employeeID); // Using a Factory to create the user entity object. ie seperating object creation from business logic
         RosterHasEmployees.Add(theRoster);                                                                           // Add a reference to the newly created object to the Models UserList
         DataLayer.addNewRosterHasEmployeesToDB(theRoster);                                                           //Gets the DataLayer to add the new user to the DB.
         return(true);
     }
     catch (System.Exception excep)
     {
         return(false);
     }
 }
 public static void SetRoster_has_employees(IRoster_has_employees aRoster)   // This provides a seam in the factory where I can prime the factory with the user it will then cough up. (for test code)
 {
     roster = aRoster;
 }