Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            tekmovanja tekmovanja = new tekmovanja();

            tekmovanja.Show();
            this.Hide();
        }
Example #2
0
        private void dodajButton_Click(object sender, EventArgs e)
        {
            MySqlConnection con = new MySqlConnection("datasource = mysql6001.site4now.net; username = a41c3d_mihatom; password = fuzbal100; database = db_a41c3d_mihatom; sslmode=none");

            string id1      = ekipa1combo.SelectedItem.ToString();
            string id2      = ekipa2combo.SelectedItem.ToString();
            string rezultat = maskedTextBox1.Text;
            string datum    = dateTimePicker1.Text;

            con.Open();
            MySqlCommand com = con.CreateCommand();

            com.CommandType = CommandType.Text;
            com.CommandText = "INSERT INTO tekme (ekipa1_id, ekipa2_id, rezultat, datum_tekme) VALUES ((SELECT id FROM ekipe WHERE ime = '" + id1 + "'), (SELECT id FROM ekipe WHERE ime = '" + id2 + "'), '" + rezultat + "', '" + datum + "') ";
            com.ExecuteNonQuery();
            MessageBox.Show("Tekma dodana!");
            tekmovanja tekmovanja = new tekmovanja();

            this.Hide();
            tekmovanja.Show();
        }