private void Limpiar() { EmpleadoIdTextBox.Text = "0"; NombresTextBox.Clear(); ApellidosTextBox.Clear(); CedulaTextBox.Clear(); DireccionTextBox.Clear(); TelefonoTextBox.Clear(); CelularTextBox.Clear(); EmailTextBox.Clear(); CargoTextBox.Clear(); SueldoTextBox.Text = "0"; FechaNacimientoDateTimePicker.SelectedDate = DateTime.Now; FechaIngresoDateTimePicker.SelectedDate = DateTime.Now; UsuarioIdTextBox.Text = (MainWindow.usuarioSiempreActivoId.ToString()); Empleados empleado = new Empleados(); Actualizar(); }
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); }