/// <summary> /// Checks the API to get a new list of muscle groups /// </summary> private void ResetMuscleGroupView() { MuscleGroup.GetMusclegroups(); dataGridViewMuscleGroups.DataSource = ""; dataGridViewMuscleGroups.DataSource = MuscleGroup.muscleGroupList; }
private void GetInformation() { APIRequests request = new APIRequests(); var url = request.allMuscleGroupsEndpoint; var response = request.GetRequests(url); if (response == "") { MessageBox.Show("Sorry, can't connect to server"); } else { Thread muscleGroups = new Thread(() => MuscleGroup.GetMusclegroups()); Thread exercises = new Thread(() => Exercise.GetExercises()); Thread clients = new Thread(() => Client.GetClients()); Thread trainingSessions = new Thread(() => TrainingSession.GetAllTrainingSessions()); exercises.Start(); muscleGroups.Start(); clients.Start(); trainingSessions.Start(); exercises.Join(); muscleGroups.Join(); clients.Join(); trainingSessions.Join(); buttonClientManagement.Enabled = true; buttonClientManagement.BackColor = Color.LightGreen; buttonClientManagement.Enabled = true; buttonExerciseManagement.BackColor = Color.LightGreen; buttonExerciseManagement.Enabled = true; buttonSessionManagement.Enabled = true; buttonSessionManagement.BackColor = Color.LightGreen; buttonMuscleGroup.Enabled = true; buttonMuscleGroup.BackColor = Color.LightGreen; } }