private void ChangeButton_Click(object sender, EventArgs e) { if ((username != "giaovu" && CurrPass.Text.Length < 8) || CurrPass.Text.Length > 16) { NotiLabel.Text = "Current password is not correct."; } else if (NewPass.Text.Length < 8) { NotiLabel.Text = "Password must contain at least 8 characters."; } else if (NewPass.Text.Length > 16) { NotiLabel.Text = "Password must contain at most 16 characters."; } else if (NewPass.Text != ConfirmPass.Text) { NotiLabel.Text = "Confirm new password does not match."; } else if (NewPass.Text == CurrPass.Text) { NotiLabel.Text = "New password must be different from the current one."; } else { StudentServices services = new StudentServices(); NotiLabel.Text = services.ChangePassword(username, CurrPass.Text, NewPass.Text); } CurrPass.Clear(); NewPass.Clear(); ConfirmPass.Clear(); }
private void ClearProps() { _wallet = null; CurrPass.Clear(); NewPass.Clear(); ConfPass.Clear(); }