Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DatabaseFunctions functions = new DatabaseFunctions();

            functions.User_Track_Edit("Редактировать", new_track.id, new_track.author, textBox_Author.Text, textBox_Title.Text, textBox_Genre.Text, textBox_Mood.Text, new_track.bitrate, new_track.source, path, new_track.duration);
            this.Close();
        }
Ejemplo n.º 2
0
        private void button_Delete_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.SelectedRows)
            {
                int CurrentRow = row.Index;
                //    //получить значение id выбранной строки
                int valueId  = Convert.ToInt32(dataGridView1[0, CurrentRow].Value);
                int track_id = Convert.ToInt32(dataGridView1[2, CurrentRow].Value);
                functions.context.User_Track_Playlist.RemoveRange(functions.context.User_Track_Playlist.Where(a => a.track_id == track_id));
                functions.context.SaveChanges();

                functions.User_Track_Edit("Удалить", valueId);
            }
            RefreshDGV();
        }