private void CreateUser() { var user = new User(); user.Username = "******"; user.Password = _secure.EncryptData("test"); _conn.InsertUser(user); _id = _conn.GetUserByName(user.Username).UserId; }
private bool ValidateUser(string username, string password) { var check = false; //Get the user and validate the password matches the DB var user = _conn.GetUserByName(username); if (user != null) { var pass = _secure.DecryptData(user.Password); if (pass == password) { check = true; _userId = user.UserId; } } return(check); }