private void Nuevobutton_Click(object sender, EventArgs e) { AnalisisIdnumericUpDown.Value = 0; FechadateTimePicker.Value = DateTime.Now; UsuariotextBox.Clear(); errorProvider.Clear(); }
public Login() { InitializeComponent(); this.ControlBox = false; Root(); UsuariotextBox.Focus(); }
private bool Validar() { bool paso = true; MyErrorProvider.Clear(); if (NombrestextBox.Text == string.Empty) { MyErrorProvider.SetError(NombrestextBox, "El Campo Nombres no puede estar vacio."); NombrestextBox.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(UsuariotextBox.Text)) { MyErrorProvider.SetError(UsuariotextBox, "El campo Usuario no puede estar vacio."); UsuariotextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(NivelcomboBox.Text)) { MyErrorProvider.SetError(NivelcomboBox, "El campo Nivel Usuario no puede estar vacio."); NivelcomboBox.Focus(); paso = false; } return(paso); }
private bool ValidarSesion() { if (UsuariotextBox.Text == "Admin" && Usuario == null) { Usuario = new Entidades.Usuarios(1, "Raidy Duran Garcia", "Admin", "1234", "1234", "Administrador"); UsuariosBLL.Guardar(Usuario); } else { Usuario = BLL.UsuariosBLL.Buscar(p => p.NombreUsuario == UsuariotextBox.Text); } if (Usuario != null) { if (ClavetextBox.Text == Usuario.Clave) { return(true); } else { MessageBox.Show("La clave no coinside con el usuario."); ClavetextBox.Clear(); ClavetextBox.Focus(); } } else { MessageBox.Show("El usuario digitado no existe."); UsuariotextBox.Clear(); UsuariotextBox.Focus(); } return(false); }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (Validar(1)) { MessageBox.Show("El TipoID esta vacio", "Llene Campo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { int id = Convert.ToInt32(AnalisisIdnumericUpDown.Value); if (BLL.AnalisisBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Bien hecho", MessageBoxButtons.OK, MessageBoxIcon.Information); AnalisisIdnumericUpDown.Value = 0; FechadateTimePicker.Value = DateTime.Now; UsuariotextBox.Clear(); errorProvider.Clear(); } else { MessageBox.Show("No se puede Eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void Vaciar() { UsuarioIdNumericUpDown.Text = string.Empty; UsuariotextBox.Clear(); NombretextBox.Clear(); ContraseñatextBox.Clear(); ConfirmartextBox.Clear(); ComentariotextBox.Clear(); LimpiarError(); }
private void Clear() { IDcomboBox.Text = string.Empty; NombretextBox.Clear(); UsuariotextBox.Clear(); ContraseñatextBox.Clear(); ConfirmartextBox.Clear(); ComentariotextBox.Clear(); LimpiarProvider(); }
private void Clear() { IDcomboBox.Text = string.Empty; UsuariotextBox.Clear(); NombretextBox.Clear(); ContraseñatextBox.Clear(); ConfirmartextBox.Clear(); FechadateTimePicker.Value = DateTime.Now; ComentariotextBox.Clear(); LimpiarError(); }
private void Limpiar() { IdNumericUpDown.Value = 0; FechaIngresoDateTimePicker.Value = DateTime.Now; NombretextBox.Clear(); EmailtextBox.Clear(); UsuariotextBox.Clear(); ContraseñatextBox.Clear(); ConfirmarTextBox.Clear(); NivelUsuarioComboBox.SelectedIndex = 0; MyErrorProvider.Clear(); }
private bool validar() { bool paso = true; MyerrorProvider.Clear(); if (NombretextBox.Text == String.Empty) { MyerrorProvider.SetError(NombretextBox, "El campo Nombre no puede estar vacio"); NombretextBox.Focus(); paso = false; } if (EmailtextBox.Text == String.Empty) { MyerrorProvider.SetError(EmailtextBox, "El campo Email no puede estar vacio"); EmailtextBox.Focus(); paso = false; } if (UsuariotextBox.Text == String.Empty) { MyerrorProvider.SetError(UsuariotextBox, "El campo usuario no puede estar vacio"); UsuariotextBox.Focus(); paso = false; } if (ClavemaskedTextBox.Text == String.Empty) { MyerrorProvider.SetError(ClavemaskedTextBox, "El campo Clave no puede estar vacio"); ClavemaskedTextBox.Focus(); paso = false; } if (ConfirmarmaskedTextBox.Text != ClavemaskedTextBox.Text) { MyerrorProvider.SetError(ConfirmarmaskedTextBox, "La clave no coincide"); ConfirmarmaskedTextBox.Focus(); paso = false; } if (NivelUsuariocomboBox.SelectedIndex == 0) { MyerrorProvider.SetError(NivelUsuariocomboBox, "Debes elegir que nivel es el usuario"); NivelUsuariocomboBox.Focus(); paso = false; } return(paso); }
//Funcion que valida los campos private bool ValidarCampos() { bool paso = true;; if (string.IsNullOrEmpty(UsuariotextBox.Text)) { MessageBox.Show("El nombre de usuario no puede estar vacio"); UsuariotextBox.Focus(); paso = false; } if (string.IsNullOrEmpty(ClaveUsuarioTextBox.Text)) { MessageBox.Show("La contraseña de usuario no puede estar vacia"); ClaveUsuarioTextBox.Focus(); paso = false; } return(paso); }
public bool ValidarCampos() { if (UsuariotextBox.Text.Trim().Length < 1) { MessageBox.Show("Favor llenar los campos vacio."); UsuariotextBox.Focus(); return(false); } if (PasswordtextBox.Text.Trim().Length < 1) { MessageBox.Show("Favor llenar los campos vacios."); PasswordtextBox.Focus(); return(false); } return(true); }
private bool Validar() { bool interruptor = true; if (string.IsNullOrEmpty(UsuariotextBox.Text)) { UsuarioerrorProvider.SetError(UsuariotextBox, "Por favor llenar el campo vacios."); UsuariotextBox.Focus(); interruptor = false; } if (string.IsNullOrEmpty(ClavetextBox.Text)) { ClaveerrorProvider.SetError(ClavetextBox, "Por favor llenar el campo vacios."); ClavetextBox.Focus(); interruptor = false; } return(interruptor); }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(UsuariotextBox.Text)) { MyerrorProvider.SetError(UsuariotextBox, "El campo Usuario no puede estar vacío"); UsuariotextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(ContraseñatextBox.Text)) { MyerrorProvider.SetError(ContraseñatextBox, "El campo Contraseña no puede estar vacío"); ContraseñatextBox.Focus(); paso = false; } return(paso); }
private void Guardarbutton_Click(object sender, EventArgs e) { if (Validar(2)) { MessageBox.Show("Llenar campos", "Llene los campos", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Analisis anali = LlenaClase(); bool paso = false; if (AnalisisIdnumericUpDown.Value == 0) { paso = BLL.AnalisisBLL.Guardar(anali); } else { paso = BLL.AnalisisBLL.Modificar(LlenaClase()); } if (paso) { MessageBox.Show("Guardado!!", "Se Guardo Correctamente", MessageBoxButtons.OK, MessageBoxIcon.Information); AnalisisIdnumericUpDown.Value = 0; FechadateTimePicker.Value = DateTime.Now; UsuariotextBox.Clear(); errorProvider.Clear(); } else { MessageBox.Show("No se guardo!!", "Intente Guardar de nuevo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private bool ValidarCampos() { bool paso = true; errorProvider.Clear();; if (string.IsNullOrWhiteSpace(UsuariotextBox.Text)) { errorProvider.SetError(UsuariotextBox, "Este campo es obligatorio"); UsuariotextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(ClavetextBox.Text)) { errorProvider.SetError(ClavetextBox, " Este campo es obligtorio!! "); ClavetextBox.Focus(); paso = false; } return(paso); }
public void Limpiar() { UsuariotextBox.Clear(); ContrasenatextBox.Clear(); }
private bool Validar() { RepositorioBase <Usuarios> db = new RepositorioBase <Usuarios>(); bool paso = true; errorProvider.Clear(); string Clave = ClavetextBox.Text; string Confirmar = ConfirmarClavetextBox.Text; int Resultado = 0; Resultado = string.Compare(Clave, Confirmar); if (string.IsNullOrWhiteSpace(NombretextBox.Text)) { errorProvider.SetError(NombretextBox, "La direccion no puede esta vacia"); NombretextBox.Focus(); paso = false; } if (Resultado != 0) { errorProvider.SetError(ConfirmarClavetextBox, "Clave no coincide!"); ConfirmarClavetextBox.Focus(); paso = false; } if (FechaIngresodateTimePicker.Value > DateTime.Now) { errorProvider.SetError(FechaIngresodateTimePicker, "La fecha Debe ser igual a hoy"); EmailtextBox.Focus(); paso = false; } if (NivelUsuariocomboBox.Text == string.Empty) { errorProvider.SetError(NivelUsuariocomboBox, "El campo Nivel de Usuario no puede estar vacio"); NivelUsuariocomboBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(UsuariotextBox.Text)) { errorProvider.SetError(UsuariotextBox, "La direccion no puede esta vacia"); UsuariotextBox.Focus(); paso = false; } if (ClavetextBox.Text == string.Empty) { errorProvider.SetError(ClavetextBox, "El campo Clave no puede estar vacio"); ClavetextBox.Focus(); paso = false; } if (ConfirmarClavetextBox.Text == string.Empty) { errorProvider.SetError(ConfirmarClavetextBox, "El campo Confirmar no puede estar vacio"); ConfirmarClavetextBox.Focus(); paso = false; } if (ValidarEmail(EmailtextBox.Text) == false) { errorProvider.SetError(EmailtextBox, "Correo invalido"); EmailtextBox.Focus(); paso = false; } if (NoDuplicadoCorreo(EmailtextBox.Text, (int)UsuarioIdnumericUpDown.Value) == true) { errorProvider.SetError(EmailtextBox, "Usuario Ya existe"); EmailtextBox.Focus(); paso = false; } if (NoDuplicadoUsuario(UsuariotextBox.Text, (int)UsuarioIdnumericUpDown.Value) == true) { errorProvider.SetError(UsuariotextBox, "Usuario Ya existe"); UsuariotextBox.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; errorProvider.Clear(); string Clave = ClavetextBox.Text; string Confirmar = ConfirmarClavetextBox.Text; int Resultado = 0; Resultado = string.Compare(Clave, Confirmar); if (Resultado != 0) { errorProvider.SetError(ConfirmarClavetextBox, "Clave no coincide!"); ConfirmarClavetextBox.Focus(); paso = false; } if (NombretextBox.Text == string.Empty) { errorProvider.SetError(NombretextBox, "El campo Nombre no puede estar vacio"); NombretextBox.Focus(); paso = false; } if (EmailtextBox.Text == string.Empty) { errorProvider.SetError(EmailtextBox, "El campo Email no puede estar vacio"); EmailtextBox.Focus(); paso = false; } if (NivelUsuariocomboBox.Text == string.Empty) { errorProvider.SetError(NivelUsuariocomboBox, "El campo Nivel de Usuario no puede estar vacio"); NivelUsuariocomboBox.Focus(); paso = false; } if (UsuariotextBox.Text == string.Empty) { errorProvider.SetError(UsuariotextBox, "El campo Usuario no puede estar vacio"); UsuariotextBox.Focus(); paso = false; } if (ClavetextBox.Text == string.Empty) { errorProvider.SetError(ClavetextBox, "El campo Clave no puede estar vacio"); ClavetextBox.Focus(); paso = false; } if (ConfirmarClavetextBox.Text == string.Empty) { errorProvider.SetError(ConfirmarClavetextBox, "El campo Confirmar no puede estar vacio"); ConfirmarClavetextBox.Focus(); paso = false; } return(paso); }
private bool Validar() { bool paso = true; MyErrorProvider.Clear(); string Clave = ClavetextBox.Text; string Confirmar = ConfirmarClavetextBox.Text; int Resultado = 0; Resultado = string.Compare(Clave, Confirmar); if (Resultado != 0) { MyErrorProvider.SetError(ConfirmarClavetextBox, "Clave no coincide!"); ConfirmarClavetextBox.Focus(); paso = false; } if (NombretextBox.Text == string.Empty) { MyErrorProvider.SetError(NombretextBox, "Este campo no puede estar vacio"); NombretextBox.Focus(); paso = false; } if (EmailtextBox.Text == string.Empty) { MyErrorProvider.SetError(EmailtextBox, "Este campo no puede estar vacio"); EmailtextBox.Focus(); paso = false; } if (NivelUsuariocomboBox.Text == string.Empty) { MyErrorProvider.SetError(NivelUsuariocomboBox, "Este campo no puede estar vacio"); NivelUsuariocomboBox.Focus(); paso = false; } if (UsuariotextBox.Text == string.Empty) { MyErrorProvider.SetError(UsuariotextBox, "Este campo no puede estar vacio"); UsuariotextBox.Focus(); paso = false; } if (ClavetextBox.Text == string.Empty) { MyErrorProvider.SetError(ClavetextBox, "Este campo no puede estar vacio"); ClavetextBox.Focus(); paso = false; } if (ConfirmarClavetextBox.Text == string.Empty) { MyErrorProvider.SetError(ConfirmarClavetextBox, "Este campo no puede estar vacio"); ConfirmarClavetextBox.Focus(); paso = false; } if (NoRepetido(UsuariotextBox.Text)) { MessageBox.Show("Los Usuarios no pueden ser iguales"); UsuariotextBox.Focus(); paso = false; } return(paso); }