public UserProfileModel AuthorityProfile(UserInformationModel<User> anAuthorityUserInformation)
        {
            User myAuthorityUser = anAuthorityUserInformation.Details;
            IEnumerable<Issue> myPeoplesIssues = new List<Issue>();
            IEnumerable<IssueReply> myPeoplesIssueReplies = new List<IssueReply>();

            string myAuthorityPosition = myAuthorityUser.UserPosition.Position.ToUpper();

            if (AuthorityClassification.GetAuthorityPostionsViewableByZip().Contains(myAuthorityPosition)) {
                myPeoplesIssues = theRepository.AuthorityIssuesFeedByZipCode(myAuthorityUser);
                myPeoplesIssueReplies = theRepository.AuthorityIssueReplysFeedByZipCode(myAuthorityUser);
            } else if (AuthorityClassification.GetAuthorityPostionsViewableByCityState().Contains(myAuthorityPosition)) {
                myPeoplesIssues = theRepository.AuthorityIssuesFeedByCityState(myAuthorityUser);
                myPeoplesIssueReplies = theRepository.AuthorityIssueReplysFeedByCityState(myAuthorityUser);
            } else if (AuthorityClassification.GetAuthorityPostionsViewableByState().Contains(myAuthorityPosition)) {
                myPeoplesIssues = theRepository.AuthorityIssuesFeedByState(myAuthorityUser);
                myPeoplesIssueReplies = theRepository.AuthorityIssueReplysFeedByState(myAuthorityUser);
            }

            List<IssueFeedModel> myIssueFeed = CreateIssueFeedForAuthority(myPeoplesIssues, anAuthorityUserInformation, PersonFilter.People).ToList<IssueFeedModel>();
            List<IssueReplyFeedModel> myIssueReplyFeed = CreateIssueReplyFeedForAuthority(myPeoplesIssueReplies, anAuthorityUserInformation, PersonFilter.People).ToList<IssueReplyFeedModel>();
            IEnumerable<IssueFeedModel> myPoliticiansIssueFeed = CreateIssueFeed(theRepository.IssueFeedByRole(UserRoleHelper.PoliticianRoles()), myAuthorityUser, PersonFilter.Politicians);
            IEnumerable<IssueReplyFeedModel> myPoliticiansIssueReplyFeed = CreateIssueReplyFeed(theRepository.IssueReplyFeedByRole(UserRoleHelper.PoliticianRoles()), myAuthorityUser, PersonFilter.Politicians);
            IEnumerable<IssueFeedModel> myPoliticalCandidateIssueFeed = CreateIssueFeed(theRepository.IssueFeedByRole(UserRoleHelper.PoliticalCandidateRoles()), myAuthorityUser, PersonFilter.PoliticalCandidates);
            IEnumerable<IssueReplyFeedModel> myPoliticalCandidateIssueReplyFeed = CreateIssueReplyFeed(theRepository.IssueReplyFeedByRole(UserRoleHelper.PoliticalCandidateRoles()), myAuthorityUser, PersonFilter.PoliticalCandidates);

            //myIssueFeed.AddRange(myPoliticiansIssueFeed);
            //myIssueFeed.AddRange(myPoliticalCandidateIssueFeed);
            myIssueFeed = myIssueFeed.OrderByDescending(i => i.DateTimeStamp).Take<IssueFeedModel>(10).ToList<IssueFeedModel>();

            //myIssueReplyFeed.AddRange(myPoliticiansIssueReplyFeed);
            //myIssueReplyFeed.AddRange(myPoliticalCandidateIssueReplyFeed);
            myIssueReplyFeed = myIssueReplyFeed.OrderByDescending(ir => ir.DateTimeStamp).Take<IssueReplyFeedModel>(10).ToList<IssueReplyFeedModel>();

            Issue myRandomLocalIssue = theRepository.RandomLocalIssue(myAuthorityUser);

            UserProfileModel myModel = new UserProfileModel(myAuthorityUser) {
                IssueFeed = myIssueFeed,
                IssueReplyFeed = myIssueReplyFeed,
            };

            Random myRandom = new Random();
            if (myRandom.Next() % 2 == 1) {
                if (!SetForLocalIssue(myModel, myAuthorityUser)) {
                    SetForFriendSuggestion(myModel, anAuthorityUserInformation);
                }
            } else {
                if (!SetForFriendSuggestion(myModel, anAuthorityUserInformation)) {
                    SetForLocalIssue(myModel, myAuthorityUser);
                }
            }

            return myModel;
        }
        private bool SetForLocalIssue(UserProfileModel aModel, User aUser)
        {
            bool myDone = false;
            Issue myRandomLocalIssue = theRepository.RandomLocalIssue(aUser);
            if (myRandomLocalIssue != null) {
                aModel.QuickNavigation = QuickNavigation.LocalIssue;
                aModel.LocalIssue = myRandomLocalIssue;
                myDone = true;
            } else {
                aModel.QuickNavigation = QuickNavigation.IssueTip;
                myDone = true;
            }

            return myDone;
        }
 private bool SetForFriendSuggestion(UserProfileModel aModel, UserInformationModel<User> aUser)
 {
     bool myDone = false;
     IEnumerable<FriendConnectionModel> myConnectionModel = theProfileQuestionService.GetPossibleFriendConnections(aUser, 1);
     if (myConnectionModel.Count<FriendConnectionModel>() > 0) {
         aModel.QuickNavigation = QuickNavigation.SuggestedFriend;
         aModel.FriendConnectionModel = myConnectionModel.FirstOrDefault<FriendConnectionModel>();
         myDone = true;
     } else {
         aModel.QuickNavigation = QuickNavigation.SuggestFriendTip;
         myDone = true;
     }
     return myDone;
 }
        private UserProfileModel Profile(User aUser, User aViewingUser)
        {
            IEnumerable<Board> myBoardMessages = theBoardRepository.FindBoardByUserId(aUser.Id);
            //IEnumerable<PhotoAlbum> myPhotoAlbums = thePhotoAlbumService.GetPhotoAlbumsForUser(aViewingUser, aUser.Id);

            UserProfileModel myProfileModel = new UserProfileModel(aUser) {
                BoardFeed = CreateBoardFeed(myBoardMessages),
                IssueFeed = CreateIssueFeed(theRepository.UserIssueFeed(aUser.Id), aViewingUser, PersonFilter.People),
                IssueReplyFeed = CreateIssueReplyFeed(theRepository.UserIssueReplyFeed(aUser.Id), aViewingUser, PersonFilter.People),
            };

            if (aViewingUser != null) {
                foreach (Board myBoard in myBoardMessages) {
                    theBoardRepository.MarkBoardAsViewed(aViewingUser, myBoard.Id);
                }
            }

            return myProfileModel;
        }
        public UserProfileModel UserIssueActivity(int aUserId, User aViewingUser)
        {
            AbstractUserModel<User> myAbstractUser = SocialUserModel.Create(aViewingUser);

            if (theFriendService.IsFriend(aUserId, myAbstractUser)) {
                User myUser = theUserRetrievalService.GetUser(aUserId);
                UserProfileModel myModel = new UserProfileModel(myUser) {
                    IssueFeed = CreateIssueFeed(theRepository.IssuesUserCreated(myUser), aViewingUser, PersonFilter.People),
                    IssueReplyFeed = CreateIssueReplyFeed(theRepository.IssuesUserRepliedTo(myUser), aViewingUser, PersonFilter.People)
                };

                return myModel;
            }

            throw new CustomException(HAVConstants.NOT_ALLOWED);
        }
        public UserProfileModel MyProfile(UserInformationModel<User> aUserInfo)
        {
            User myUser = aUserInfo.Details;

            List<IssueFeedModel> myIssueFeed = CreateIssueFeed(theRepository.FriendIssueFeed(myUser), myUser, PersonFilter.People).ToList<IssueFeedModel>();
            List<IssueReplyFeedModel> myIssueReplyFeed = CreateIssueReplyFeed(theRepository.FriendIssueReplyFeed(myUser), myUser, PersonFilter.People).ToList<IssueReplyFeedModel>();
            IEnumerable<IssueFeedModel> myPoliticiansIssueFeed = CreateIssueFeed(theRepository.IssueFeedByRole(UserRoleHelper.PoliticianRoles()), myUser, PersonFilter.Politicians);
            IEnumerable<IssueReplyFeedModel> myPoliticiansIssueReplyFeed = CreateIssueReplyFeed(theRepository.IssueReplyFeedByRole(UserRoleHelper.PoliticianRoles()), myUser, PersonFilter.Politicians);
            IEnumerable<IssueFeedModel> myPoliticalCandidateIssueFeed = CreateIssueFeed(theRepository.IssueFeedByRole(UserRoleHelper.PoliticalCandidateRoles()), myUser, PersonFilter.PoliticalCandidates);
            IEnumerable<IssueReplyFeedModel> myPoliticalCandidateIssueReplyFeed = CreateIssueReplyFeed(theRepository.IssueReplyFeedByRole(UserRoleHelper.PoliticalCandidateRoles()), myUser, PersonFilter.PoliticalCandidates);

            myIssueFeed.AddRange(myPoliticiansIssueFeed);
            myIssueFeed.AddRange(myPoliticalCandidateIssueFeed);
            myIssueFeed = myIssueFeed.OrderByDescending(i => i.DateTimeStamp).ToList<IssueFeedModel>();

            myIssueReplyFeed.AddRange(myPoliticiansIssueReplyFeed);
            myIssueReplyFeed.AddRange(myPoliticalCandidateIssueReplyFeed);
            myIssueReplyFeed = myIssueReplyFeed.OrderByDescending(ir => ir.DateTimeStamp).ToList<IssueReplyFeedModel>();

            UserProfileModel myModel = new UserProfileModel(myUser) {
                IssueFeed = myIssueFeed,
                IssueReplyFeed = myIssueReplyFeed,
                //PhotoAlbumFeed = CreatePhotoAlbumFeed(theRepository.FriendPhotoAlbumFeed(aUser))
            };

            Random myRandom = new Random();
            if (myRandom.Next() % 2 == 1) {
                if(!SetForLocalIssue(myModel, myUser)) {
                    SetForFriendSuggestion(myModel, aUserInfo);
                }
            } else {
                if (!SetForFriendSuggestion(myModel, aUserInfo)) {
                    SetForLocalIssue(myModel, myUser);
                }
            }

            return myModel;
        }