示例#1
0
        private List <EntityDTO> GetRelatedSubProcess(EntityDTO dto)
        {
            QuickLinksData   quicklinksData    = new QuickLinksData();
            List <EntityDTO> relatedSubProcess = quicklinksData.GetAllRelatedSubProcess(dto.ID);

            relatedSubProcess.Sort((entity1, entity2) => string.Compare(entity1.Name, entity2.Name, true));

            return(relatedSubProcess);
        }
        private string BuildQuickLinks(EntityDTO dto)
        {
            StringBuilder    html              = new StringBuilder();
            QuickLinksData   quicklinksData    = new QuickLinksData();
            List <EntityDTO> relatedProcess    = quicklinksData.GetAllRelatedProcess(dto.ID);
            List <EntityDTO> relatedSubProcess = quicklinksData.GetAllRelatedSubProcess(dto.ID);

            relatedSubProcess.Sort((entity1, entity2) => string.Compare(entity1.Name, entity2.Name, true));
            relatedProcess.Sort((entity1, entity2) => string.Compare(entity1.Name, entity2.Name, true));

            Dictionary <string, List <EntityDTO> > mainList = new Dictionary <string, List <EntityDTO> >();

            mainList.Add(GlobalStringResource.Process, relatedProcess);
            mainList.Add(GlobalStringResource.SubProcess, relatedSubProcess);


            html.Append("<div id=\"diagram-line-right\">");
            html.Append("<table border=\"0\" cellspacing=\"0\"><tr>");
            int ctr = 0;

            foreach (var pair in mainList)
            {
                html.Append("<td>");
                ctr++;
                html.Append(string.Format("<ul id=\"menu{0}\">", ctr));

                html.AppendFormat("<li><a>{0}</a>", pair.Key);
                html.Append("<ul>");
                foreach (EntityDTO innerList in pair.Value)
                {
                    html.AppendFormat("<li><a href=\"Default.aspx?id={0}\">{1}</a></li>", innerList.ID, innerList.Name);
                }
                html.Append("</ul>");
                html.Append("</li>");

                html.Append("</ul>");
                html.Append("</td>");
            }

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

            return(html.ToString());
        }