private void CheckPassword() { common.Password.PasswordAttrib pwdAttrib = common.Password.GetPasswordAttrib(passwordEd.Text.Trim()); passStrenghtLbl.Text = pwdAttrib.ScoreText; passStrenghtLbl.ForeColor = pwdAttrib.TextForeColor; passStrenghtLbl.BackColor = pwdAttrib.TextBackColor; }
protected override bool DataValid(bool showMsg) { this.ShowMessage(""); bool retVal = true; ClearNotifyError(); if (accountEd.Text.Trim() == "" || accountEd.Text.Trim().Length > accountEd.MaxLength) { NotifyError(accountLbl); retVal = false; } if (passwordEd.Visible) { if (passwordEd.Text.Trim().Length < Settings.sysGlobal.PasswordMinLen) { NotifyError(passwordLbl); retVal = false; } bool checkWeakPass = true; if (checkWeakPass && Settings.sysGlobal.UseStrongPassword) { common.Password.PasswordAttrib pwdAttrib = common.Password.GetPasswordAttrib(passwordEd.Text.Trim()); if (pwdAttrib.score != common.Password.PasswordScore.Strong && pwdAttrib.score != common.Password.PasswordScore.VeryStrong) { this.ShowMessage(Languages.Libs.GetString("weakPassReEnter")); NotifyError(passwordLbl); this.passwordEd.Focus(); retVal = false; checkWeakPass = false; } } if (checkWeakPass && passwordEd.Text.Trim().Length < Settings.sysGlobal.PasswordMinLen) { this.ShowMessage(Languages.Libs.GetString("weakPassReEnter")); NotifyError(passwordLbl); this.passwordEd.Focus(); retVal = false; } } if (firstNameEd.Text.Trim() == "") { NotifyError(nameLbl); retVal = false; } if (lastNameEd.Text.Trim() == "") { NotifyError(lastNameLbl); retVal = false; } if (displayNameEd.Visible && displayNameEd.Text.Trim() == "") { NotifyError(displayNameEd); retVal = false; } if (emailEd.Visible && emailEd.Text.Trim() == "") { NotifyError(emailLbl); retVal = false; } if (investorCatCb.Visible && investorCatCb.myValue.Trim() == "") { NotifyError(investorCatLbl); retVal = false; } if (expireDateEd.Visible && expireDateEd.myDateTime == common.Consts.constNullDate) { NotifyError(expireDateLbl); retVal = false; } if (statusCb.Visible && statusCb.myValue == AppTypes.CommonStatus.None) { NotifyError(statusLbl); retVal = false; } if (!retVal && showMsg) { this.ShowMessage(Languages.Libs.GetString("invalidData")); } return(retVal); }
protected bool DataValid() { this.ShowMessage(""); bool retVal = true; string loginName = this.loginEd.Text.Trim(); string oldPassword = this.oldPasswordEd.Text.Trim(); string newPassword1 = this.newPassword1Ed.Text; string newPassword2 = this.newPassword2Ed.Text; if (loginName == "") { NotifyError(newPassword1Lbl); retVal = false; } bool checkWeakPass = true; if (checkWeakPass && Settings.sysGlobal.UseStrongPassword) { common.Password.PasswordAttrib pwdAttrib = common.Password.GetPasswordAttrib(newPassword1Ed.Text.Trim()); if (pwdAttrib.score != common.Password.PasswordScore.Strong && pwdAttrib.score != common.Password.PasswordScore.VeryStrong) { this.ShowMessage(Languages.Libs.GetString("weakPassReEnter")); NotifyError(newPassword1Ed); checkWeakPass = false; retVal = false; } } if (checkWeakPass && newPassword1Ed.Text.Trim().Length < Settings.sysGlobal.PasswordMinLen) { this.ShowMessage(Languages.Libs.GetString("weakPassReEnter")); NotifyError(newPassword1Lbl); retVal = false; } if (newPassword1 != newPassword2) { this.ShowMessage(Languages.Libs.GetString("passwordNotMatched")); NotifyError(newPassword1Lbl); NotifyError(newPassword2Lbl); retVal = false; } databases.baseDS.investorDataTable investorTbl = DataAccess.Libs.GetInvestor_ByAccount(loginName); if (investorTbl.Count == 0) { this.ShowMessage(String.Format(Languages.Libs.GetString("loginNotFount"), loginName)); NotifyError(loginLbl); retVal = false; } else { if (oldPasswordEd.Enabled && oldPassword != investorTbl[0].password.Trim()) { NotifyError(oldPasswordLbl); retVal = false; } } if (retVal) { investorTbl[0].password = this.newPassword1Ed.Text.Trim(); DataAccess.Libs.UpdateData(investorTbl[0]); this.ShowMessage(Languages.Libs.GetString("dataSaved")); } return(retVal); }