コード例 #1
0
        public AppointmentNotification(List <Appointment> tempAppointments, AppointmentRepo appointmentRepo, IPersistable persistable)
        {
            _appointments = tempAppointments;

            _persistable = persistable;

            _clientRepo       = ClientRepo.GetInstance(_persistable);
            _mailNotification = new MailNotification(_persistable);

            _appointmentRepo = appointmentRepo;
            appointmentRepo.AppointmentsChangedEventHandler += UpdateAppointments;

            EmailUpdateThread();
        }
コード例 #2
0
        private Controller()
        {
            IPersistable persistable = new DbController();

            _clientRepo = ClientRepo.GetInstance(persistable);
            _clientRepo.NewClientEventHandler += NewClientEventHandler;

            _practitionerRepo = PractitionerRepo.GetInstance(persistable);

            _departmentRepo = DepartmentRepo.GetInstance(persistable, _practitionerRepo.GetPractitioners());

            _appointmentRepo = AppointmentRepo.GetInstance(persistable, GetUsers(), _departmentRepo.GetDepartments());
            _appointmentRepo.AppointmentsChangedEventHandler += AppointmentsChangedEventHandler;

            UpdateFromDatabase updateFromDatabase = UpdateFromDatabase.GetInstance(persistable,
                                                                                   _clientRepo.GetClients(), _appointmentRepo.GetAppointments(), _practitionerRepo.GetPractitioners(),
                                                                                   _departmentRepo.GetDepartments());

            updateFromDatabase.ClientsUpdatedEventHandler      += _clientRepo.Update;
            updateFromDatabase.AppointmentsUpdatedEventHandler += _appointmentRepo.Update;
        }
コード例 #3
0
 public void ResetInstance()
 {
     _instance = null;
 }
コード例 #4
0
 public static AppointmentRepo GetInstance(IPersistable persistable, List <User> users, List <Department> departments)
 {
     return(_instance ?? (_instance = new AppointmentRepo(persistable, users, departments)));
 }