Exemplo n.º 1
0
 private void btnEliminar_Click_1(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         productoId = dataGridView1.CurrentRow.Cells["ProductoId"].Value.ToString();
         if (controller.EliminarProducto(new Guid(productoId)))
         {
             MessageBox.Show("El registro fue eliminado");
             ObtenerProductos();
         }
     }
 }
 private void btnEliminarPro_Click(object sender, EventArgs e)
 {
     try
     {
         ProductoController pc = new ProductoController();
         int id = int.Parse(dataProd.CurrentRow.Cells[0].Value.ToString());
         pc.EliminarProducto(id);
         pc.LlenarGrid(App.fpp.dataProd);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Debe seleccionar un producto.", "Eliminar Producto", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemplo n.º 3
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (txtCodigo.Text == "")
     {
         MessageBox.Show("Ingresar codigo para eliminar producto");
     }
     else
     {
         string codigo = txtCodigo.Text;
         ProductoController.EliminarProducto(codigo);
         CargarDatos();
         nuevo();
     }
 }