public void Limpiar() { ClienteIdNumericUpDown.Value = 0; NombresTextBox.Clear(); DireccionTextBox.Clear(); SexoComboBox.Items.Clear(); TelefonoMaskedTextBox.Clear(); CedulaMaskedTextBox.Clear(); FechaNacimientoDateTimePicker.ResetText(); LlenarComboSexo(); ErrorProvider.Clear(); }
private void BuscarButton_Click(object sender, EventArgs e) { int id = Convert.ToInt32(ClienteIdNumericUpDown.Value); Clientes clientes = BLL.ClientesBLL.Buscar(id); if (clientes != null) { ClienteIdNumericUpDown.Value = clientes.ClienteId; NombresTextBox.Text = clientes.Nombre; SexoComboBox.Text = clientes.Sexo; CedulaMaskedTextBox.Text = clientes.Cedula.ToString(); FechaNacimientoDateTimePicker.ResetText(); DireccionTextBox.Text = clientes.Direccion; TelefonoMaskedTextBox.Text = clientes.Telefono.ToString(); } else { MessageBox.Show("no se encontro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } ErrorProvider.Clear(); }
private bool Validar() { bool paso = true; if (string.IsNullOrEmpty(NombreTextBox.Text)) { MessageBox.Show("Debe Ingresar Nombre", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning); NombreTextBox.Focus(); paso = false; } if (string.IsNullOrEmpty(DireccionTextBox.Text)) { MessageBox.Show("Debe Ingresar Direccion", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning); DireccionTextBox.Focus(); paso = false; } if (string.IsNullOrEmpty(CedulaTextBox.Text)) { MessageBox.Show("Debe Ingresar Cedula", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning); CedulaTextBox.Focus(); paso = false; } if (string.IsNullOrEmpty(FechaNacimientoDateTimePicker.Text)) { MessageBox.Show("Debe Ingresar Fecha de Nacimiento", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning); FechaNacimientoDateTimePicker.Focus(); paso = false; } if (Detalles.Count == 0) { MessageBox.Show("Debe agregar almenos una Telefono"); TelefonoTextBox.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; MyErrorProvider.Clear(); if (string.IsNullOrWhiteSpace(NombresTextBox.Text)) { MyErrorProvider.SetError(NombresTextBox, "El campo Nombres no puede estar vacio"); NombresTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(GrupoSangineoComboBox.Text)) { MyErrorProvider.SetError(GrupoSangineoComboBox, "El campo GrupoSangineo no puede estar vacio"); GrupoSangineoComboBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CedulaMaskedTextBox.Text)) { MyErrorProvider.SetError(CedulaMaskedTextBox, "El campo Cedula no puede estar vacio"); CedulaMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(TelefonoMaskedTextBox.Text)) { MyErrorProvider.SetError(TelefonoMaskedTextBox, "El campo Telefono no puede estar vacio"); TelefonoMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text)) { MyErrorProvider.SetError(CelularMaskedTextBox, "El campo Celular no puede estar vacio"); CelularMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(SeguroMedicoComboBox.Text)) { MyErrorProvider.SetError(SeguroMedicoComboBox, "El campo Seguro Medico no puede estar vacio"); SeguroMedicoComboBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(DireccionTextBox.Text)) { MyErrorProvider.SetError(DireccionTextBox, "El campo Direccion no puede estar vacio"); DireccionTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(EmailTextBox.Text)) { MyErrorProvider.SetError(EmailTextBox, "El campo Seguro Medico no puede estar vacio"); EmailTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(ObservacionTextBox.Text)) { MyErrorProvider.SetError(ObservacionTextBox, "El campo Seguro Medico no puede estar vacio"); ObservacionTextBox.Focus(); paso = false; } if (FechaNacimientoDateTimePicker.Value > FechaIngresoDateTimePicker.Value) { MyErrorProvider.SetError(FechaNacimientoDateTimePicker, "No se puede registrar esta fecha."); FechaNacimientoDateTimePicker.Focus(); paso = false; } if (FechaIngresoDateTimePicker.Value > DateTime.Now) { MyErrorProvider.SetError(FechaIngresoDateTimePicker, "No se puede registrar esta fecha."); FechaIngresoDateTimePicker.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; MyErrorProvider.Clear(); if (string.IsNullOrWhiteSpace(NombresTextBox.Text)) { MyErrorProvider.SetError(NombresTextBox, "El campo Nombres no puede estar vacío."); NombresTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(ApellidosTextBox.Text)) { MyErrorProvider.SetError(ApellidosTextBox, "El campo Apellidos no puede estar vacío."); ApellidosTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(MatriculaMaskedTextBox.Text.Replace("-", ""))) { MyErrorProvider.SetError(MatriculaMaskedTextBox, "El campo Matrícula no puede estar vacío."); MatriculaMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CedulaMaskedTextBox.Text.Replace("-", ""))) { MyErrorProvider.SetError(CedulaMaskedTextBox, "El campo Cédula no puede estar vacío."); CedulaMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(TelefonoMaskedTextBox.Text.Replace("-", ""))) { MyErrorProvider.SetError(TelefonoMaskedTextBox, "El campo Teléfono no puede estar vacío."); TelefonoMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text.Replace("-", ""))) { MyErrorProvider.SetError(CelularMaskedTextBox, "El campo Celular no puede estar vacío."); CelularMaskedTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(FechaNacimientoDateTimePicker.Text)) { MyErrorProvider.SetError(FechaNacimientoDateTimePicker, "El campo Fecha no puede estar vacío."); FechaNacimientoDateTimePicker.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(SexoComboBox.Text)) { MyErrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacío."); SexoComboBox.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; MyerrorProvider.Clear(); if (string.IsNullOrWhiteSpace(MatriculaTextBox.Text)) { MyerrorProvider.SetError(MatriculaTextBox, "El campo Direccion no puede estar vacio"); MatriculaTextBox.Focus(); paso = false; } if (NombreTextbox.Text == string.Empty) { MyerrorProvider.SetError(NombreTextbox, "El campo Nombre no puede estar vacio"); NombreTextbox.Focus(); paso = false; } if (ApellidoTextbox.Text == string.Empty) { MyerrorProvider.SetError(ApellidoTextbox, "El campo Nombre no puede estar vacio"); ApellidoTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CedulaTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(CedulaTextbox, "El campo Cedula no puede estar vacio"); CedulaTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(TelefonoTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(TelefonoTextbox, "El campo Telefono no puede estar vacio"); TelefonoTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CelularTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(CelularTextbox, "El campo Celular no puede estar vacio"); CelularTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(EmailTextbox.Text)) { MyerrorProvider.SetError(EmailTextbox, "El campo Email no puede estar vacio"); EmailTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(FechaNacimientoDateTimePicker.Text)) { MyerrorProvider.SetError(FechaNacimientoDateTimePicker, "El campo Fecha de nacimiento no puede estar vacio"); FechaNacimientoDateTimePicker.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(SexoComboBox.Text)) { MyerrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacio"); SexoComboBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(BalanceTextBox.Text)) { MyerrorProvider.SetError(BalanceTextBox, "El campo Balance no puede estar vacio"); BalanceTextBox.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; if (string.IsNullOrEmpty(NombresTextBox.Text)) { paso = false; MessageBox.Show("El campo Nombres no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); NombresTextBox.Focus(); } if (string.IsNullOrEmpty(ApellidosTextBox.Text)) { paso = false; MessageBox.Show("El campo Apellidos no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); ApellidosTextBox.Focus(); } if (!CedulaValida(CedulaTextBox.Text)) { paso = false; MessageBox.Show("Cédula No Valida, Debe introducir solo números !!!\n Introducca la Cédula sin guiones.", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); CedulaTextBox.Focus(); } if (SexoComboBox.SelectedItem == null) { paso = false; MessageBox.Show("Debe completar el campo sexo", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); SexoComboBox.Focus(); } if (!NumeroValido(CelularTextBox.Text)) { paso = false; MessageBox.Show("Celular No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); CelularTextBox.Focus(); } if (!NumeroValido(TelefonoTextBox.Text)) { paso = false; MessageBox.Show("Teléfono No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); TelefonoTextBox.Focus(); } if (string.IsNullOrEmpty(DireccionTextBox.Text)) { paso = false; MessageBox.Show("El campo Direccion no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); DireccionTextBox.Focus(); } if (!EmailValido(EmailTextBox.Text)) { paso = false; MessageBox.Show("Email No Valido !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); EmailTextBox.Focus(); } if (string.IsNullOrEmpty(FechaIngresoDateTimePicker.Text)) { paso = false; MessageBox.Show("El campo Fecha Ingreso no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); FechaIngresoDateTimePicker.Focus(); } if (string.IsNullOrEmpty(FechaNacimientoDateTimePicker.Text)) { paso = false; MessageBox.Show("El campo fecha nacimiento no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); FechaNacimientoDateTimePicker.Focus(); } return(paso); }
private bool Validar() { bool paso = true; if (string.IsNullOrEmpty(FechaIngresoDateTimePicker.Text)) { paso = false; FechaIngresoDateTimePicker.Focus(); } if (string.IsNullOrEmpty(FechaNacimientoDateTimePicker.Text)) { paso = false; FechaNacimientoDateTimePicker.Focus(); } if (string.IsNullOrEmpty(SueldoTextBox.Text)) { paso = false; SueldoTextBox.Focus(); } if (string.IsNullOrEmpty(CargoTextBox.Text.Replace("-", ""))) { paso = false; CargoTextBox.Focus(); } if (!EmailValido(EmailTextBox.Text)) { paso = false; MessageBox.Show("Email No Valido !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); EmailTextBox.Focus(); } if (!NumeroValido(CelularTextBox.Text)) { paso = false; MessageBox.Show("Celular No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); CelularTextBox.Focus(); } if (!NumeroValido(TelefonoTextBox.Text)) { paso = false; MessageBox.Show("Teléfono No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); TelefonoTextBox.Focus(); } if (string.IsNullOrEmpty(DireccionTextBox.Text)) { paso = false; DireccionTextBox.Focus(); } if (!CedulaValida(CedulaTextBox.Text)) { paso = false; MessageBox.Show("Cédula No Valida, Debe introducir solo números !!!\n Introducca la Cédula sin guiones.", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); CedulaTextBox.Focus(); } if (string.IsNullOrEmpty(ApellidosTextBox.Text)) { paso = false; ApellidosTextBox.Focus(); } if (string.IsNullOrEmpty(NombresTextBox.Text)) { paso = false; NombresTextBox.Focus(); } return(paso); }