Exemplo n.º 1
0
        /// <summary>
        /// Deletes all users from database and from ram
        /// </summary>
        public void DeleteData()
        {
            UserDalController userC = new UserDalController();

            userC.DeleteAllData();
            LoggedIn     = null;
            usersByEmail = new Dictionary <string, User>();
            usersById    = new Dictionary <int, User>();
            log.Info("Deleted all users data stored in ram");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the users from the DB
        /// </summary>
        public void LoadData()
        {
            UserDalController dalC     = new UserDalController();
            List <UserDAL>    dalusers = dalC.SelectAllUsers();

            foreach (UserDAL daluser in dalusers)
            {
                User bizUser = new User(daluser);
                usersByEmail[bizUser.Email] = bizUser;
                usersById[bizUser.ID]       = bizUser;
            }
        }