/// <summary> /// 获取会员卡信息 0:数据库操作失败, 1:成功, 2:会员卡号或者密码错误 /// </summary> public int GetVIPCard(string cardNo, string password, out VIPCard card) { int result = 0; try { _daoManager.OpenConnection(); //加密的密码 string str = string.Empty; string saltedPassword = _vipCardDao.GetCardPassword(cardNo); if (!string.IsNullOrEmpty(saltedPassword)) { int index = saltedPassword.IndexOf(Delim); string salt = saltedPassword.Substring(0, index); str = salt + Delim + PasswordCryptographer.SaltPassword(password, salt); } card = _vipCardDao.GetVIPCard(cardNo, str); result = card == null ? 2 : 1; } catch (Exception exception) { card = null; LogHelper.GetInstance().Error(string.Format("[GetVIPCard]参数:cardNo_{0}", cardNo), exception); } finally { _daoManager.CloseConnection(); } return(result); }
public Int32 UpdateVIPCardStatus(string cardNo, string password, int status) { int result = 0; try { _daoManager.OpenConnection(); //加密的密码 string str = string.Empty; if (status == 1) { str = PasswordCryptographer.GenerateSaltedPassword(password); } else { string saltedPassword = _vipCardDao.GetCardPassword(cardNo); if (!string.IsNullOrEmpty(saltedPassword)) { int index = saltedPassword.IndexOf(Delim); string salt = saltedPassword.Substring(0, index); str = salt + Delim + PasswordCryptographer.SaltPassword(password, salt); } } result = _vipCardDao.UpdateVIPCardStatus(cardNo, str, status); } catch (Exception exception) { LogHelper.GetInstance().Error(string.Format("[UpdateVIPCardStatus]参数:cardNo_{0},status_{1}", cardNo, status), exception); } finally { _daoManager.CloseConnection(); } return(result); }
public void SetPassword(string password) { this.storedPassword = PasswordCryptographer.HashPasswordDelegate(password); OnChanged("StoredPassword"); }
public bool ComparePassword(string password) { return(PasswordCryptographer.VerifyHashedPasswordDelegate(this.storedPassword, password)); }
public void SetPassword(string password) { StoredPassword = new PasswordCryptographer().GenerateSaltedPassword(password); }
public void SetPassword(string password) { //this.storedPassword = new PasswordCryptographer().GenerateSaltedPassword(password); this.storedPassword = PasswordCryptographer.HashPasswordDelegate(password); OnChanged("StoredPassword"); }
public bool ComparePassword(string password) { //return SecurityUserBase.ComparePassword(this.storedPassword, password); return(PasswordCryptographer.VerifyHashedPasswordDelegate(this.storedPassword, password)); }
Boolean IAuthenticationStandardUser.ComparePassword(String password) { var passwordCryptographer = new PasswordCryptographer(); return(passwordCryptographer.AreEqual(StoredPassword, password)); }
public void SetPassword(String password) { var passwordCryptographer = new PasswordCryptographer(); StoredPassword = passwordCryptographer.GenerateSaltedPassword(password); }
public void SetPassword(String password) { PasswordCryptographer passwordCryptographer = new PasswordCryptographer(); StoredPassword = passwordCryptographer.GenerateSaltedPassword(password); }
// IAuthenticationStandardUser Boolean IAuthenticationStandardUser.ComparePassword(String password) { PasswordCryptographer passwordCryptographer = new PasswordCryptographer(); return passwordCryptographer.AreEqual(StoredPassword, password); }
public void SetPassword(string password) { StoredPassword = new PasswordCryptographer().GenerateSaltedPassword(password); }
public void SetPassword(string password) { StoredPassword = PasswordCryptographer.HashPasswordDelegate(password); }