public Profile GetProfile(string id, string otheruserid) { long thisUserId; long userid; logger.Debug(Settings.MethodName()); logger.Trace("Parameters: id: " + id + "otheruserid: " + otheruserid); if (isCorrectUser(id)) { long.TryParse(id, out thisUserId); // voor het opvragen van een profiel van een andere gebruiker, gebruiken we het andere id if (!String.IsNullOrEmpty(otheruserid)) { id = otheruserid; } long.TryParse(id, out userid); S_User user = UserManager.GetUserById(userid); if (user != null) { Profile profile = new Profile(); profile.user = new User(); profile.user.userid = user.id; profile.user.city = user.city; profile.user.name = user.name; profile.user.username = user.username; profile.user.scores = GameManager.GetProfileScores(user.username, user.frequentbowlernumber); if (String.IsNullOrEmpty(otheruserid)) { profile.user.is_favorite = false; } else { profile.user.is_favorite = FavoritManager.IsUserFavoritOfUser(thisUserId, userid); } logger.Trace("Return: userid: " + profile.user.userid); logger.Trace("Return: city: " + profile.user.city); logger.Trace("Return: email: " + profile.user.name); logger.Trace("Return: username: "******"Return: is_favorite: " + profile.user.is_favorite); return(profile); } } return(null); }