private void ConfirmClose(object sender, RoutedEventArgs e)
        {
            string text = ((ComboBoxItem)fatique_combo.SelectedItem).Content.ToString();
            int    fatique;

            if (text == "low")
            {
                fatique = 24;
            }
            else if (text == "medium")
            {
                fatique = 40;
            }
            else if (text == "high")
            {
                fatique = 56;
            }
            else
            {
                fatique = 72;
            }

            string squat_primary    = ((ComboBoxItem)squat_primary_combo.SelectedItem).Content.ToString();
            string bench_primary    = ((ComboBoxItem)bench_primary_combo.SelectedItem).Content.ToString();
            string deadlift_primary = ((ComboBoxItem)deadlift_primary_combo.SelectedItem).Content.ToString();

            MainWorkouts main_workouts = new MainWorkouts(bench_primary, deadlift_primary, squat_primary);

            TrainingWeek new_week = new TrainingWeek(template_path, trainingBlock.GetBlockType(), fatique, main_workouts);

            trainingBlock.GetTrainingWeeks().Add(new_week);
            this.Close();
        }
Example #2
0
        public void AddBlockDone(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Are the block parameters ok?", "Block parameters", MessageBoxButton.YesNo);

            string block_type = training_block_box.Text;
            int    week_count;

            Int32.TryParse(training_weeks_count.Text, out week_count);
            MainWorkouts main_workouts = new MainWorkouts(benchpress_main_focus.Text, deadlift_main_focus.Text, squat_main_focus.Text);

            this.program.AddTrainingBlock(new TrainingBlock(block_type, week_count, this.weekly_template_file_path, main_workouts));
            this.Close();
        }