/// <summary>Initializes a new instance of the <see cref="EmployeeViewModel"/> class.</summary>
 /// <param name="vm">The view parameter.</param>
 /// <param name="employee">The Employee object.</param>
 public EmployeeViewModel(ViewModel vm, Employee employee = null)
 {
     this.viewModel             = vm;
     this.Employee              = new Employee();
     this.IsCreatingNewEmployee = vm.IsEditModeOff;
     this.TargetObjectType      = employee?.JobTitle;
     if (employee != null)
     {
         if (employee is Physician)
         {
             this.Employee       = this.Physician = new Physician((Physician)employee);
             this.EmployeeBackup = DataDispatcher.CloneBySerialization <Physician>(employee as Physician);
         }
         else if (employee is Nurse)
         {
             this.Employee       = this.Nurse = new Nurse((Nurse)employee);
             this.EmployeeBackup = DataDispatcher.CloneBySerialization <Nurse>(employee as Nurse);
         }
         else
         {
             this.Employee       = new Employee(employee);
             this.EmployeeBackup = DataDispatcher.CloneBySerialization <Employee>(employee);
         }
     }
 }
Beispiel #2
0
 internal FavoritesBatchActions(Favorites favorites, EntitiesCache <DbFavorite> cache, IPersistence persistence)
     : base(persistence)
 {
     this.favorites  = favorites;
     this.cache      = cache;
     this.dispatcher = persistence.Dispatcher;
 }
 internal Favorites(FilePersistence persistence)
 {
     this.persistence = persistence;
     this.dispatcher = persistence.Dispatcher;
     this.groups = this.persistence.GroupsStore;
     this.cache = new Dictionary<Guid,IFavorite>();
 }
Beispiel #4
0
            private void RegisterEventHandlers()
            {
                DataDispatcher dispatcher = this.persistence.Dispatcher;

                dispatcher.GroupsChanged      += new GroupsChangedEventHandler(this.OnDataChanged);
                dispatcher.FavoritesChanged   += new FavoritesChangedEventHandler(this.OnDataChanged);
                settings.ConfigurationChanged += new ConfigurationChangedHandler(this.OnSettingsConfigurationChanged);
            }
Beispiel #5
0
 internal Factory(Groups groups, Favorites favorites, StoredCredentials credentials,
     PersistenceSecurity persistenceSecurity, DataDispatcher dispatcher)
 {
     this.groups = groups;
     this.favorites = favorites;
     this.credentials = credentials;
     this.persistenceSecurity = persistenceSecurity;
     this.dispatcher = dispatcher;
 }
Beispiel #6
0
 internal Factory(Groups groups, Favorites favorites,
                  StoredCredentials credentials, DataDispatcher dispatcher,
                  ConnectionManager connectionManager)
 {
     this.groups            = groups;
     this.favorites         = favorites;
     this.credentials       = credentials;
     this.dispatcher        = dispatcher;
     this.connectionManager = connectionManager;
 }
Beispiel #7
0
 internal Favorites(SqlPersistence persistence, Groups groups, StoredCredentials credentials,
                    ConnectionManager connectionManager, FavoriteIcons favoriteIcons)
 {
     this.groups            = groups;
     this.credentials       = credentials;
     this.dispatcher        = persistence.Dispatcher;
     this.connectionManager = connectionManager;
     this.favoriteIcons     = new DbFavoriteImagesStore(this.dispatcher, favoriteIcons);
     this.batchActions      = new FavoritesBatchActions(this, this.cache, persistence);
 }
Beispiel #8
0
        private List <IFavorite> MergeWithNewTodays(SortableList <IFavorite> oldTodays)
        {
            List <IFavorite> newTodays = this.GetDateItems(HistoryIntervals.TODAY);

            if (oldTodays != null)
            {
                newTodays = DataDispatcher.GetMissingFavorites(newTodays, oldTodays);
            }
            return(newTodays);
        }
        private List <FavoriteConfigurationElement> MergeWithNewTodays(
            SortableList <FavoriteConfigurationElement> oldTodays)
        {
            List <FavoriteConfigurationElement> newTodays = this.GetDateItems(HistoryByFavorite.TODAY);

            if (oldTodays != null)
            {
                newTodays = DataDispatcher.GetMissingFavorites(newTodays, oldTodays);
            }
            return(newTodays);
        }
Beispiel #10
0
 internal static DbFavorite CreateFavorite(PersistenceSecurity persistenceSecurity, Groups groups,
     StoredCredentials credentials, DataDispatcher dispatcher)
 {
     var favorite = new DbFavorite();
     favorite.Display = new DbDisplayOptions();
     favorite.Security = new DbSecurityOptions();
     favorite.ExecuteBeforeConnect = new DbBeforeConnectExecute();
     favorite.AssignStores(groups, credentials, persistenceSecurity, dispatcher);
     favorite.MarkAsNewlyCreated();
     return favorite;
 }
        internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence)
        {
            this.treeList = treeListToFill;
            this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand);

            this.persistedGroups = persistence.Groups;
            this.favorites = persistence.Favorites;
            this.dispatcher = persistence.Dispatcher;
            this.dispatcher.GroupsChanged += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged);
            this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged);
        }
