Пример #1
0
        public List <UserViewModel> GetUserLoginBlock(string emailId)
        {
            List <UserViewModel> model         = new List <UserViewModel>();
            List <vw_userDetail> getUserDetail = new List <vw_userDetail>();

            UserViewModel list = new UserViewModel();


            var _isUser = _entities.tbl_tbl_User.Where(x => x.InternalEmailID == emailId).FirstOrDefault();

            if (_isUser != null)
            {
                _isUser.LoginCount = 5;
                _entities.SaveChanges();
                list.Message = "Blocked";
            }

            model.Add(list);

            return(model);
        }
Пример #2
0
        public async Task <int> EncryptPasswordAllUser()
        {
            int Res = 0;

            using (var _context = new MODEntities())
            {
                var isValid = _context.tbl_tbl_User.ToList();
                foreach (var i in isValid)
                {
                    //if (i.Pswd_Salt == null)
                    {
                        string GenPwd = Cipher.Encrypt_Portal(i.Password);
                        // string GenPwd = i.Password;
                        //string GetSalt = GeneratedPassword.CreateSalt(10);
                        // string hashString = GeneratedPassword.GenarateHash(GenPwd, GetSalt);
                        i.Pswd_Salt = GenPwd;
                        i.Flag      = "Y";
                        _context.SaveChanges();
                    }
                }
                return(Res);
            }
        }