private void BtnGuardar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtNumeroDocumento.Text)) { MessageBox.Show("Digite Numero de Documento", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtNumeroDocumento.Focus(); } else if (string.IsNullOrEmpty(TxtNombres.Text)) { MessageBox.Show("Digite Nombre del empleado", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtNombres.Focus(); } else if (string.IsNullOrEmpty(TxtApellidos.Text)) { MessageBox.Show("Digite Apellido del empleado", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtApellidos.Focus(); } else if (string.IsNullOrEmpty(CbxCargo.Text)) { MessageBox.Show("Seleccione Cargo del empleado", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtApellidos.Focus(); } else { Guardar(); } }
public void ValidarEspacios() { if (TxtRut.Text.Length < 8 || TxtRut.Text.Length > 10) { errorRut.SetError(TxtRut, "El rut no puede tener menos de 8 caracteres ni más de 10"); TxtRut.Focus(); return; } errorRut.SetError(TxtRut, ""); if (TxtNombre.Text.Length < 1) { errorNombre.SetError(TxtNombre, "El nombre no puede quedar en blanco"); TxtNombre.Focus(); return; } errorNombre.SetError(TxtNombre, ""); if (TxtApellidos.Text.Length < 1) { errorApellidos.SetError(TxtApellidos, "Los apellidos no puede quedar en blanco"); TxtApellidos.Focus(); return; } errorApellidos.SetError(TxtApellidos, ""); }
/// <summary> /// Limpia los campos dónde se van a introducir datos. /// </summary> private void LimpiarCampos() { TxtNombre.Clear(); TxtApellidos.Clear(); TxtNif.Clear(); TxtDireccion.Clear();; TxtTelefono.Clear(); }
private void TxtApellidos_Validated(object sender, EventArgs e) { if (TxtApellidos.Text.Trim() == "") { epError.SetError(TxtApellidos, "Ingrese sus apellidos"); TxtApellidos.Focus(); } else { epError.Clear(); } }
public void Limpiar() { TxtDocumento.Clear(); TxtNombres.Clear(); TxtNombreContacto.Clear(); TxtTelContacto.Clear(); TxtApellidos.Clear(); TxtCelular.Clear(); TxtCorreo.Clear(); TxtDireccion.Clear(); TxtFijo.Clear(); TxtTelContacto.Clear(); }
private void BtnGuardar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtNombres.Text)) { MessageBox.Show("Escriba su Nombre", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtNombres.Focus(); } else if (string.IsNullOrEmpty(TxtApellidos.Text)) { MessageBox.Show("Escriba su Apellido", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtApellidos.Focus(); } else { GuardarCambios(); } }
protected void Func_LimpiarControles() { TxtIdentificacion.Clear(); TxtNombres.Clear(); TxtApellidos.Clear(); CbxSexo.SelectedIndex = 0; CbxEstado.SelectedIndex = 0; TxtDireccion.Clear(); TxtCorreo.Clear(); TxtTelefono.Clear(); TxtUsuario.Clear(); TxtMovil.Clear(); LblUser.Text = ""; ruta_default = Filename = Path.Combine(folder, "default.png"); PtbFoto.Image = Image.FromFile(ruta_default); TxtIdentificacion.Focus(); }
/// <summary> /// Limpia los campos dónde se van a introducir datos. /// </summary> private void LimpiarCampos() { TxtNombre.Clear(); TxtApellidos.Clear(); TxtNif.Clear(); TxtDireccion.Clear();; TxtTelefono.Clear(); TxtObservaciones.Clear(); TxtMarca.Clear(); TxtModelo.Clear(); TxtMatricula.Clear(); TxtLlave.Clear(); TxtPlaza.Clear(); TxtBaseImponible.Clear(); TxtIva.Clear(); TxtTotal.Clear(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.CargaTitulos(2); if (encargado.Genero == 2) { TbGenero_Checked(null, null); } else { TbGenero.IsChecked = false; } this.DataContext = encargado; if (mostrarEnCombo) { CbxGrado.SelectedValue = encargado.IdTitulo; } qCambio = String.Empty; TxtApellidos.Focus(); }