private void changePasswd() { if (txtBoxNewPass.Text == txtBoxConfirmPass.Text) { string username = service.FindUsernameBySessionId(sessionId); DbUser user = new DbUser(); user.Username = username; user.Password = txtBoxNewPass.Text; if (service.UpdatePassword(user)) { LoginForm form = new LoginForm(); form.txtUsername.Text = username; form.ErrorLBL.Text = "Please Login with your new password"; form.ErrorLBL.ForeColor = Color.Green; form.ErrorLBL.Show(); this.Hide(); form.Show(); service.Logout(sessionId); } } else { lbl.ForeColor = Color.Green; lbl.Text = "New Password do not match."; } }
private void cancelBTN_Click(object sender, EventArgs e) { LoginForm login = new LoginForm(); login.Show(); this.Close(); }