private void btnEliminar_Click(object sender, EventArgs e) { Interface = new InterfaceUsuario(this); if (Interface.EliminarProducto(Convert.ToInt32(tbClave.Text))) { MessageBox.Show("Producto eliminado con éxito", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information); Close(); } else { Validar.MensajeErrorBaseDeDatos(); } }
private void btnEliminarProducto_Click(object sender, EventArgs e) { Interface = new InterfaceUsuario(this); if (DialogResult.Yes == MessageBox.Show("Realmente desea eliminar el producto " + dgvProductos[1, dgvProductos.SelectedCells[0].RowIndex].Value + "?", "AVISO", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2)) { if (Interface.EliminarProducto(Convert.ToInt32(dgvProductos[0, dgvProductos.SelectedCells[0].RowIndex].Value))) { MessageBox.Show("Producto eliminado con éxito", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information); LlenarData(Búsqueda.Total); } else { Validar.MensajeErrorBaseDeDatos(); } } }