Exemple #1
0
        public IActionResult GamerProfile(int id)
        {
            var profile = profileSearchDAL.GetProfile(id);

            profile = profileDAL.GetProfile(profile.Username);
            AllInformationModel AllInfo = new AllInformationModel();
            var user        = authProvider.GetCurrentUser();
            var currentUser = profileDAL.GetProfile(user.Username);

            profile.IsPopulated = false;
            if (currentUser.GameTitles.Count != 0 && currentUser.GenreNames.Count != 0)
            {
                AllInfo.AllUsers      = profileSearchDAL.GetMatches();
                AllInfo.CurrentUser   = AllInfo.GetCurrentGamer(AllInfo.AllUsers, user.Username);
                profile.MatchStrength = AllInfo.Matches(AllInfo.AllUsers, AllInfo.CurrentUser);
                profile.IsPopulated   = true;
            }
            return(View(profile));
        }
        public IActionResult Index(User userProfile)
        {
            var user      = authProvider.GetCurrentUser();
            var container = profileDAO.GetProfile(user.Username);
            AllInformationModel AllInfo = new AllInformationModel();

            if (container.GameTitles.Count != 0 && container.GenreNames.Count != 0)
            {
                if (container.GameTitles.Count != 0 && container.GenreNames.Count != 0)
                {
                    AllInfo.AllUsers        = profileSearchDAL.GetMatches();
                    AllInfo.CurrentUser     = AllInfo.GetCurrentGamer(AllInfo.AllUsers, user.Username);
                    container.MatchStrength = AllInfo.Matches(AllInfo.AllUsers, AllInfo.CurrentUser);
                    container.MatchStrength = AllInfo.RemoveCurrentGamer(container.MatchStrength, user.Username);
                    container.TopThree      = AllInfo.GetTopThree(container.MatchStrength);
                }
            }
            return(View(container));
        }