Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void SetPassword(string password)
 {
     this.storedPassword = PasswordCryptographer.HashPasswordDelegate(password);
     OnChanged("StoredPassword");
 }
Exemplo n.º 4
0
 public bool ComparePassword(string password)
 {
     return(PasswordCryptographer.VerifyHashedPasswordDelegate(this.storedPassword, password));
 }
Exemplo n.º 5
0
 public void SetPassword(string password)
 {
     StoredPassword = new PasswordCryptographer().GenerateSaltedPassword(password);
 }
Exemplo n.º 6
0
 public void SetPassword(string password)
 {
     //this.storedPassword = new PasswordCryptographer().GenerateSaltedPassword(password);
     this.storedPassword = PasswordCryptographer.HashPasswordDelegate(password);
     OnChanged("StoredPassword");
 }
Exemplo n.º 7
0
 public bool ComparePassword(string password)
 {
     //return SecurityUserBase.ComparePassword(this.storedPassword, password);
     return(PasswordCryptographer.VerifyHashedPasswordDelegate(this.storedPassword, password));
 }
Exemplo n.º 8
0
        Boolean IAuthenticationStandardUser.ComparePassword(String password)
        {
            var passwordCryptographer = new PasswordCryptographer();

            return(passwordCryptographer.AreEqual(StoredPassword, password));
        }
Exemplo n.º 9
0
        public void SetPassword(String password)
        {
            var passwordCryptographer = new PasswordCryptographer();

            StoredPassword = passwordCryptographer.GenerateSaltedPassword(password);
        }
Exemplo n.º 10
0
		public void SetPassword(String password) {
			PasswordCryptographer passwordCryptographer = new PasswordCryptographer();
			StoredPassword = passwordCryptographer.GenerateSaltedPassword(password);
		}
Exemplo n.º 11
0
		// IAuthenticationStandardUser
		Boolean IAuthenticationStandardUser.ComparePassword(String password) {
			PasswordCryptographer passwordCryptographer = new PasswordCryptographer();
			return passwordCryptographer.AreEqual(StoredPassword, password);
		}
Exemplo n.º 12
0
 public void SetPassword(string password)
 {
     StoredPassword = new PasswordCryptographer().GenerateSaltedPassword(password);
 }
Exemplo n.º 13
0
 public void SetPassword(string password)
 {
     StoredPassword = PasswordCryptographer.HashPasswordDelegate(password);
 }