public override List<PdfContentParameter> BuildContent(ADB.SA.Reports.Entities.DTO.EntityDTO dto)
 {
     this.dto = dto;
     List<PdfContentParameter> contents = new List<PdfContentParameter>();
     contents.Add(CreateTitlePage(this.dto));
     return contents;
 }
 public override List<PdfContentParameter> BuildContent(EntityDTO dto)
 {
     dto.ExtractProperties();
     this.dto = dto;
     List<PdfContentParameter> contents = new List<PdfContentParameter>();
     contents.Add(base.CreateTitlePage(this.dto));
     contents.Add(base.CreateChangeHistory(this.dto));
     contents.Add(base.CreateReviewers(this.dto));
     contents.Add(base.CreateApprovers(this.dto));
     contents.Add(CreateTitle(GlobalStringResource.Report_Introduction));
     contents.Add(CreatePurpose());
     contents.Add(CreateProcessObjective());
     contents.Add(CreateStrategy());
     contents.Add(CreateStakeHolders());
     contents.Add(CreateProcessDescription());
     contents.Add(CreateProcessRelation());
     contents.Add(CreateSubProcessRelation());
     contents.Add(CreateTitle(GlobalStringResource.Report_References));
     contents.Add(CreateFrameworkReference());
     contents.Add(CreateInternalReference());
     contents.Add(CreateTitle(GlobalStringResource.Report_Appendices));
     contents.Add(CreateAcronyms());
     contents.Add(CreateDefintionOfTerms());
     contents.Add(CreateBookmarks());
     return contents;
 }
 public override object BuildDetail(EntityDTO dto)
 {
     GenericDetailDTO detail = new GenericDetailDTO();
     detail.Description = BuildDescription(dto);
     detail.ReferencedDocuments = BuildReferencedDocuments(dto);
     return detail;
 }
 public override object BuildDetail(EntityDTO dto)
 {
     ReviewerApproverPositionDetailDTO detail = new ReviewerApproverPositionDetailDTO();
     detail.AssignedTo = dto.RenderHTML(GlobalStringResource.Assignedto, RenderOption.Break);
     detail.Description = BuildDescription(dto);
     detail.ReferencedDocuments = BuildReferencedDocuments(dto);
     return detail;
 }
 private static DetailStrategyBase ResolveBpmnDetailStrategy(EntityDTO dto)
 {
     if (SAWebContext.Request["ctl"] != null && SAWebContext.Request["ctl"] == "true")
     {
         return new BpmnDetailCTLStrategy();
     }
     return new BpmnDetailStrategy();
 }
