Ejemplo n.º 1
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         frmAgregar agregar = new frmAgregar();
         agregar.ShowDialog();
         CargarDGV();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Ejemplo n.º 2
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         Articulo articulo = new Articulo();
         if (dgvListaDeArticulos.CurrentRow == null)
         {
             MessageBox.Show("No se ha seleccionado ningún elemento.");
             return;
         }
         articulo = (Articulo)dgvListaDeArticulos.CurrentRow.DataBoundItem;
         frmAgregar modificar = new frmAgregar(articulo);
         modificar.ShowDialog();
         CargarDGV();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }