Пример #1
0
        private void refreshDatabase()
        {

            try
            {           

                UserDBConnector userDBConnector = new UserDBConnector(Common.userName);         
                userDBConnector.prepareUserDBSchema(rootObj);
               
                AccessTokenDao accessTokenDao = new AccessTokenDao();
                accessTokenDao.saveAccessToken(rootObj.accessToken);

             
                UserWorkspaceDao workspaceDao = new UserWorkspaceDao();
                workspaceDao.saveWorkspaces(rootObj.userProfile.userWorkspaces);

                if (workspaceDao.getWorkspaceNameList() != null && workspaceDao.getWorkspaceNameList().Count != 0)
                {
                    List<UserWorkspace> workspaces = workspaceDao.getWorkspaceList();
                   
                    foreach (var workspace in workspaces)
                    {
                        RestClientFolder restClientFolder = new RestClientFolder();
                        restClientFolder.getAllFolders(rootObj.accessToken.tokenValue, workspace.WorkspaceId, 0);
                    }

                   // FolderDao folderDao = new FolderDao();
                    //folderDao.saveAllFolders(allFolderList);
                }

            }
            catch (Exception e)
            {
                MessageBox.Show("Error occured while refreshing data:" + e.Message);
               
            }

        }