コード例 #1
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            int result = 0;

            string username;
            string password;

            username = tb_user.Text.ToString();
            password = tb_pass.Text.ToString();

            BusinessLogicLayer.LoginControls reg = new BusinessLogicLayer.LoginControls();
            result = reg.LoginUser(username, password);

            if (result == 1)
            {
                lbl_error.Text = "Login Successful!";
                PasswordBank.currentUser = username;
                PasswordBank PB = new PasswordBank();
                PB.LabelText = username;
            }
            else
            {
                lbl_error.Text = "Login Unsuccessful!";
            }
        }
コード例 #2
0
        private void btn_createAccount_Click(object sender, EventArgs e)
        {
            int result = 0;

            string username;
            string password;

            username = tb_user.Text.ToString();
            password = tb_pass.Text.ToString();

            BusinessLogicLayer.LoginControls reg = new BusinessLogicLayer.LoginControls();
            result = reg.RegisterUser(username, password);

            if (result == 1)
            {
                lbl_error.Text = "Registration Successful!";
            }
            else
            {
                lbl_error.Text = "Registration Unsuccessful!";
            }
        }