예제 #1
0
 private void BtnEliminar_Click(object sender, EventArgs e)
 {
     if (dgvMarcas.SelectedCells.Count > 0)
     {
         MarcaNegocio neg = new MarcaNegocio();
         Marca        m   = (Marca)dgvMarcas.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"eliminar """ + m.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (m != null && conf == true)
                     {
                         neg.EliminarLogico(m.IdMarca);
                         LlenarTabla();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje me = new Mensaje(ex.ToString()); me.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }