コード例 #1
0
ファイル: MainForm.cs プロジェクト: vlajnaya-mol/gymPlannerEF
 private void GetExerciseButton_Click(object sender, EventArgs e)
 {
     using (ExerciseChooseForm Window = new ExerciseChooseForm())
     {
         if (Window.ShowDialog() == DialogResult.OK)
         {
             this.ExerciseNameLabel.Text = Window.exerciseName;
             this.searchExerciseChosen   = true;
         }
     }
 }
コード例 #2
0
ファイル: DayForm.cs プロジェクト: vlajnaya-mol/gymPlannerEF
 private void AddTrainToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ExerciseChooseForm Window = new ExerciseChooseForm())
     {
         if (Window.ShowDialog() == DialogResult.OK)
         {
             Workouts workout = new Workouts
             {
                 Num_Sets = 0
             };
             workout.Exercises.Add(ctx.Exercises.FirstOrDefault(ex => ex.Name == Window.exerciseName));
             workout.Days.Add(ctx.Days.FirstOrDefault(d => d.ID_Day == dayId));
             ctx.Workouts.Add(workout);
             ctx.SaveChanges();
             UpdateTreeView();
             (new EditSetsForm(workout.ID_Workout)).ShowDialog();
             UpdateTreeView();
         }
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: vlajnaya-mol/gymPlannerEF
        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);
        }