Exemple #6
0
        public override object BuildDetail(ADB.SA.Reports.Entities.DTO.EntityDTO dto)
        {
            GenericDetailDTO detail = new GenericDetailDTO();

            detail.Description         = BuildDescription(dto);
            detail.ReferencedDocuments = BuildReferencedDocuments(dto);
            return(detail);
        }
        public override List <PdfContentParameter> BuildContent(ADB.SA.Reports.Entities.DTO.EntityDTO dto)
        {
            this.dto = dto;
            List <PdfContentParameter> contents = new List <PdfContentParameter>();

            contents.Add(CreateTitlePage(this.dto));
            return(contents);
        }
 public override object BuildDetail(EntityDTO dto)
 {
     SectionNameDetailDTO detail = new SectionNameDetailDTO();
     detail.SectionReference = dto.RenderHTMLAsAnchor(GlobalStringResource.SectionReference, RenderOption.Break);
     detail.Description = BuildDescription(dto);
     detail.ReferencedDocuments = BuildReferencedDocuments(dto);
     return detail;
 }
 public override object BuildDetail(EntityDTO dto)
 {
     PersonDetailDTO detail = new PersonDetailDTO();
     detail.Title = dto.Name;
     detail.Email = dto.RenderHTML(GlobalStringResource.Email, RenderOption.Break);
     detail.Contact = dto.RenderHTML(GlobalStringResource.Contact, RenderOption.Break);
     return detail;
 }
        public override string BuildContent(EntityDTO dto)
        {
            StringBuilder html = new StringBuilder();

            //html.Append(Resources.BreakTag);
            //html.Append(BuildTitle(dto.Name));
            //html.Append(Resources.Split);
            //html.Append(base.BuildRefresh(dto.ID));
            //html.Append(base.BuildDiagramImage(dto));

            //

            List<KeyValuePair<string, string>> contents = new List<KeyValuePair<string, string>>();

            contents.Add(new KeyValuePair<string, string>("Diagram", BuildDiagramImage(dto)));
            contents.Add(new KeyValuePair<string, string>("Process", BuildParentProcessDescription(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Sub-Process Desc.", BuildDiagramDescription(dto)));
            contents.Add(new KeyValuePair<string, string>("Roles and Resp.", base.BuildRolesAndResponsibilities(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Sub-Process Dependencies", BuildSubProcessRelation(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Activity Overview", BuildActivityOverview(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Module Relationship", BuildModuleRelationship(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Business Rule Mapping", BuildBusinessMapping(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Reviewers and Approvers", BuildReviewersAndApprovers(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Change History", base.BuildChangeHistory(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Comments", BuildCommentsSection(dto)));

            html.Append("<div id=\"tabs\">");
            html.Append("<ul>");
            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    string linkId = contents[i].Key.ToLower().Replace(" ", string.Empty).Replace(".","").Replace("/","");
                    html.AppendFormat("<li><a href=\"#tabs-{0}\" id=\"{1}\">{2}</a></li>", i + 1, linkId,contents[i].Key);
                }
            }
            html.Append("</ul>");

            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<div class=\"content-holder\" id=\"tabs-{0}\">{1}</div>", i + 1, contents[i].Value);
                }
            }

            html.Append("</div>");

            //html.Append(base.BuildRolesAndResponsibilities(dto.ID));

            html.Append(base.BuildReportHiddenField(dto.ID));

            html.Append("<div id=\"dialog-modal\"></div>");

            return html.ToString();

            //
        }
 public override object BuildDetail(EntityDTO dto)
 {
     AcronymDetailDTO detail = new AcronymDetailDTO();
     detail.Title = dto.Name;
     detail.AbbreviationDescription = dto.RenderHTML(GlobalStringResource.AbbreviationDescription, RenderOption.Break);
     detail.Description = BuildDescription(dto);
     detail.ReferencedDocuments = BuildReferencedDocuments(dto);
     return detail;
 }
 private bool IsSucceeding(EntityDTO dto)
 {
     dto.ExtractProperties();
     string e_type = dto.RenderHTML(GlobalStringResource.EventType, ADB.SA.Reports.Entities.Enums.RenderOption.None);
     if (e_type.ToLower().Trim() == "succeeding")
     {
         return true;
     }
     return false;
 }
 public WmfImageManager(EntityDTO dto, byte[] data, string fileName,
     int type, int poolCount, bool isReport)
 {
     this.dto = dto;
     this.data = data;
     this.fileName = fileName;
     this.type = type;
     this.poolCount = poolCount;
     this.isReport = isReport;
 }
 public override object BuildContent(EntityDTO dto)
 {
     GenericContentDTO content = new GenericContentDTO();
     content.Diagram = new DiagramContent(){
         DiagramPath = BuildDiagramContent(dto)
     };
     content.DiagramDescription = DiagramDescription(dto);
     content.CurrentID = dto.ID;
     content.ShowResize = ShowResize();
     return content;
 }
        protected override string BuildDiagramDescription(EntityDTO dto)
        {
            dto.ExtractProperties();
            string description = dto.RenderHTML("Description", ADB.SA.Reports.Entities.Enums.RenderOption.Break);
            if (string.IsNullOrEmpty(description))
            {
                description = "There is no description for this diagram.";
            }

            return description;
        }
        public override object BuildDetail(EntityDTO dto)
        {
            RoleDetailDTO detail = new RoleDetailDTO();
            EntityData data = new EntityData();
            EntityDTO description = data.GetRoleDetail(dto.ID);
            description.ExtractProperties();

            detail.Responsibilities = description.RenderHTML(GlobalStringResource.Responsibilities, RenderOption.Break);
            detail.Description = BuildDescription(dto);
            detail.ReferencedDocuments = BuildReferencedDocuments(dto);
            return detail;
        }
        public override string BuildContent(EntityDTO dto)
        {
            StringBuilder html = new StringBuilder();

            //html.Append(base.BuildTitle(dto.Name));
            //html.Append(Resources.Split);
            //html.Append(base.BuildRefresh(dto.ID));
            //html.Append(base.BuildDiagramImage(dto));

            List<KeyValuePair<string, string>> contents = new List<KeyValuePair<string, string>>();

            contents.Add(new KeyValuePair<string, string>("Diagram", BuildDiagramImage(dto)));
            contents.Add(new KeyValuePair<string, string>("Process Desc.", BuildDiagramDescription(dto)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.ProcessRelation, BuildProcessRelation(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.SubProcessRelation, BuildSubProcessRelation(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Business Rule Mapping", BuildBusinessMapping(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.Acronyms, BuildAcronyms(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.ReviewersAndApprovers, BuildReviewersAndApprovers(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.ChangeHistory, base.BuildChangeHistory(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.ApplicationRelationship, BuildApplicationRelationship(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.FrameworkRef, BuildFrameworkReference(dto.ID)));
            contents.Add(new KeyValuePair<string, string>(GlobalStringResource.InternalRef, BuildInternalReference(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Comments", BuildCommentsSection(dto)));

            html.Append("<div id=\"tabs\">");
            html.Append("<ul>");
            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<li><a href=\"#tabs-{0}\">{1}</a></li>", i + 1, contents[i].Key);
                }
            }
            html.Append("</ul>");

            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<div class=\"content-holder\" id=\"tabs-{0}\">{1}</div>", i + 1, contents[i].Value);
                }
            }

            html.Append("</div>");

            //html.Append(base.BuildRolesAndResponsibilities(dto.ID));

            html.Append(base.BuildReportHiddenField(dto.ID));

            html.Append("<div id=\"dialog-modal\"></div>");

            return html.ToString();
        }
 public string BuildDiagramContent(EntityDTO dto)
 {
     EntityData data = new EntityData();
     FileData files = new FileData();
     FileDTO file = files.GetFile(dto.DGXFileName);
     byte[] imageBytes = file.Data;
     string path = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);
     int poolCount = data.GetPoolCount(dto.ID);
     WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
         path, dto.Type, poolCount, false);
     path = imageManager.ProcessImage();
     return path.Replace(@"\", @"/");
 }
        public override object BuildDetail(ADB.SA.Reports.Entities.DTO.EntityDTO dto)
        {
            BpmnDetailCTLDTO detail = new BpmnDetailCTLDTO();
            List <EntityDTO> relatedCtlSubProcess = entityData.GetCtlSubProcess(dto.ID);

            if (relatedCtlSubProcess.Count > 0)
            {
                foreach (var ctl in relatedCtlSubProcess)
                {
                    detail.RelatedSubProcess.Add(ctl.Name);
                }
            }

            detail.User                    = dto.RenderHTML(GlobalStringResource.User, RenderOption.Break);
            detail.ActivityNature          = dto.RenderHTML(GlobalStringResource.ActivityNature, RenderOption.Break);
            detail.TriggerInput            = dto.RenderHTML(GlobalStringResource.TriggerInput, RenderOption.Break);
            detail.Output                  = dto.RenderHTML(GlobalStringResource.Output, RenderOption.Break);
            detail.ActivityStepDescription = dto.RenderHTML(GlobalStringResource.ActivityStepDescription, RenderOption.Break);
            detail.ActivityNarrative       = dto.RenderHTML(GlobalStringResource.ActivityNarrative,
                                                            RenderOption.Paragraph);

            List <EntityDTO> controTypes = entityData.GetControlTypesCtl(dto.ID);

            detail.ControlDetails = new List <ControlDetailItem>();
            if (controTypes.Count > 0)
            {
                foreach (EntityDTO control in controTypes)
                {
                    ControlDetailItem item = new ControlDetailItem();
                    control.ExtractProperties();
                    item.ControlName        = control.Name;
                    item.ControlDescription = control.RenderHTML("Description", RenderOption.None);
                    item.Completeness       = GetImageTag(control.RenderHTML("Completeness", RenderOption.None));
                    item.Accuracy           = GetImageTag(control.RenderHTML("Accuracy", RenderOption.None));
                    item.Validity           = GetImageTag(control.RenderHTML("Validity", RenderOption.None));
                    item.RestrictedAccess   = GetImageTag(control.RenderHTML("Restricted Access", RenderOption.None));
                    item.ControlType        = control.RenderHTML("Control Type", RenderOption.None);
                    item.ControlKind        = control.RenderHTML("Control Kind", RenderOption.None);
                    item.ControlOwner       = control.RenderHTML("WHO", RenderOption.None);



                    item.ControlDetail = CreateControlDetailsHtml(control);
                    item.RiskDetail    = CreateRiskDetails(control);
                    detail.ControlDetails.Add(item);
                }
            }
            detail.Title = dto.Name;
            return(detail);
        }
        public static object BuildDetail(EntityDTO dto)
        {
            DetailContext context = null;
            switch (dto.Type)
            {
                case 175:
                    context = new DetailContext(new AcronymDetailStrategy());
                    break;
                case 436:
                    context = new DetailContext(new SectionNameDetailStrategy());
                    break;
                case 156:
                    context = new DetailContext(new RoleDetailStrategy());
                    break;
                case 701:
                    context = new DetailContext(new ReviewerApproverPositionDetailStrategy());
                    break;
                case 603:
                    DetailStrategyBase strategy = ResolveBpmnDetailStrategy(dto);
                    context = new DetailContext(strategy);
                    break;
                case 321:
                    context = new DetailContext(new OrganizationUnitDetailStrategy());
                    break;
                case 663:
                    context = new DetailContext(new PersonDetailStrategy());
                    break;
                case 3:
                    context = new DetailContext(new ProcessDetailStrategy());
                    break;
                case 178:
                    context = new DetailContext(new ControlOwnerDetailStrategy());
                    break;
                case 172:
                    context = new DetailContext(new ControlObjectiveDetailStrategy());
                    break;
                case 440:
                    context = new DetailContext(new FrequencyforControlDetailStrategy());
                    break;
                case 441:
                    context = new DetailContext(new ControlApplicationNameDetailStrategy());
                    break;
                default:
                    context = new DetailContext(null);
                    break;
            }

            return context.BuildDetail(dto);
        }
 public override List<PdfContentParameter> BuildContent(EntityDTO dto)
 {
     this.dto = dto;
     List<PdfContentParameter> contents = new List<PdfContentParameter>();
     contents.Add(base.CreateTitlePage(this.dto));
     contents.Add(base.CreateChangeHistory(this.dto));
     contents.Add(base.CreateReviewers(this.dto));
     contents.Add(base.CreateApprovers(this.dto));
     contents.Add(CreateSubProcessObjective());
     contents.Add(CreateRolesAndResponsibility());
     contents.Add(CreateSubProcessDependency());
     contents.Add(CreateSubProcessDiagramTitle());
     contents.Add(CreateActivityOverviewHeader());
     contents.AddRange(CreateActivityOverview());
     return contents;
 }
        public override string BuildContent(EntityDTO dto)
        {
            StringBuilder html = new StringBuilder();
            //html.Append(base.BuildTitle(dto.Name));
            //html.Append(Resources.Split);

            List<KeyValuePair<string, string>> contents = new List<KeyValuePair<string, string>>();

            contents.Add(new KeyValuePair<string, string>("Diagram", BuildDiagramImage(dto)));
            contents.Add(new KeyValuePair<string, string>("Diagram Desc.", BuildDiagramDescription(dto)));
            contents.Add(new KeyValuePair<string, string>("Challenges", BuildChallenges(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Strategic Agenda", BuildStrategicAgenda(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Drivers of Change", BuilddriversOfChange(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Developing Partner Countries", BuildDevelopingPartnerCountries(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Core Operation Area", BuildCoreAreasOfOperations(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Other Operation Area", BuildOtherAreasOfOperations(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Corporate Values", BuildCorporateValues(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Operational Goals", BuildOperationalGoals(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Institutional Goals", BuildInstitutionalGoals(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Result Framework Level", BuildResultFrameworkLevel(dto.ID)));
            contents.Add(new KeyValuePair<string, string>("Comments", BuildCommentsSection(dto)));

            html.Append("<div id=\"tabs\">");
            html.Append("<ul>");
            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<li><a href=\"#tabs-{0}\">{1}</a></li>", i + 1, contents[i].Key);
                }
            }
            html.Append("</ul>");

            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<div class=\"content-holder\" id=\"tabs-{0}\">{1}</div>", i + 1, contents[i].Value);
                }
            }

            html.Append("</div>");

            html.Append(base.BuildReportHiddenField(dto.ID));

            return html.ToString();
        }
        public static List<PdfContentParameter> BuildReport(EntityDTO dto)
        {
            ReportContext context = null;
            switch (dto.Type)
            {
                case 111:
                    context = new ReportContext(new ProcessReportStrategy());
                    break;
                case 142:
                    context = new ReportContext(new SubProcessReportStrategy());
                    break;
                default:
                    context = new ReportContext(new GenericReportStrategy());
                    break;
            }

            return context.BuildContent(dto);
        }
 public override object BuildContent(EntityDTO dto)
 {
     int id = dto.ID;
     SubProcessContentDTO sp = new SubProcessContentDTO();
     sp.Diagram = new DiagramContent() {
         DiagramPath = BuildDiagramContent(dto)
     };
     sp.ProcessDescription = ParentProcessDescription(id);
     sp.SubProcessDescription = SubProcessDescription(dto);
     sp.RolesAndResponsibilities = RolesAndResponsibilities(id);
     sp.Dependencies = SubProcessDependencies(id);
     sp.ActivityOverviews = ActivityOverview(id);
     sp.ModuleRelationships = ModuleRelationship(id);
     sp.BusinessRuleMappings = BusinessMapping(id);
     sp.ChangeHistories = ChangeHistory(id);
     sp.CurrentID = id;
     sp.ShowResize = ShowResize();
     return sp;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        protected virtual string BuildDiagramImage(EntityDTO dto)
        {
            StringBuilder html = new StringBuilder();
            EntityData data = new EntityData();
            FileData files = new FileData();

            FileDTO file = files.GetFile(dto.DGXFileName);
            byte[] imageBytes = file.Data;

            string path = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);

            int poolCount = data.GetPoolCount(dto.ID);
            WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
                path, dto.Type, poolCount, false);
            path = imageManager.ProcessImage();

            html.AppendFormat(GlobalStringResource.Presenter_BuildDiagramImage_Tag, path.Replace(@"\", @"/"));
            html.Append(GlobalStringResource.BreakTag);
            return html.ToString();
        }
 ////public override object BuildContent(EntityDTO entity) 
 ////{
 //    int id = entity.ID;
 //    ProcessContentDTO process = new ProcessContentDTO();
 //    process.Diagram = new DiagramContent() {
 //        DiagramPath = BuildDiagramContent(entity),
 //        RelatedProcess = GetRelatedProcess(entity),
 //        RelatedSubProcess = GetRelatedSubProcess(entity)
 //    };
 //    process.Description = ProcessDescription(entity);
 //    process.ProcessRelations = ProcessRelation(id);
 //    process.SubProcessRelations = SubProcessRelation(id);
 //    process.BusinessRuleMappings = BusinessMapping(id);
 //    process.Acronyms = Acronyms(id);
 //    process.Applications = ApplicationRelationship(id);
 //    process.Frameworks = FrameworkReference(id);
 //    process.InternalReferences = InternalReference(id);
 //    return process;
 ////}
 public override object BuildContent(EntityDTO entity)
 {
     int id = entity.ID;
     ProcessContentDTO process = new ProcessContentDTO();
     process.Diagram = new DiagramContent() {
         DiagramPath = BuildDiagramContent(entity),
         RelatedProcess = GetRelatedProcess(entity),
         RelatedSubProcess = GetRelatedSubProcess(entity)
     };
     process.Description = ProcessDescription(entity);
     process.ProcessRelations = ProcessRelation(id);
     process.SubProcessRelations = SubProcessRelation(id);
     process.BusinessRuleMappings = BusinessMapping(id);
     process.Acronyms = Acronyms(id);
     process.Applications = ApplicationRelationship(id);
     process.Frameworks = FrameworkReference(id);
     process.InternalReferences = InternalReference(id);
     process.CurrentID = id;
     process.ShowResize = ShowResize();
     return process;
 }
 public override object BuildContent(EntityDTO dto)
 {
     Strategy2020ContentDTO st2020 = new Strategy2020ContentDTO();
     int id = dto.ID;
     st2020.Diagram = new DiagramContent() {
         DiagramPath = base.BuildDiagramContent(dto)
     };
     st2020.DiagramDescription = DiagramDescription(dto);
     st2020.Challenges = Challenges(id);
     st2020.StrategicAgendas = StrategicAgenda(id);
     st2020.DriversOfChange = DriversOfChange(id);
     st2020.DevelopingPartners = DevelopingPartnerCountries(id);
     st2020.CoreAreas = CoreAreasOfOperations(id);
     st2020.OtherAreas = OtherAreasOfOperations(id);
     st2020.CorporateValues = CorporateValues(id);
     st2020.OperationalGoals = OperationalGoals(id);
     st2020.InstitutionalGoals = InstitutionalGoals(id);
     st2020.ResultFrameworks = ResultFrameworkLevel(id);
     st2020.CurrentID = id;
     st2020.ShowResize = ShowResize();
     return st2020;
 }
        public override string BuildContent(EntityDTO dto)
        {
            StringBuilder html = new StringBuilder();
            //html.Append(base.BuildTitle(dto.Name));
            //html.Append(Resources.Split);

            List<KeyValuePair<string, string>> contents = new List<KeyValuePair<string, string>>();

            contents.Add(new KeyValuePair<string, string>("Diagram", BuildDiagramImage(dto)));
            contents.Add(new KeyValuePair<string, string>("Diagram Desc.", BuildDiagramDescription(dto)));
            contents.Add(new KeyValuePair<string, string>("Comments", BuildCommentsSection(dto)));

            html.Append("<div id=\"tabs\">");
            html.Append("<ul>");
            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<li><a href=\"#tabs-{0}\">{1}</a></li>", i + 1, contents[i].Key);
                }
            }
            html.Append("</ul>");

            for (int i = 0; i < contents.Count; i++)
            {
                if (!string.IsNullOrEmpty(contents[i].Value))
                {
                    html.AppendFormat("<div class=\"content-holder\" id=\"tabs-{0}\">{1}</div>", i + 1, contents[i].Value);
                }
            }

            html.Append("</div>");

            html.Append(base.BuildReportHiddenField(dto.ID));

            return html.ToString();
        }
 public static List<BreadCrumbItemDTO> BuildBreadcrumbContent(EntityDTO currentDTO)
 {
     data = new EntityData();
     BreadCrumbItemDTO home = new BreadCrumbItemDTO() {
         Order = 0,
         Label = "Home",
         Link = "Default.aspx",
     };
     List<BreadCrumbItemDTO> breadcrumbs = new List<BreadCrumbItemDTO>();
     breadcrumbs.Add(home);
     if (currentDTO != null)
     {
         switch (currentDTO.Type)
         {
             //Don't show any Breadcrumb on the home page
             //because it doesn't make any sense
             case 104:
                 return breadcrumbs;
             case 142:
                 //if the entity has parent, find it then put it before the selected entity
                 breadcrumbs = CreateBreadcrumbWithSecondLevel(currentDTO, breadcrumbs);
                 break;
             default:
                 //Home > current selected
                 BreadCrumbItemDTO defaultItem = new BreadCrumbItemDTO()
                 {
                     Order = 1,
                     Label = currentDTO.Name,
                     CssClass = "breadcrumb-active",
                 };
                 breadcrumbs.Add(defaultItem);
                 break;
         }
     }
     return breadcrumbs.OrderBy(c => c.Order).ToList();
 }
        private static List<BreadCrumbItemDTO> CreateBreadcrumbWithSecondLevel(EntityDTO currentDTO, List<BreadCrumbItemDTO> currentList)
        {
            EntityDTO parent = data.GetParentDiagram(currentDTO.ID);
            if (parent != null)
            {
                //builder.AppendFormat("<a href=\"Default.aspx?id={0}\">{1}</a>", parent.ID, parent.Name);
                //builder.Append(" > ");
                BreadCrumbItemDTO p = new BreadCrumbItemDTO() {
                    Order = 1,
                    Link = string.Format("Default.aspx?id={0}", parent.ID),
                    Label = parent.Name,
                };
                currentList.Add(p);
            }

            BreadCrumbItemDTO final = new BreadCrumbItemDTO()
            {
                Order = 2,
                Label = currentDTO.Name,
                CssClass = "breadcrumb-active",
            };
            currentList.Add(final);
            return currentList;
        }
 public static object BuildContent(EntityDTO dto)
 {
     MainContentContext context = null;
     switch (dto.Type)
     {
         case 111:
             context = new MainContentContext(new ProcessStrategy2());
             break;
         case 142:
             context = new MainContentContext(new SubProcessContentStrategy2());
             break;
         ////case 79:
         ////    context = new ContentContext(new SystemArchitectureContentStrategy());
         ////    break;
         case 145:
             context = new MainContentContext(new Strategy2020ContentStrategy2());
             break;
         default:
             context = new MainContentContext(new GenericContentStrategy2());
             break;
     }
     
     return context.BuildContent(dto);
 }
        private RiskDetailDTO CreateRiskDetails(EntityDTO control)
        {
            RiskDetailDTO detail = new RiskDetailDTO();

            EntityDTO relatedRisk = entityData.GetControlRelatedRisk(control.ID);
            if (relatedRisk != null)
            {
                relatedRisk.ExtractProperties();

                //Consequence
                detail.Consequence = relatedRisk.RenderHTML("Consequence", RenderOption.Break);

                //Completeness
                detail.Completeness = relatedRisk.RenderHTML("Completeness", RenderOption.Break);

                //Existence/Occurrence
                detail.ExistenceOccurrence = relatedRisk.RenderHTML("Existence/Occurrence", RenderOption.Break);

                //Valuation or Allocation
                detail.ValuationOrAllocation = relatedRisk.RenderHTML("Valuation or Allocation", RenderOption.Break);

                //Rights and Obligations
                detail.RightsAndObligations = relatedRisk.RenderHTML("Rights and Obligations", RenderOption.Break);

                //Presentation and Disclosure
                detail.PresentationAndDisclosure = relatedRisk.RenderHTML("Presentation and Disclosure", RenderOption.Break);

                //Description
                detail.Description = relatedRisk.RenderHTML("Description", RenderOption.Break);

                //Reference Documents
                detail.ReferencedDocuments = relatedRisk.RenderHTML("Reference Documents", RenderOption.Break);
            }
            return detail;
        }
        private ControlDetailDTO CreateControlDetailsHtml(EntityDTO control)
        {
            ControlDetailDTO detail = new ControlDetailDTO();

            //Mitigates Risk
            detail.MitigatesRisk = control.RenderHTML("Mitigates Risk", RenderOption.None);

            //Evidence
            detail.Evidence = control.RenderHTML("Evidence", RenderOption.Break);

            //Business Unit
            List<BpmnDetailHoverDTO> relatedBusinessUnit = ConvertToHoverDTO(entityData.GetRelatedBusinessUnit(control.ID));
            //string rbuhtml = RenderControlRelatedProperties(relatedBusinessUnit);
            detail.BusinessUnit = relatedBusinessUnit;

            //WHO - (control owner)
            List<BpmnDetailHoverDTO> relatedControlOwners = ConvertToHoverDTO(entityData.GetRelatedControlOwner(control.ID));
            //string rcoHtml = RenderControlRelatedProperties(relatedControlOwners);
            detail.ControlOwner = relatedControlOwners;

            //Control Objectives
            List<BpmnDetailHoverDTO> relatedControlObj = ConvertToHoverDTO(entityData.GetRelatedControlObjectives(control.ID));
            detail.ControlObjectives = relatedControlObj;

            //Frequency
            List<BpmnDetailHoverDTO> relatedFrequency = ConvertToHoverDTO(entityData.GetRelatedFrequency(control.ID));
            detail.Frequency = relatedFrequency;

            //Application Name
            List<BpmnDetailHoverDTO> relatedApplications = ConvertToHoverDTO(entityData.GetRelatedControlApplications(control.ID));
            detail.ApplicationName = relatedApplications;

            //Control Category
            detail.ControlCategory = control.RenderHTML("Control Category", RenderOption.Break);

            //Corrective
            detail.Corrective = control.RenderHTML("Corrective", RenderOption.Break);

            //Reference Documents
            detail.ReferenceDocuments = control.RenderHTML("Reference Documents", RenderOption.Break);

            return detail;
        }