private void EliminarButton_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(IdtextBox1.Text)) { Clientes cliente = BLL.ClientesBLL.Buscar(ToInt(IdtextBox1.Text)); if (cliente != null) { if (BLL.ClientesBLL.Eliminar(cliente)) { MessageBox.Show("El cliente ha sido eliminado", "-- Transaccion Exitosa --", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo eliminar", "-- Transaccion Fallida --", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("El cliente no existe", "-- COnsulta Fallida --", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { IdtextBox1.Focus(); } LimpiarCampos(); }
public void LimpiarCampos() { nuevo = new Clientes(); tipos = new List <TiposTelefonos>(); IdtextBox1.Clear(); NombrestextBox.Clear(); FechaNacimientodateTimePicker1.Value = DateTime.Today; LimiteCreditotextBox.Clear(); TiposTelefonosdataGridView1.DataSource = null; NombrestextBox.Focus(); }
private void BuscarButton_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(IdtextBox1.Text)) { Clientes cliente = BLL.ClientesBLL.Buscar(ToInt(IdtextBox1.Text)); if (cliente != null) { CargarDatos(cliente); } else { MessageBox.Show("El cliente no existe"); } } else { IdtextBox1.Focus(); } }