Esempio n. 1
0
 private void NovyPlanKonfigurace_Load(object sender, EventArgs e)
 {
     if (previousForm.GetType() == typeof(NovyPlanNameSelect) && NovyTreninkController.ZkontrolujPocetTreninku())
     {
         NovyTreninkController.setObtiznost(obtiznostCB);
         NovyTreninkController.setCilPlanu(cilCB);
     }
     else
     {
         NovyTreninkController.loadPlanConfiguration(obtiznostCB, cilCB, dateTimePicker1, textBox1);
     }
 }
Esempio n. 2
0
 private async void ulozit_Click(object sender, EventArgs e)
 {
     if (await NovyTreninkController.SaveTrenink(dataGridView2))
     {
         MessageBox.Show("Trénink se uložil", "OK", MessageBoxButtons.OK);
         System.Environment.Exit(0);
     }
     else
     {
         MessageBox.Show("Musíte přidat alespoň 3 tréninky.", "Chyba", MessageBoxButtons.OK);
     }
 }
Esempio n. 3
0
        private void Pokracovat_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex != 0)
            {
                if (nextForm == null)
                {
                    nextForm = new NovyPlanNameSelect(this);
                }

                NovyTreninkController.SablonaSelect(comboBox1.SelectedItem.ToString());
                Hide();
                nextForm.Show();
            }
        }
Esempio n. 4
0
 private void pokracovat_Click(object sender, EventArgs e)
 {
     if (NovyTreninkController.checkPlanConfiguration(dateTimePicker1.Value, textBox1.Text))
     {
         if (nextForm == null)
         {
             nextForm = new NovyPlanAddTrenink(this);
         }
         NovyTreninkController.savePlanConfiguration(dateTimePicker1.Value, textBox1.Text, cilCB.SelectedIndex, obtiznostCB.SelectedIndex);
         Hide();
         nextForm.Show();
     }
     else
     {
         MessageBox.Show("Prosím vyplňte všechny pole. (Plán musí trvat aspoň 10 dní)", "Chyba", MessageBoxButtons.OK);
     }
 }
Esempio n. 5
0
 private void pokracovat_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.Length > 0)
     {
         if (NovyTreninkController.CheckName(textBox1.Text))
         {
             NovyTreninkController.NovyTreninkName = textBox1.Text;
             if (nextForm == null)
             {
                 nextForm = new NovyPlanKonfigurace(this);
             }
             Hide();
             nextForm.Show(this);
         }
         else
         {
             MessageBox.Show("Trénink již existuje", "Chyba", MessageBoxButtons.OK);
         }
     }
     else
     {
         MessageBox.Show("Jméno nesmí být prázdné.", "Chyba", MessageBoxButtons.OK);
     }
 }
Esempio n. 6
0
 private void NovyPlanAddTrenink_Load(object sender, EventArgs e)
 {
     NovyTreninkController.PopulateAddTrenink(dataGridView1, dataGridView2, cilLabel, trvaniLabel, obtiznostLabel);
 }
Esempio n. 7
0
 private void NovyPlanSablonaSelect_Load(object sender, EventArgs e)
 {
     NovyTreninkController.LoadPlans(comboBox1);
 }