public Response Login(string username, string password) { try { return(ClsSeguridad.Login(username, password)); } catch (Exception e) { return(new Response { IsSuccess = false }); } }
private void Validar() { try { _Trastienda.Usuario = _Trastienda.WebApiSeguridad.Valida_Usuarios(txtUsuario.Text, ClsSeguridad.GetSHA256(txtContrasena.Text)); //_Trastienda.Usuario = _Trastienda.WebApiSeguridad.Valida_Usuarios(txtUsuario.Text, txtContrasena.Text); if (_Trastienda.Usuario != null) { if (_Trastienda.Usuario.Usuario_Id > 0) { _Salir = false; this.Close(); } else { MessageBox.Show("Los datos digitados no son válidos"); txtUsuario.SelectAll(); txtContrasena.Focus(); } } else { MessageBox.Show("Los datos digitados no son válidos"); txtUsuario.SelectAll(); txtContrasena.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Login", MessageBoxButtons.OK, MessageBoxIcon.Error); } }