Пример #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtUser.Text != null && txtPassword.Text != null)
            {
                oUserSistemas.PASSWORDWEB = txtPassword.Text;
                oUserSistemas.NOMVENDEDOR = txtUser.Text;

                UserSistemas OUserLogueado = BuscarUsuario();
                if (OUserLogueado.NOMVENDEDOR != null && OUserLogueado.PASSWORDWEB != null)
                {
                    oUserSistemas.PASSWORDWEB = txtPassword.Text;
                    UserLogued = true;
                    Entradafiltros FormFiltros = new Entradafiltros(ObjDaConnexion, OUserLogueado);
                    this.Hide();
                    FormFiltros.ShowDialog();
                    this.Show();
                }
                else
                {
                    MessageBox.Show("Error en la Validación del Usuario", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPassword.SelectAll();
                }
            }
            else
            {
                MessageBox.Show("Ingrese Datos Validos", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtPassword.SelectAll();
            }
        }
Пример #2
0
        private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (Char)13)
            {
                if (txtPassword.Text == "")
                {
                    txtUser.Text = "";
                }

                else
                {
                    oUserSistemas.PASSWORDWEB = txtPassword.Text;
                    UserSistemas OUserLogueado = BuscarUsuario();
                    if (OUserLogueado.NOMVENDEDOR != null && OUserLogueado.PASSWORDWEB != null)
                    {
                        UserLogued = true;
                        Entradafiltros FormFiltros = new Entradafiltros(ObjDaConnexion, OUserLogueado);
                        this.Hide();
                        FormFiltros.ShowDialog();
                        this.Show();
                    }
                    else
                    {
                        MessageBox.Show("Error en la Validación del Usuario", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtPassword.SelectAll();
                    }
                }
            }
        }