Example #1
0
        private string GetAssociationMetaData(EntryContentBase currentContent)
        {
            // not good, find a better way than do this twice
            IEnumerable <EPiServer.Commerce.Catalog.Linking.Association> assoc = currentContent.GetAssociations();
            StringBuilder strB = new StringBuilder();

            if (assoc.Count() >= 1)
            {
                // Fix code and formatting, but it works
                EPiServer.Commerce.Catalog.Linking.Association a = assoc.FirstOrDefault(); // get the only one .. so far for test
                strB.Append("GroupName: " + a.Group.Name);
                strB.Append(" - ");
                strB.Append("GroupDescription: " + a.Group.Description); // doesn't show - investigate
                strB.Append(" - ");
                strB.Append("GroupSort: " + a.Group.SortOrder);
                strB.Append(" - ");
                strB.Append("TypeId: " + a.Type.Id); // where the filter could be applied
                strB.Append(" - ");
                strB.Append("TypeDescr: " + a.Type.Description);
                // there is more to get out
                ContentReference theRef = a.Target;
                strB.Append("...in TrousersController");
            }
            else
            {
                strB.Append("Nothing");
            }

            return(strB.ToString());
        }
Example #2
0
        private string GetAssociationMetaDataSingle(EPiServer.Commerce.Catalog.Linking.Association assoc)
        {
            // pops in "foreach"
            StringBuilder strB = new StringBuilder();

            strB.Append("Group-Name: " + assoc.Group.Name);
            strB.Append(" ");
            strB.Append("Group-Description: " + assoc.Group.Description);
            strB.Append(" ");
            strB.Append("Group-Sort: " + assoc.Group.SortOrder);
            strB.Append(" ");
            strB.Append("Type-Id: " + assoc.Type.Id); // where the filter could be applied
            strB.Append("Type-Descr: " + assoc.Type.Description);
            // there is more to get out

            return(strB.ToString());
        }
 private ContentReference GetAssociatedEntry(EPiServer.Commerce.Catalog.Linking.Association assoc)
 {
     return(assoc.Target);
 }