Ejemplo n.º 1
0
        public static void GetSingleExercise(int id)
        {
            APIRequests request = new APIRequests();

            string url = $"{request.singleExercisesEndpoint}{id}";

            string response = request.GetRequests(url);

            Exercise.ParseWebResponse(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Clears clientDictionaryForDropdown, gets client information from the API
        /// </summary>
        public static void GetClients()
        {
            clientDictionaryForDropdown.Clear();
            clientDictionaryForDropdown.Add("0", "Choose Client");
            APIRequests request = new APIRequests();

            string response = request.GetRequests(request.allClientDetailsEndpoint);

            ParseWebResponse(response);
        }
Ejemplo n.º 3
0
        public static void GetClientTrainingSessions(int clientId)
        {
            APIRequests request = new APIRequests();

            // Use the singleClientDetailEndpoint endpoint, and append {id}/trainingsessions to the URL
            string url = $"{request.singleClientDetailEndpoint}{clientId}/trainingsessions";

            var response = request.GetRequests(url);

            TrainingSession.ParseTrainingSessionData(response);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets client information from the API
        /// </summary>
        public static void GetWorkoutHistoryForClient(int clientId)
        {
            //clientDictionaryForDropdown.Add("0", "Choose Client");
            APIRequests request = new APIRequests();

            string url = $"{request.singleClientDetailEndpoint}{clientId}/workouthistory";
            //logger.Debug(url);
            string response = request.GetRequests(url);

            ParseWebResponse(response);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets a list of all exercises in the database
        /// </summary>
        public static void GetExercises()
        {
            exerciseListForDropdown.Clear();

            exerciseListForDropdown.Add("0", "Choose Exercise");
            APIRequests request = new APIRequests();

            string response = request.GetRequests(request.allExercisesEndpoint);

            ParseWebResponse(response);
        }
        /// <summary>
        /// Creates and gets information from the muscle group endpoint.  Then calls ParseWebResponse() to clean them
        /// </summary>
        public static void GetMusclegroups()
        {
            muscleGroupDictionary.Clear();
            muscleGroupList.Clear();
            muscleGroupDictionary.Add("0", "Choose Muscle Group");
            APIRequests request = new APIRequests();

            string response = request.GetRequests(request.allMuscleGroupsEndpoint);

            ParseWebResponse(response);
        }
        /// <summary>
        /// Runs the method to get all training sessions from the API endpoints
        /// </summary>
        public static void GetAllTrainingSessions()
        {
            trainingSessionDictionaryForDropdown.Clear();
            APIRequests request = new APIRequests();

            trainingSessionDictionaryForDropdown.Add("0", "Choose Training Session");

            string response = request.GetRequests(request.allTrainingSessionsEndpoint);

            ParseWebResponseToAddToDictionary(response);
        }
        /// <summary>
        /// Gets information on all exercises assigned to a specific training session
        /// </summary>
        /// <param name="id">ID of the training session you are getting information for</param>
        public static void GetTrainingSessionExercises(int id)
        {
            TrainingSessionExercise.trainingSessionExerciseList.Clear();

            APIRequests request = new APIRequests();

            string url = $"{request.singleTrainingSessionEndpoint}{id}\\exercises";

            string response = request.GetRequests(url);

            ParseTrainingSessionExercises(response);
        }