private void GetTeamFolders(ITeamFoldersModel model, IMainPresenter presenter) { IMemberServices service = service = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion); service.ListTeamFolderUrl = ApplicationResource.ActionListTeamFolder; service.UserAgentVersion = ApplicationResource.UserAgent; string fileAccessToken = ApplicationResource.DefaultAccessToken; IDataResponse response = service.ListTeamFolders(fileAccessToken); if (response.StatusCode == HttpStatusCode.OK) { if (response.Data != null) { string data = response.Data.ToString(); dynamic jsonData = JsonConvert.DeserializeObject <dynamic>(data); // clear existing data first model.TeamFolders.Clear(); //changed from entries to team_folders int resultCount = jsonData["team_folders"].Count; for (int i = 0; i < resultCount; i++) { dynamic team_folders = jsonData["team_folders"][i]; dynamic teamFolderName = team_folders["name"]; dynamic teamFolderId = team_folders["team_folder_id"]; dynamic status = team_folders["status"][".tag"]; // update model TeamFoldersListViewItemModel lvItem = new TeamFoldersListViewItemModel() { TeamFolderName = teamFolderName, TeamFolderId = teamFolderId, Status = status }; model.TeamFolders.Add(lvItem); } } } }
public TeamFoldersModel GetTeamFolderIds() { TeamFoldersModel objectModel = new TeamFoldersModel(); foreach (var selectedObject in objectListView_TeamFoldersMembers.Objects) { if (((TeamFoldersListViewItemModel)selectedObject).IsChecked) { string teamFolderName = ((TeamFoldersListViewItemModel)selectedObject).TeamFolderName; string teamFolderId = ((TeamFoldersListViewItemModel)selectedObject).TeamFolderId; // update model TeamFoldersListViewItemModel lvItem = new TeamFoldersListViewItemModel() { TeamFolderName = teamFolderName, TeamFolderId = teamFolderId }; objectModel.TeamFolders.Add(lvItem); } } return(objectModel); }
public TeamFoldersModel GetTeamFolderIds() { TeamFoldersModel objectModel = new TeamFoldersModel(); foreach (var selectedObject in objectListView_TeamFoldersMembers.Objects) { if (((TeamFoldersListViewItemModel)selectedObject).IsChecked) { string teamFolderName = ((TeamFoldersListViewItemModel)selectedObject).TeamFolderName; string teamFolderId = ((TeamFoldersListViewItemModel)selectedObject).TeamFolderId; // update model TeamFoldersListViewItemModel lvItem = new TeamFoldersListViewItemModel() { TeamFolderName = teamFolderName, TeamFolderId = teamFolderId }; objectModel.TeamFolders.Add(lvItem); } } return objectModel; }
private void GetTeamFolders(ITeamFoldersModel model, IMainPresenter presenter) { IMemberServices service = service = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion); service.ListTeamFolderUrl = ApplicationResource.ActionListTeamFolder; service.UserAgentVersion = ApplicationResource.UserAgent; string fileAccessToken = ApplicationResource.DefaultAccessToken; IDataResponse response = service.ListTeamFolders(fileAccessToken); if (response.StatusCode == HttpStatusCode.OK) { if (response.Data != null) { string data = response.Data.ToString(); dynamic jsonData = JsonConvert.DeserializeObject<dynamic>(data); // clear existing data first model.TeamFolders.Clear(); //changed from entries to team_folders int resultCount = jsonData["team_folders"].Count; for (int i = 0; i < resultCount; i++) { dynamic team_folders = jsonData["team_folders"][i]; dynamic teamFolderName = team_folders["name"]; dynamic teamFolderId = team_folders["team_folder_id"]; dynamic status = team_folders["status"][".tag"]; // update model TeamFoldersListViewItemModel lvItem = new TeamFoldersListViewItemModel() { TeamFolderName = teamFolderName, TeamFolderId = teamFolderId, Status = status }; model.TeamFolders.Add(lvItem); } } } }