Ejemplo n.º 1
0
 private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["ID"].Value);
         if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().ToLower() == "delete")
         {
             if (MessageBox.Show("Are you", "Delete", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 string   q  = "delete from RegGenre where id=" + id;
                 Database db = new Database(q);
                 db.ExecuteNonQuery();
             }
         }
         else
         {
             RegGenres rg = new RegGenres(id);
             rg.gid = id;
             rg.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void NEWMOVIEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RegGenres rg = new RegGenres(0);

            rg.Show();
        }