private void AssertFriend(Member friend, ICandidate candidate, IResume resume) { AssertPageContains(friend.FullName); var viewer = new PersonalView(friend, PersonalContactDegree.FirstDegree, PersonalContactDegree.FirstDegree); // Current Jobs. if (viewer.CanAccess(PersonalVisibility.CurrentJobs)) { AssertPageContains(resume.GetCurrentJobsDisplayHtml()); } else { AssertPageDoesNotContain(resume.GetCurrentJobsDisplayHtml()); } // Candidate Status. if (viewer.CanAccess(PersonalVisibility.CandidateStatus)) { if (candidate.Status != CandidateStatus.Unspecified) { AssertPageContains(NetworkerFacade.GetCandidateStatusText(candidate.Status)); } } else { if (candidate.Status != CandidateStatus.Unspecified) { AssertPageDoesNotContain(NetworkerFacade.GetCandidateStatusText(candidate.Status)); } } // Suburb. if (viewer.CanAccess(PersonalVisibility.Suburb)) { AssertPageContains(friend.Address.Location.Suburb); AssertPageContains(" " + friend.Address.Location.Postcode); } else { AssertPageDoesNotContain(friend.Address.Location.Suburb); AssertPageDoesNotContain(" " + friend.Address.Location.Postcode); // GUIDs can contain "3143", too! } // CountrySubdivision. if (viewer.CanAccess(PersonalVisibility.CountrySubdivision)) { AssertPageContains(friend.Address.Location.CountrySubdivision.ShortName); } else { AssertPageDoesNotContain(friend.Address.Location.CountrySubdivision.ShortName); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); rdoAvailable.Text = NetworkerFacade.GetCandidateStatusText(CandidateStatus.AvailableNow); rdoActive.Text = NetworkerFacade.GetCandidateStatusText(CandidateStatus.ActivelyLooking); rdoOpen.Text = NetworkerFacade.GetCandidateStatusText(CandidateStatus.OpenToOffers); rdoNotLooking.Text = NetworkerFacade.GetCandidateStatusText(CandidateStatus.NotLooking); }
protected string GetCandidateStatusText() { return(GetOptionalListItem(NetworkerFacade.GetCandidateStatusText(_candidate.Status))); }
private bool AssertFriendsFriend(Guid memberId, Member friendsFriend, ICandidate friendsCandidate, IResume friendsResume, bool checkAddress) { try { AssertPageContains(friendsFriend.FullName); var contactDegree = friendsFriend.Id == memberId ? PersonalContactDegree.Self : PersonalContactDegree.SecondDegree; var view = new PersonalView(friendsFriend, contactDegree, contactDegree); // Current Jobs. if (view.CanAccess(PersonalVisibility.CurrentJobs)) { var currentJobs = friendsResume.GetCurrentJobsDisplayHtml(); if (!string.IsNullOrEmpty(currentJobs)) { AssertPageContains(currentJobs); } } else { var currentJobs = friendsResume.GetCurrentJobsDisplayHtml(); if (!string.IsNullOrEmpty(currentJobs)) { AssertPageDoesNotContain(friendsResume.GetCurrentJobsDisplayHtml()); } } // Candidate Status. if (view.CanAccess(PersonalVisibility.CandidateStatus)) { if (friendsCandidate.Status != CandidateStatus.Unspecified) { AssertPageContains(NetworkerFacade.GetCandidateStatusText(friendsCandidate.Status)); } } else { if (friendsCandidate.Status != CandidateStatus.Unspecified) { AssertPageDoesNotContain(NetworkerFacade.GetCandidateStatusText(friendsCandidate.Status)); } } // Suburb. if (checkAddress) { if (view.CanAccess(PersonalVisibility.Suburb)) { AssertPageContains(friendsFriend.Address.Location.Suburb); AssertPageContains(" " + friendsFriend.Address.Location.Postcode); } else { AssertPageDoesNotContain(friendsFriend.Address.Location.Suburb); AssertPageDoesNotContain(" " + friendsFriend.Address.Location.Postcode); } // CountrySubdivision. if (view.CanAccess(PersonalVisibility.CountrySubdivision)) { AssertPageContains(friendsFriend.Address.Location.CountrySubdivision.ShortName); } else { AssertPageDoesNotContain(friendsFriend.Address.Location.CountrySubdivision.ShortName); } } return(true); } catch (AssertFailedException) { return(false); } }
public void DisplayContact(PersonalView view, Member member, Candidate candidate, Resume resume, string itemSuffix) { // Image. lnkPhoto.NavigateUrl = BuildViewProfileLink(view.Id).ToString(); imgPhoto.ImageUrl = view.GetPhotoUrlOrDefault().ToString(); // Full Name. lnkFullName.NavigateUrl = BuildViewProfileLink(view.Id).ToString(); lnkFullName.Text = AlwaysDisplayNames ? HtmlUtil.TextToHtml(((ICommunicationRecipient)view).FullName) : HtmlUtil.TextToHtml(view.GetFullNameDisplayText()); // Representative. switch (view.EffectiveContactDegree) { case PersonalContactDegree.Representative: phRepresentative.Visible = true; lblRepresentative.Text = view.EffectiveContactDegree.GetRepresentativeDescriptionText(); break; case PersonalContactDegree.Representee: phRepresentative.Visible = true; lblRepresentative.Text = view.EffectiveContactDegree.GetRepresentativeDescriptionText(); break; default: phRepresentative.Visible = false; break; } // Current Title. var currentJobsText = resume == null ? null : resume.GetCurrentJobsDisplayHtml(); if (string.IsNullOrEmpty(currentJobsText)) { phCurrentJobs.Visible = false; } else { lblCurrentJobsCaption.Text = GetCurrentJobsCaption(resume); ltlCurrentJobs.Text = currentJobsText; SetPlaceHolderVisibility(phCurrentJobs, view, PersonalVisibility.CurrentJobs); } // Candidate Status. if (candidate.Status == CandidateStatus.Unspecified) { phCandidateStatus.Visible = false; } else { ltlCandidateStatus.Text = NetworkerFacade.GetCandidateStatusText(candidate.Status); SetPlaceHolderVisibility(phCandidateStatus, view, PersonalVisibility.CandidateStatus); } // Location. var locationText = GetDisplayText(member.Address.Location, view); if (string.IsNullOrEmpty(locationText)) { phLocation.Visible = false; } else { ltlLocation.Text = locationText; phLocation.Visible = true; } // Full Profile. lnkFullProfile.NavigateUrl = BuildViewProfileLink(view.Id).ToString(); // Send Message. if (LoggedInUserId == view.Id) { phThisIsYou.Visible = true; } // View Friends. lnkViewFriends.NavigateUrl = BuildViewFriendsLink(view.Id).ToString(); SetPlaceHolderVisibility(phViewFriends, view, PersonalVisibility.FriendsList); if (!CanAccessFriends) { phViewFriends.Visible = false; } // Add To Friends. lnkAddToFriends.NavigateUrl = "javascript:populateOverlayPopup('" + GetUrlForPage <InvitationPopupContents>() + "', '" + InvitationPopupContents.InviteeIdParameter + "=" + view.Id + "');"; phAddToFriends.Visible = (view.ActualContactDegree != PersonalContactDegree.Self && view.ActualContactDegree != PersonalContactDegree.FirstDegree && view.CanAccess(PersonalVisibility.SendInvites)); if (!CanAddToFriends) { phAddToFriends.Visible = false; } // Extra details, if any. PopulateDynamicControls(phExtraDescription, view, itemSuffix); PopulateDynamicControls(phExtraActions, view, itemSuffix); }