public List <UserInfoViewModel> GetUserMenu(string email, string password)
        {
            password         = NCSecurity.EncryptValue(password);
            _userInfoGateway = new UserInfoGateway();
            List <UserInfoViewModel> userInfoViewModelList = _userInfoGateway.GetUserMenu(email, password);

            return(userInfoViewModelList);
        }
        public string Save(UserInfo userInfo)
        {
            userInfo.Password = NCSecurity.EncryptValue(userInfo.Password);

            if (_userInfoGateway.IsEmailExists(userInfo.Email))
            {
                return("Email Already Exists");
            }

            int rowAffect = _userInfoGateway.Save(userInfo);

            return(rowAffect > 0 ? "Save Successfull" : "Save Failed");
        }
        public int PasswordReset(int id)
        {
            string email           = GetUserById(id).Email;
            string encryptPassword = NCSecurity.EncryptValue(email + "123");
            string decvalue        = NCSecurity.DecryptValue(encryptPassword);
            string query           = "update UserInfo set Password =@passowrd where Id=@id";

            Command = new SqlCommand(query, Connection);
            Command.Parameters.AddWithValue("@id", id);
            Command.Parameters.AddWithValue("@passowrd", encryptPassword);
            Connection.Open();
            int rowAffect = Command.ExecuteNonQuery();

            Connection.Close();
            return(rowAffect);
        }
 public bool IsUserNameAndPasswordValid(string userName, string password)
 {
     password = NCSecurity.EncryptValue(password);
     return(_userInfoGateway.IsUserNameAndPasswordValid(userName, password));
 }