예제 #1
0
 void ESF_FormClosing(object sender, FormClosingEventArgs e, EditSelectedFrom ESF)
 {
     if (ESF.DoChange)
     {
         conn.Open();
         new SqlCommand($"UPDATE tracks SET tile = '{ESF.Title}', lenght = '{ESF.Time}', url = '{ESF.Url}' WHERE id = '{dgv_musiclist.Rows[dgv_musiclist.CurrentCell.RowIndex].Cells[3].Value.ToString()}';", conn).ExecuteNonQuery();
         conn.Close();
     }
     btn_editselected.Enabled = true;
     UpdateDGV();
     MessageBox.Show("Update done!");
 }
예제 #2
0
        private void btn_editselected_Click(object sender, EventArgs e)
        {
            btn_editselected.Enabled = false;
            btn_addurl.Enabled       = false;
            EditSelectedFrom ESF = new EditSelectedFrom();

            ESF.Title = dgv_musiclist.Rows[dgv_musiclist.CurrentCell.RowIndex].Cells[0].Value.ToString();
            ESF.Time  = dgv_musiclist.Rows[dgv_musiclist.CurrentCell.RowIndex].Cells[1].Value.ToString();
            ESF.Url   = dgv_musiclist.Rows[dgv_musiclist.CurrentCell.RowIndex].Cells[2].Value.ToString();
            ESF.Show();
            ESF.FormClosing += new FormClosingEventHandler((sender2, e2) => ESF_FormClosing(sender2, e2, ESF));
        }