Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Database      a         = new Database();
            string        username  = a.authUser(IDuser.Text, Clave.Text);
            PrincipalMenu m         = new PrincipalMenu();
            sendValue     sendValue = new sendValue(m.receiveData);

            if (username != null)
            {
                sendValue(username, IDuser.Text, this);
                m.Show();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("El usuario o la contraseña son incorrectas.");
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string username = LogIn_username.Text.ToString();
            string password = LogIn_password.Text.ToString();

            if (check.CheckString(username, 30) && check.CheckString(password, 25))
            {
                Employee employee = database.authUser(username, password);
                if (employee.Name != null)
                {
                    PrincipalMenu principalMenu = new PrincipalMenu();
                    sendValue     sendValue     = new sendValue(principalMenu.receiveData);
                    sendValue(employee.Id, employee.Name, username, this);
                    principalMenu.Show();
                    this.Visible = false;
                }
                else
                {
                    labelWrongPassword.Visible = true;
                }
            }
        }