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

            return(userInfoViewModelList);
        }
예제 #2
0
        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");
        }
예제 #3
0
        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);
        }
예제 #4
0
 public bool IsUserNameAndPasswordValid(string userName, string password)
 {
     password = NCSecurity.EncryptValue(password);
     return(_userInfoGateway.IsUserNameAndPasswordValid(userName, password));
 }