Пример #1
0
 public bool ResetAccessPass(string password, string rowmodifiedby)
 {
     GenericProvider.HashStore.CustomHash _hash = new GenericProvider.HashStore.CustomHash();
     string _newPasswordHash = _hash.ComputeHash(password);
     DALAccess _dalAccess = new DALAccess();
     return (_dalAccess.UpdateAccessPass(idno, _newPasswordHash, _hash.saltValue, rowmodifiedby));
 }
Пример #2
0
 public bool VerifyUser(string password, string passwordhash, string passwordsalt)
 {
     GenericProvider.HashStore.CustomHash _hash = new GenericProvider.HashStore.CustomHash();
     _hash.saltValue = passwordsalt;
     string _newPasswordHash = _hash.ComputeHash(password);
     return _hash.VerifyHash(password, passwordhash);
 }
Пример #3
0
        public bool NewEmployee(NewEmployeeViewModel model, string rowmodifiedby)
        {
            DALProfile _profile = new DALProfile();
            GenericProvider.HashStore.CustomHash _hash = new GenericProvider.HashStore.CustomHash();

            model.RegularizationDate = model.DateHired.Value.AddDays(180);

            return _profile.SaveEmployee(model, _hash.ComputeHash(model.Password), _hash.saltValue, rowmodifiedby);
        }
Пример #4
0
        public byte UpdateAccessPass(string oldpassword, string passwordhash, string passwordsalt,
            string newpassword, string rowmodifiedby)
        {
            DALAccess _dalAccess = new DALAccess();

            if (VerifyUser(oldpassword, passwordhash, passwordsalt))
            {
                GenericProvider.HashStore.CustomHash _hash = new GenericProvider.HashStore.CustomHash();
                string _newPasswordHash = _hash.ComputeHash(newpassword);
                _dalAccess.UpdateAccessPass(idno, _newPasswordHash, _hash.saltValue, rowmodifiedby);
                return 1;
            }

            return 0;
        }