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; } }
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(); }
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(); }
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(); }
// 계정 로그아웃 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); }