コード例 #1
0
        public static List <User> ReadAllUsers()
        {
            DataTable   DTuser   = UserDataManager.GetAllUsers();
            DataTable   DTrole   = UserDataManager.GetAllRoles();
            DataTable   DTteam   = UserDataManager.GetAllTeams();
            List <User> allUsers = UserMap.MapUserData(DTuser, DTrole, DTteam);

            HttpContext.Current.Session.Add(SessionManager.UserSession, allUsers);
            _allUsers = allUsers;
            return(_allUsers);

            //string filePath = _dataPath + "/User";
            //List<User> users = new List<User>();

            //if (Directory.Exists(filePath))
            //{
            //    string[] files = Directory.GetFiles(filePath);
            //    foreach (string file in files)
            //    {
            //        User user = XMLUtil.ReadFromXmlFile<User>(file);
            //        users.Add(user);
            //    }
            //}
            //else
            //    Directory.CreateDirectory(filePath);
            //return users;
        }