private void button2_Click(object sender, EventArgs e) { if (mode == 1) { if (mainField.Text.ToString().Length != 0) { Db.insertGeneric("P_INSERT_ARTIST", "name", SqlDbType.VarChar, mainField.Text.ToString()); Db.dbDestroy(); this.Close(); } } if (mode == 2) { if (mainField.Text.ToString().Length != 0) { Db.insertGeneric("P_INSERT_GENRE", "name", SqlDbType.VarChar, mainField.Text.ToString()); Db.dbDestroy(); this.Close(); } } if (mode == 3) { if (mainField.Text.ToString().Length != 0) { Db.insertGeneric("P_INSERT_ALBUM", "name", SqlDbType.VarChar, mainField.Text.ToString(), "ARTIST_ID", SqlDbType.Int, comboBox1.SelectedValue.ToString()); Db.dbDestroy(); this.Close(); } } }
private void button2_Click(object sender, EventArgs e) { DateTime dt = new DateTime(); String strTmp = "00:" + songLengthMin.Text.ToString() + ":" + songLengthSec.Text.ToString(); dt = DateTime.Parse(strTmp); int length = dt.Minute * 60; length += dt.Second; if (songName.Text.ToString().Length != 0 && length != 0) { try { if (albumCombo.SelectedValue != null) { Db.insertSong( songName.Text.ToString(), length, int.Parse(genreCombo.SelectedValue.ToString()), int.Parse(artistCombo.SelectedValue.ToString()), int.Parse(songYear.Text.ToString()), int.Parse(albumCombo.SelectedValue.ToString())); } else { Db.insertSong( songName.Text.ToString(), length, int.Parse(genreCombo.SelectedValue.ToString()), int.Parse(artistCombo.SelectedValue.ToString()), int.Parse(songYear.Text.ToString())); } } catch (Exception Ex) { MessageBox.Show(Ex.Message.ToString()); } Db.dbDestroy(); this.Close(); } }
private void button1_Click(object sender, EventArgs e) { this.Close(); db.dbDestroy(); }
private void button5_Click(object sender, EventArgs e) { Database.dbDestroy(); this.Close(); }