Ejemplo n.º 1
0
        private List <ProcessRelationItem> ProcessRelation(int id)
        {
            List <ProcessRelationItem> items          = new List <ProcessRelationItem>();
            List <EntityDTO>           relatedProcess = entityData.GetRelatedProcess(id);

            if (relatedProcess.Count > 0)
            {
                foreach (EntityDTO related in relatedProcess)
                {
                    ProcessRelationItem p = new ProcessRelationItem();
                    related.ExtractProperties();

                    EntityDTO actual = entityData.GetActualRelatedProcess(related.ID);
                    if (actual != null)
                    {
                        actual.ExtractProperties();

                        /*
                         * gets the actual diagram
                         * displays plain text if the diagram does not exist
                         */
                        EntityDTO diag = entityData.GetOneEntityByReferenceNumberAndClass(related.RenderHTML(
                                                                                              GlobalStringResource.ReferenceNumber, RenderOption.None), 1);
                        if (diag != null)
                        {
                            p.ReferenceNumber = diag.RenderAsLink(related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None), diag.ID, RenderOption.None);
                        }
                        else
                        {
                            p.ReferenceNumber = related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None);
                        }
                    }
                    else
                    {
                        //Display plain text
                        p.ReferenceNumber = related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None);
                    }
                    p.Name         = related.RenderHTML(GlobalStringResource.Process, RenderOption.None);
                    p.Relationship = related.RenderHTML(GlobalStringResource.Relationship, RenderOption.None);
                    items.Add(p);
                }
            }
            return(items);
        }
        private List<ProcessRelationItem> ProcessRelation(int id)
        {
            List<ProcessRelationItem> items = new List<ProcessRelationItem>();
            List<EntityDTO> relatedProcess = entityData.GetRelatedProcess(id);
            if (relatedProcess.Count > 0)
            {
                foreach (EntityDTO related in relatedProcess)
                {
                    ProcessRelationItem p = new ProcessRelationItem();
                    related.ExtractProperties();

                    EntityDTO actual = entityData.GetActualRelatedProcess(related.ID);
                    if (actual != null)
                    {
                        actual.ExtractProperties();

                        /*
                         * gets the actual diagram
                         * displays plain text if the diagram does not exist
                         */
                        EntityDTO diag = entityData.GetOneEntityByReferenceNumberAndClass(related.RenderHTML(
                            GlobalStringResource.ReferenceNumber, RenderOption.None), 1);
                        if (diag != null)
                        {
                            p.ReferenceNumber = diag.RenderAsLink(related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None), diag.ID, RenderOption.None);
                        }
                        else
                        {
                            p.ReferenceNumber = related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None);
                        }
                    }
                    else
                    {
                        //Display plain text
                        p.ReferenceNumber = related.RenderHTML(GlobalStringResource.ReferenceNumber, RenderOption.None);
                    }
                    p.Name = related.RenderHTML(GlobalStringResource.Process, RenderOption.None);
                    p.Relationship = related.RenderHTML(GlobalStringResource.Relationship, RenderOption.None);
                    items.Add(p);
                }
            }
            return items;
        }