コード例 #1
0
 private void btn_eliminar_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgv_marca.SelectedRows.Count == 1)
         {
             int     id = Convert.ToInt16(dgv_marca.CurrentRow.Cells[0].Value);
             negocio n  = new negocio();
             n.EliminarMarca(id);
         }
         else
         {
             MessageBox.Show("Debe de seleccionar una fila");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     txt_comision.Enabled = false;
     txt_nombre.Enabled   = false;
 }