Created
July 11, 2019 02:10
-
-
Save dnstommy/112f6e794e64b85957dfa83259157dd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Sitecore.Foundation.MembershipXdb.Experience.Tabs | |
{ | |
using System; | |
using EPExpressTab.Data; | |
using EPExpressTab.Repositories; | |
using Sitecore.XConnect.Collection.Model; | |
//TODO Sitecore9 | |
public class MemberView : EpExpressViewModel | |
{ | |
public override string Heading => "Client"; | |
public override string TabLabel => "Membership"; | |
public override object GetModel(Guid contactId) | |
{ | |
var contact = EPRepository.GetContact(contactId, MembershipFacet.DefaultFacetKey, PersonalInformation.DefaultFacetKey); | |
var memberData = contact.GetFacet<MembershipFacet>(MembershipFacet.DefaultFacetKey); | |
var personalInfo = contact.GetFacet<PersonalInformation>(PersonalInformation.DefaultFacetKey); | |
return new MemberInfoModel | |
{ | |
ContactId = contact.Id.ToString(), | |
VisitCount = 4, | |
MemberDataIsNull = memberData == null, | |
PersonalInfoIsNull = personalInfo == null, | |
MemberData = memberData, | |
PersonalInfo = personalInfo | |
}; | |
} | |
public override string GetFullViewPath(object model) | |
{ | |
return "/views/MembershipXdb/MemberInfo.cshtml"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment