Exemplo n.º 1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            if (tbxPassword.Text == "")
            {
                MessageBox.Show("Empty password");
                return;
            }

            if (tbxConfirmPassword.Text == "")
            {
                MessageBox.Show("Empty confirm password");
                return;
            }

            E_ACCOUNT result = Program.accountManager.ChangePassword(tbxPassword.Text, tbxConfirmPassword.Text);

            switch (result)
            {
            case E_ACCOUNT.NOBODY_HAVE_LOGINED:
                MessageBox.Show("Nobody have logined");
                break;

            case E_ACCOUNT.ACCOUNT_DOES_NOT_EXIST:
                MessageBox.Show("Account does not exist");
                break;

            case E_ACCOUNT.PASSWORD_CONFIRM_FAILED:
                MessageBox.Show("Password confirm failed");
                break;

            case E_ACCOUNT.OK:
                MessageBox.Show("Password have changed");
                break;
            }
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (tbxAccount.Text == "")
            {
                MessageBox.Show("Empty account");
                return;
            }

            if (tbxPassword.Text == "")
            {
                MessageBox.Show("Empty password");
                return;
            }

            E_ACCOUNT result = Program.accountManager.Login(tbxAccount.Text, tbxPassword.Text);

            switch (result)
            {
            case E_ACCOUNT.ACCOUNT_DOES_NOT_EXIST:
                MessageBox.Show("Account does not exist");
                return;

            case E_ACCOUNT.PASSWORD_DOES_NOT_MATCH:
                MessageBox.Show("Password does not match");
                return;

            case E_ACCOUNT.ACCOUNT_DOES_NOT_ACTIVATED:
                MessageBox.Show("Account does not activated");
                return;
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Exemplo n.º 3
0
        private void btnJoin_Click(object sender, EventArgs e)
        {
            if (tbxAccount.Text == "")
            {
                MessageBox.Show("Empty account");
                return;
            }

            if (tbxPassword.Text == "")
            {
                MessageBox.Show("Empty password");
                return;
            }

            if (tbxConfirmPassword.Text == "")
            {
                MessageBox.Show("Empty confirm password");
                return;
            }

            E_ACCOUNT result = Program.accountManager.Join(tbxAccount.Text, tbxPassword.Text, tbxConfirmPassword.Text);

            switch (result)
            {
            case E_ACCOUNT.ACCOUNT_ALREADY_EXIST:
                MessageBox.Show("Account already exist");
                return;

            case E_ACCOUNT.PASSWORD_CONFIRM_FAILED:
                MessageBox.Show("Password confirm failed");
                return;
            }

            Close();
        }
Exemplo n.º 4
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            E_ACCOUNT result = Program.accountManager.Logout();

            switch (result)
            {
            case E_ACCOUNT.NOBODY_HAVE_LOGINED:
                MessageBox.Show("Nobody have logined");
                break;
            }

            DisplayLogin();
        }
Exemplo n.º 5
0
        // 계정 로그아웃
        public E_ACCOUNT Logout()
        {
            E_ACCOUNT result = E_ACCOUNT.OK;

            if (currentLoginAccount == "")
            {
                result = E_ACCOUNT.NOBODY_HAVE_LOGINED;
            }
            else
            {
                currentLoginAccount = "";
                result = E_ACCOUNT.OK;
            }

            return(result);
        }