Ejemplo n.º 1
0
 private void BtnEditar_Click(object sender, EventArgs e)
 {
     if (dgvMarcas.SelectedCells.Count > 0)
     {
         foreach (Form item in Application.OpenForms)
         {
             if (item.GetType() == typeof(ModMarca))
             {
                 item.Focus();
                 return;
             }
         }
         try
         {
             Marca    obj = (Marca)dgvMarcas.CurrentRow.DataBoundItem;
             ModMarca mod = new ModMarca(obj);
             mod.ShowDialog();
             LlenarTabla();
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }
Ejemplo n.º 2
0
 private void BtnAgregar_Click(object sender, EventArgs e)
 {
     {
         foreach (Form item in Application.OpenForms)
         {
             if (item.GetType() == typeof(ModMarca))
             {
                 item.Focus();
                 return;
             }
         }
         try
         {
             ModMarca mod = new ModMarca();
             mod.ShowDialog();
             LlenarTabla();
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
 }