private void btnAddVocabulary_Click(object sender, EventArgs e) { int index = cbxTopicList.SelectedItem.ToString().IndexOf('-'); topic = cbxTopicList.SelectedItem.ToString().Substring(0, index); Form AddVocabularyForm = new AddVocabularyForm(connection, topic); AddVocabularyForm.Show(); }
private void btnAddTopic_Click(object sender, EventArgs e) { if (txtTopicNameEnglish.Text.Length > 0 && txtTopicNameIrish.Text.Length > 0) { connection.Open(); cmd = new SqlCommand("INSERT INTO Topics (topic_name_english, topic_name_irish) VALUES ('" + txtTopicNameEnglish.Text + "', '" + txtTopicNameIrish.Text + "');", connection); reader = cmd.ExecuteReader(); connection.Close(); string topic = txtTopicNameEnglish.Text; Form AddVocabularyForm = new AddVocabularyForm(connection, topic, true); AddVocabularyForm.Show(); this.Enabled = false; this.Hide(); } }