Esempio n. 1
0
        private void selectAreaButton_Click(object sender, EventArgs e)
        {
            //areasList.Clear();
            areasTextBox.Text = "";

            Form f = new SelectAreaForm(ref areasList);
            f.ShowDialog();

            areasTextBox.Text = Exercise.getAreasAsNums(areasList);
            textBox4.Text = areasList.Count.ToString();

            areasTextBox.BackColor = Color.GreenYellow;

            if (textBox1.Text == "")
            {
                List<Exercise> exercises = DBUtils.LoadExercises(areasList.Count);
                int maxnum = 0;
                int num;
                foreach (Exercise exercise in exercises)
                {
                    num = Convert.ToInt16(exercise.id.ToString().Substring(1));
                    if (num > maxnum) maxnum = num;
                }

                maxnum++;
                textBox1.Text = "Упражнение " + maxnum;
                textBox1.BackColor = Color.GreenYellow;
            }

            validateAll();
        }
Esempio n. 2
0
        private void selectAreaButton_Click(object sender, EventArgs e)
        {
            List <Boolean> areasList = new List <Boolean>();
            Form           f         = new SelectAreaForm(ref areasList);

            f.ShowDialog();

            String areas      = "";
            int    areasCount = 0;

            for (int i = 0; i < areasList.Count; i++)
            {
                int realNum = i + 1;
                if (areasList[i] == true)
                {
                    areas += i + " ";
                    areasCount++;
                }
            }

            areasTextBox.Text = areas;
            textBox4.Text     = areasList.Count.ToString();

            areasTextBox.BackColor = Color.GreenYellow;

            if (textBox1.Text == "")
            {
                List <Exercise> exercises = DBUtils.LoadExercises(areasCount);
                int             maxnum    = 0;
                int             num;
                foreach (Exercise exercise in exercises)
                {
                    num = Convert.ToInt16(exercise.id.ToString().Substring(1));
                    if (num > maxnum)
                    {
                        maxnum = num;
                    }
                }

                maxnum++;
                textBox1.Text      = "Упражнение " + maxnum;
                textBox1.BackColor = Color.GreenYellow;
            }

            validateAll();
        }
Esempio n. 3
0
        private void selectAreaButton_Click(object sender, EventArgs e)
        {
            List<Boolean> areasList = new List<Boolean>();
            Form f = new SelectAreaForm(ref areasList);
            f.ShowDialog();

            String areas = "";
            int areasCount = 0;

            for (int i = 0; i < areasList.Count; i++)
            {
                int realNum = i + 1;
                if (areasList[i] == true)
                {
                    areas += i + " ";
                    areasCount++;
                }
            }

            areasTextBox.Text = areas;
            textBox4.Text = areasList.Count.ToString();

            areasTextBox.BackColor = Color.GreenYellow;

            if (textBox1.Text == "")
            {
                List<Exercise> exercises = DBUtils.LoadExercises(areasCount);
                int maxnum = 0;
                int num;
                foreach (Exercise exercise in exercises)
                {
                    num = Convert.ToInt16(exercise.id.ToString().Substring(1));
                    if (num > maxnum) maxnum = num;
                }

                maxnum++;
                textBox1.Text = "Упражнение " + maxnum;
                textBox1.BackColor = Color.GreenYellow;
            }

            validateAll();
        }