Beispiel #1
0
        private void CreateSession()
        {
            ResetControls();

            bool isConfirmed = CheckControls();

            if (RoutineManager.MainWorkOutRoutine == null)
            {
                isConfirmed = false;
            }


            if (isConfirmed == true)
            {
                int index = DayComboBox.SelectedIndex;
                workOutSession = new WorkOutSession(SessionNameTextBox.Text, daysOfWeekTab[index]);

                bool isNameAndDayCorrect = RoutineManager.MainWorkOutRoutine.CheckDayAndName(workOutSession);

                if (isNameAndDayCorrect == true)
                {
                    SetControlsVisibility(true);
                }
                else
                {
                    workOutSession = null;
                    SetControlsVisibility(false);
                }
            }
        }
Beispiel #2
0
 private void Back()
 {
     ExercisesListView.Items.Clear();
     workOutSession = null;
     ResetControls();
     UpdateControls();
     this.Parent.Controls["addRoutineUserControl"].BringToFront();
 }
Beispiel #3
0
        public AddSessionUserControl()
        {
            InitializeComponent();
            UpdateControls();
            ResetControls();
            RoutineManager.MainWorkOutRoutine = null;
            workOutSession = null;

            BodyPartComboBox.Items.Add(BodyPart.LEGS.ToString());
            BodyPartComboBox.Items.Add(BodyPart.CALVES.ToString());
            BodyPartComboBox.Items.Add(BodyPart.BACK.ToString());
            BodyPartComboBox.Items.Add(BodyPart.CHEST.ToString());
            BodyPartComboBox.Items.Add(BodyPart.SHOULDERS.ToString());
            BodyPartComboBox.Items.Add(BodyPart.BICEPS.ToString());
            BodyPartComboBox.Items.Add(BodyPart.TRICEPS.ToString());
            BodyPartComboBox.Items.Add(BodyPart.FOREARM.ToString());
            BodyPartComboBox.Items.Add(BodyPart.STOMACH.ToString());
            BodyPartComboBox.Text = BodyPart.LEGS.ToString();

            bodyPartTab[0] = BodyPart.LEGS;
            bodyPartTab[1] = BodyPart.CALVES;
            bodyPartTab[2] = BodyPart.BACK;
            bodyPartTab[3] = BodyPart.CHEST;
            bodyPartTab[4] = BodyPart.SHOULDERS;
            bodyPartTab[5] = BodyPart.BICEPS;
            bodyPartTab[6] = BodyPart.TRICEPS;
            bodyPartTab[7] = BodyPart.FOREARM;
            bodyPartTab[8] = BodyPart.STOMACH;

            DayComboBox.Items.Add(DaysOfWeek.MONDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.TUESDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.WEDNESDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.THURSDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.FRIDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.SATURDAY.ToString());
            DayComboBox.Items.Add(DaysOfWeek.SUNDAY.ToString());
            DayComboBox.Text = DaysOfWeek.MONDAY.ToString();

            daysOfWeekTab[0] = DaysOfWeek.MONDAY;
            daysOfWeekTab[1] = DaysOfWeek.TUESDAY;
            daysOfWeekTab[2] = DaysOfWeek.WEDNESDAY;
            daysOfWeekTab[3] = DaysOfWeek.THURSDAY;
            daysOfWeekTab[4] = DaysOfWeek.FRIDAY;
            daysOfWeekTab[5] = DaysOfWeek.SATURDAY;
            daysOfWeekTab[6] = DaysOfWeek.SUNDAY;
        }
Beispiel #4
0
        private void Save()
        {
            bool isConfirmed = true;

            if (RoutineManager.MainWorkOutRoutine == null)
            {
                isConfirmed = false;
            }


            if (isConfirmed == true)
            {
                RoutineManager.MainWorkOutRoutine.Add(workOutSession);
                ExercisesListView.Items.Clear();
                workOutSession = null;
                ResetControls();
                UpdateControls();
                this.Parent.Controls["addRoutineUserControl"].BringToFront();
            }
        }