Exemple #1
0
        public static void AddUser(RegisterVM registerVm)
        {
            UserMapper userMapper = new UserMapper();
            Nike_User newUser = new Nike_User(registerVm.FirstName, registerVm.LastName, registerVm.ScreenName, registerVm.Gender,
                registerVm.Zipcode, registerVm.EmailAddress, registerVm.DateOfBirth, registerVm.Password);

            userMapper.addUser(newUser);
        }
Exemple #2
0
        public static Boolean registerUser(RegisterVM registerVm)
        {
            UserMapper userMapper = new UserMapper();
            Nike_User newUser = new Nike_User(registerVm.FirstName, registerVm.LastName, registerVm.ScreenName, registerVm.Gender,
                registerVm.Zipcode, registerVm.EmailAddress, registerVm.DateOfBirth, registerVm.Password);

            Boolean succes = userMapper.checkUserExists(newUser);
            if (!succes)
            {
                userMapper.addUser(newUser);
                return true;
            }
            return false;
        }
Exemple #3
0
        public static Boolean CheckLoginCredentials(LoginVM userVm)
        {
            UserMapper userMapper = new UserMapper();
            List<Nike_User> parsedList = userMapper.GetAllUsers();

            foreach (var item in parsedList)
            {
                if ((item.emailAddress == userVm.EmailAddress) && (item.Password == userVm.Password))
                {
                    return true;
                }
            }
            return false;
        }
Exemple #4
0
 public static List<Nike_User> displayUserList()
 {
     var um = new UserMapper();
     var users = um.GetAllUsers();
     return users;
 }