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); } }
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); } }
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(); } }
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); } }
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); } }
private void NovyPlanAddTrenink_Load(object sender, EventArgs e) { NovyTreninkController.PopulateAddTrenink(dataGridView1, dataGridView2, cilLabel, trvaniLabel, obtiznostLabel); }
private void NovyPlanSablonaSelect_Load(object sender, EventArgs e) { NovyTreninkController.LoadPlans(comboBox1); }