Beispiel #1
0
        private void btnHome_Click(object sender, EventArgs e)
        {
            StudentHome goHome = new StudentHome();

            goHome.Show();
            Hide();
        }
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            StudentHome gohome = new StudentHome();

            gohome.Show();
            Hide();
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            HashTable hashTable = new HashTable(); //process class in BIZ layer for SHA1 encryption
            string    username  = txtUsername.Text;
            string    password  = hashTable.EncryptPassword(txtPassword.Text);

            //Call DAL Layer for Processing Login Auth against DB
            LoginDALProcessing processLogin = new LoginDALProcessing();

            if (processLogin.AuthenticateUserDetails(username, password))
            {
                MessageBox.Show("Login Successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                StudentHome succesfulLogin = new StudentHome();
                succesfulLogin.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Login Failed - Please Try Again", "Failed Login", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            txtUsername.Clear();
            txtPassword.Clear();
        }