private void Limpiar() { VendedorIdNumericUpDown.Value = 0; NombreTextBox.Text = string.Empty; SueldoNumericUpDown.Value = 0; PorcentajeRetencionNumericUpDown.Value = 0; RetencionNumericUpDown.Value = 0; VendedorErrorProvider.Clear(); }
private void Eliminar_Button_Click(object sender, EventArgs e) { VendedorErrorProvider.Clear(); int.TryParse(VendedorIdNumericUpDown.Text, out int id); if (!ExisteEnLaBaseDeDatos()) { VendedorErrorProvider.SetError(VendedorIdNumericUpDown, "No se puede eliminar un vendedor que no existe"); return; } if (VendedoresBLL.Eliminar(id)) { Limpiar(); MessageBox.Show("Eliminado"); } }