private void BtnAddNew_Click(object sender, RoutedEventArgs e) { Canciones songs = new Canciones() { Nombre = tbTitulo.Text.Trim(), Artista = tbArtista.Text.Trim(), Genero = cbAddGeneros.Text.Trim(), Lista = cbAddToLista.Text.Trim(), Link = tbLink.Text.Trim() }; using (SQLiteConnection conexion = new SQLiteConnection(App.databasePath)) { conexion.CreateTable <Canciones>(); conexion.Insert(songs); } Añadido add = new Añadido(); add.Added.Visibility = Visibility.Visible; add.Added.Visibility = Visibility.Hidden; add.Title = "Añadiendo"; add.Show(); Close(); this.Hide(); }
private void BtnDelete_Click(object sender, RoutedEventArgs e) { using (SQLiteConnection conexion = new SQLiteConnection(App.databasePath)) { string sentenciaSQL = "delete from Canciones where Nombre = '" + tbCancionDelete.Text + "'"; conexion.Execute(sentenciaSQL); } Añadido add = new Añadido(); add.Added.Visibility = Visibility.Hidden; add.Added.Visibility = Visibility.Visible; add.Title = "Eliminando."; add.Show(); Close(); this.Hide(); }