Ejemplo n.º 1
0
        private void módosítás_Click(object _sender, EventArgs _event)
        {
            if (combo_versenyek.Items.Count == 0)
            {
                MessageBox.Show("Nincsen még egy verseny sem felvéve, először rögzítsen egyet!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
            }
            if (table.SelectedRows.Count == 0)
            {
                MessageBox.Show("Nem megfelelő a kiválasztott eredmények száma!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
            }
            if (lezárva)
            {
                MessageBox.Show("A verseny már le van zárva!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
            }
            ;

            Form_Eredmény eredmény_form = new Form_Eredmény(combo_versenyek.Text,
                                                            verseny_összpont,
                                                            new Eredmény(table.SelectedRows[0].Cells[0].Value.ToString(),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[1].Value),
                                                                         table.SelectedRows[0].Cells[2].Value.ToString(),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[3].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[4].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[5].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[6].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[7].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[8].Value),
                                                                         Convert.ToInt32(table.SelectedRows[0].Cells[9].Value),
                                                                         Convert.ToBoolean(table.SelectedRows[0].Cells[10].Value),
                                                                         Convert.ToBoolean(table.SelectedRows[0].Cells[11].Value),
                                                                         table.SelectedRows[0].Cells[12].Value.ToString())
                                                            );

            eredmény_form.ShowDialog();
        }
Ejemplo n.º 2
0
        void keresés_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (keresés.Focus() == true && keresés.Text.Length != 0)
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    if (combo_versenyek.Items.Count == 0)
                    {
                        MessageBox.Show("Nincsen még egy verseny sem felvéve, először rögzítsen egyet!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
                    }
                    if (table.SelectedRows.Count == 0)
                    {
                        MessageBox.Show("Nem megfelelő a kiválasztott eredmények száma!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
                    }
                    if (lezárva)
                    {
                        MessageBox.Show("A verseny már le van zárva!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
                    }
                    ;

                    Form_Eredmény eredmény_form = new Form_Eredmény(combo_versenyek.Text, verseny_összpont, new Eredmény(
                                                                        table.SelectedRows[0].Cells[0].Value.ToString(),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[1].Value),
                                                                        table.SelectedRows[0].Cells[2].Value.ToString(),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[3].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[4].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[5].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[6].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[7].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[8].Value),
                                                                        Convert.ToInt32(table.SelectedRows[0].Cells[9].Value),
                                                                        Convert.ToBoolean(table.SelectedRows[0].Cells[10].Value),
                                                                        Convert.ToBoolean(table.SelectedRows[0].Cells[11].Value),
                                                                        table.SelectedRows[0].Cells[12].Value.ToString()
                                                                        ));
                    eredmény_form.ShowDialog();
                }
            }
        }