Beispiel #12
0
        /// <summary>
        ///     Does not set the protocol options.
        /// </summary>
        internal static DbFavorite CreateFavorite(Groups groups, StoredCredentials credentials,
                                                  DataDispatcher dispatcher)
        {
            var favorite = new DbFavorite();

            favorite.Display              = new DbDisplayOptions();
            favorite.Security             = new DbSecurityOptions();
            favorite.ExecuteBeforeConnect = new DbBeforeConnectExecute();
            favorite.AssignStores(groups, credentials, dispatcher);
            favorite.MarkAsNewlyCreated();
            return(favorite);
        }
        internal FavoriteTreeListLoader(FavoritesTreeView treeListToFill, IPersistence persistence, FavoriteIcons favoriteIcons)
        {
            this.treeList              = treeListToFill;
            this.favoriteIcons         = favoriteIcons;
            this.treeList.AfterExpand += new TreeViewEventHandler(this.OnTreeViewExpand);

            this.toolTipBuilder               = new ToolTipBuilder(persistence.Security);
            this.persistedGroups              = persistence.Groups;
            this.favorites                    = persistence.Favorites;
            this.dispatcher                   = persistence.Dispatcher;
            this.dispatcher.GroupsChanged    += new GroupsChangedEventHandler(this.OnGroupsCollectionChanged);
            this.dispatcher.FavoritesChanged += new FavoritesChangedEventHandler(this.OnFavoritesCollectionChanged);
        }
 public StoredCredentials(SqlPersistenceSecurity persistenceSecurity, DataDispatcher dispatcher)
 {
     this.persistenceSecurity = persistenceSecurity;
     this.dispatcher = dispatcher;
 }
Beispiel #15
0
 public StoredCredentials(DataDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
 }
Beispiel #16
0
 internal Factory(Groups groups, DataDispatcher dispatcher, ConnectionManager connectionManager)
 {
     this.groups            = groups;
     this.dispatcher        = dispatcher;
     this.connectionManager = connectionManager;
 }
 internal static void RegisterDataEventHandler(DataDispatcher dispatcher)
 {
     dispatcher.ErrorOccurred += new EventHandler<DataErrorEventArgs>(DataErrorOccured);
 }
 internal ConnectionHistory(Favorites favorites, DataDispatcher dispatcher)
 {
     this.favorites = favorites;
     this.dispatcher = dispatcher;
 }
Beispiel #19
0
 internal DbFavoriteImagesStore(DataDispatcher dispatcher, FavoriteIcons favoriteIcons)
 {
     this.dispatcher    = dispatcher;
     this.favoriteIcons = favoriteIcons;
 }
Beispiel #20
0
 public void AssignStores(DataDispatcher dispatcher, Favorites favorites)
 {
     this.dispatcher = dispatcher;
     this.favorites  = favorites;
 }
 public void AssignStores(DataDispatcher dispatcher, Favorites favorites)
 {
     this.dispatcher = dispatcher;
     this.favorites = favorites;
 }
Beispiel #22
0
 internal ConnectionHistory(Favorites favorites, DataDispatcher dispatcher)
 {
     this.favorites  = favorites;
     this.dispatcher = dispatcher;
 }
 internal FavoritesBatchActions(Favorites favorites, EntitiesCache<DbFavorite> cache, DataDispatcher dispatcher)
 {
     this.favorites = favorites;
     this.cache = cache;
     this.dispatcher = dispatcher;
 }
Beispiel #24
0
 internal void AssignStores(Groups groups, StoredCredentials credentials, DataDispatcher dispatcher)
 {
     this.groups             = groups;
     this.credentials        = credentials;
     this.Details.Dispatcher = dispatcher;
 }
Beispiel #25
0
 internal Groups(FilePersistence persistence)
 {
     this.persistence = persistence;
     this.dispatcher = persistence.Dispatcher;
     this.cache = new Dictionary<Guid,IGroup>();
 }
Beispiel #26
0
 internal void AssignStores(Groups groups, DataDispatcher dispatcher, Favorites favorites)
 {
     this.groups     = groups;
     this.dispatcher = dispatcher;
     this.favorites  = favorites;
 }
Beispiel #27
0
 internal Factory(PersistenceSecurity persistenceSecurity, Groups groups, DataDispatcher dispatcher)
 {
     this.groups = groups;
     this.dispatcher = dispatcher;
     this.persistenceSecurity = persistenceSecurity;
 }
 internal static void RegisterDataEventHandler(DataDispatcher dispatcher)
 {
     dispatcher.ErrorOccurred += new EventHandler <DataErrorEventArgs>(DataErrorOccured);
 }