// this function return User object from the data layer.
        public static User getByEmail(string email)
        {
            UserD openedUser   = DataLayerUser2.open(email);
            User  returnedUser = null;

            if (openedUser != null)
            {
                returnedUser = new User(openedUser.getEmail(), openedUser.getPassword());
                returnedUser.setIsLoggedIn(openedUser.isLoggedIn());
                returnedUser.setNumberOfTasksAdded(openedUser.getNumOfTasksAdded());
                //returnedUser.setBoardsCollection(openedUser.getExistingBoards());

                LinkedList <BoardD> ListBoardD = DataLayerBoard2.Open(email);
                String boardsList = "";
                foreach (BoardD boardD in ListBoardD)
                {
                    Board b = new Board(email, boardD.getName());
                    b.setNumOfTasks(boardD.getNumberOfTasks());
                    b.open(email);
                    myBoards.Add(b.getBoardName(), b);
                    boardsList += "+" + boardD.getName();
                }
                returnedUser.setBoardsCollection(boardsList);
                returnedUser.setCurrBoard(openedUser.getLastBoard());
            }
            return(returnedUser);
        }
Esempio n. 2
0
        // this function return User object from the data layer.
        public static User getByEmail(string email)
        {
            UserD openedUser   = DataLayerUser.open(email);
            User  returnedUser = null;

            if (openedUser != null)
            {
                returnedUser = new User(openedUser.getEmail(), openedUser.getPassword());
                returnedUser.setIsLoggedIn(openedUser.isLoggedIn());
                returnedUser.setNumberOfTasksAdded(openedUser.getNumOfTasksAdded());
            }
            return(returnedUser);
        }