コード例 #1
0
 private void GetExerciseButton_Click(object sender, EventArgs e)
 {
     using (ExerciseChooseForm Window = new ExerciseChooseForm())
     {
         if (Window.ShowDialog() == DialogResult.OK)
         {
             this.ExerciseNameLabel.Text = Window.exerciseName;
         }
     }
 }
コード例 #2
0
        private void ChooseExToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string exerciseName;

            using (ExerciseChooseForm Window = new ExerciseChooseForm())
            {
                if (Window.ShowDialog() == DialogResult.OK)
                {
                    exerciseName = Window.exerciseName;
                }
                else
                {
                    return;
                }
            }
            List <string> exercises = new List <string>();

            exercises.Add(exerciseName);
            this.UpdateChart(exercises);
        }
コード例 #3
0
ファイル: DayForm.cs プロジェクト: ruxg97/gymplanner
        private void AddTrainToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int workoutId = -1;

            using (ExerciseChooseForm Window = new ExerciseChooseForm())
            {
                if (Window.ShowDialog() == DialogResult.OK)
                {
                    NewGymPlannerDataSet.WorkoutsRow workoutRow = dataSet.Workouts.AddWorkoutsRow(0);
                    workoutsAdapter.Update(dataSet);

                    NewGymPlannerDataSet.Workout_ExerciseRow workoutExerciseRow =
                        dataSet.Workout_Exercise.NewWorkout_ExerciseRow();
                    workoutId = workoutRow.ID_Workout;
                    workoutExerciseRow.ID_Workout    = workoutRow.ID_Workout;
                    workoutExerciseRow.Name_Exercise = Window.exerciseName;
                    dataSet.Workout_Exercise.AddWorkout_ExerciseRow(workoutExerciseRow);
                    workoutExerciseAdapter.Update(dataSet);

                    NewGymPlannerDataSet.Day_WorkoutRow dayWorkoutRow =
                        dataSet.Day_Workout.NewDay_WorkoutRow();
                    dayWorkoutRow.ID_Workout         = workoutRow.ID_Workout;
                    dayWorkoutRow.ID_Day             = dayId;
                    workoutExerciseRow.Name_Exercise = Window.exerciseName;
                    dataSet.Day_Workout.AddDay_WorkoutRow(dayWorkoutRow);
                    dayWorkoutAdapter.Update(dataSet);

                    UpdateTreeView();
                    // Window.Hide();
                    using (EditSetsForm setsForm = new EditSetsForm(workoutId))
                    {
                        if (setsForm.ShowDialog() == DialogResult.OK)
                        {
                            UpdateTreeView();
                        }
                    }
                }
            }
        }