Beispiel #1
0
        internal static LookupTemplate ConvertTemplate(ViewTemplate template)
        {
            LookupTemplate lookupTemplate = new LookupTemplate()
            {
                Id     = template.Id,
                Oid    = template.Oid,
                Title  = template.Name,
                IsOpen = template.IsOpen,
                ImplementationGuide = template.OwningImplementationGuideTitle,
                IgType               = template.ImplementationGuideTypeName,
                TemplateType         = template.TemplateTypeName,
                TemplateTypeDisplay  = template.TemplateTypeDisplay,
                Organization         = template.OrganizationName,
                PublishDate          = template.PublishDate,
                ImpliedTemplateOid   = template.ImpliedTemplateOid,
                ImpliedTemplateTitle = template.ImpliedTemplateTitle,
                ConstraintCount      = template.ConstraintCount != null ? (int)template.ConstraintCount.Value : 0,
                ContainedByCount     = template.ContainedTemplateCount != null ? (int)template.ContainedTemplateCount.Value : 0,
                ImpliedByCount       = template.ImpliedTemplateCount != null ? (int)template.ImpliedTemplateCount.Value : 0
            };

            return(lookupTemplate);
        }
Beispiel #2
0
        public static LookupTemplate ConvertTemplate(Template template)
        {
            LookupTemplate lookupTemplate = new LookupTemplate()
            {
                Id     = template.Id,
                Oid    = template.Oid,
                Title  = template.Name,
                IsOpen = template.IsOpen,
                ImplementationGuide = template.OwningImplementationGuide != null ? template.OwningImplementationGuide.Name : string.Empty,
                IgType               = template.ImplementationGuideType.Name,
                TemplateType         = template.TemplateType.Name,
                TemplateTypeDisplay  = template.TemplateType.Name + " (" + template.ImplementationGuideType.Name + ")",
                Organization         = template.OwningImplementationGuide != null && template.OwningImplementationGuide.Organization != null ? template.OwningImplementationGuide.Organization.Name : string.Empty,
                PublishDate          = template.OwningImplementationGuide != null ? template.OwningImplementationGuide.PublishDate : null,
                ImpliedTemplateOid   = template.ImpliedTemplate != null ? template.ImpliedTemplate.Oid : null,
                ImpliedTemplateTitle = template.ImpliedTemplate != null ? template.ImpliedTemplate.Name : null,
                ConstraintCount      = template.ChildConstraints.Count,
                ContainedByCount     = template.ContainingConstraints.Count,
                ImpliedByCount       = template.ImplyingTemplates.Count
            };

            return(lookupTemplate);
        }