Exemple #1
0
 public bool authenticateUser(string username, string password)
 {
     try
     {
         wpUser u = this._context.wpUsers.Where(x => x.username.Equals(username)).SingleOrDefault();
         return(u.pwd.Equals(EncrytionFactory.Encrypt(password, AppStoreData.ENCRYTION_KEY)));
     }
     catch (Exception ex)
     {
         AppStoreData.APP_LOGGER.Error(ex);
         return(false);
     }
 }
Exemple #2
0
        public bool encrytSavePassword(string username, string password)
        {
            try
            {
                wpUser u = this._context.wpUsers.Where(x => x.username.Equals(username)).SingleOrDefault();
                u.pwd = EncrytionFactory.Encrypt(password, AppStoreData.ENCRYTION_KEY);

                this._context.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                AppStoreData.APP_LOGGER.Error(ex);
                return(false);
            }
        }