Exemplo n.º 1
0
        protected List <BusinessRuleMappingSPItem> BusinessMapping(int id)
        {
            List <BusinessRuleMappingSPItem> items = new List <BusinessRuleMappingSPItem>();
            List <EntityDTO> sections = entityData.GetSubProcessBusinessMapping(id);

            if (sections.Count > 0)
            {
                List <string> renderedTitles = new List <string>();
                foreach (EntityDTO section in sections)
                {
                    List <EntityDTO> paragraphs = entityData.GetSubProcessParagraphs(section.ID);
                    if (paragraphs.Count > 0)
                    {
                        BusinessRuleMappingSPItem brm = new BusinessRuleMappingSPItem();
                        section.ExtractProperties();
                        foreach (EntityDTO paragraph in paragraphs)
                        {
                            paragraph.ExtractProperties();

                            if (paragraphs.Count == 1)
                            {
                                brm.Activity.Activity = section.RenderAsPopupLink();
                                brm.Activity.RowSpan  = paragraphs.Count;
                            }
                            else
                            {
                                if (!renderedTitles.Contains(section.Name))
                                {
                                    brm.Activity.Activity = section.RenderAsPopupLink();
                                    brm.Activity.RowSpan  = paragraphs.Count;
                                    renderedTitles.Add(section.Name);
                                }
                            }
                            brm.Activity.Paragraphs.Add(
                                new BusinessRuleMappingParagraph()
                            {
                                ParagraphName      = MappingToolUrlHelper.GenerateValidParagraphLinkMarkup(paragraph.Name),
                                ParagraphReference = paragraph.RenderHTMLAsAnchor(GlobalStringResource.ParagraphReference, RenderOption.Span, false)
                            });
                        }
                        items.Add(brm);
                    }
                }
            }

            return(items);
        }
Exemplo n.º 2
0
        private List <BusinessRuleMappingItem> BusinessMapping(int id)
        {
            List <BusinessRuleMappingItem> items = new List <BusinessRuleMappingItem>();
            List <EntityDTO> sections            = entityData.GetSections(id);

            if (sections.Count > 0)
            {
                foreach (EntityDTO related in sections)
                {
                    BusinessRuleMappingItem br = new BusinessRuleMappingItem();
                    related.ExtractProperties();

                    br.SectionName        = MappingToolUrlHelper.GenerateValidSectionLinkMarkup(related.Name);
                    br.SectionDescription = related.RenderHTML(GlobalStringResource.Description, RenderOption.None).ToUpper();
                    items.Add(br);
                }
            }
            return(items);
        }
        protected override string BuildBusinessMapping(int id)
        {
            string           result   = string.Empty;
            List <EntityDTO> sections = entityData.GetSections(id);

            if (sections.Count > 0)
            {
                HtmlTable t = new HtmlTable(2, 0, "grid", new int[] { 10, 90 });
                //t.AddHeader(GlobalStringResource.BusinessProcessandBusinessRuleMapping, 2);

                t.AddHeader(GlobalStringResource.SectionName);
                t.AddHeader(GlobalStringResource.SectionDescription);

                foreach (EntityDTO related in sections)
                {
                    related.ExtractProperties();

                    t.AddCell(MappingToolUrlHelper.GenerateValidSectionLinkMarkup(related.Name));
                    t.AddCell(related.RenderHTML(GlobalStringResource.Description, RenderOption.None).ToUpper());
                }
                result = t.EndHtmlTable();
            }
            return(result);
        }
        protected override string BuildBusinessMapping(int id)
        {
            int              validCount = 0;
            StringBuilder    html       = new StringBuilder();
            List <EntityDTO> sections   = entityData.GetSubProcessBusinessMapping(id);

            if (sections.Count > 0)
            {
                html.AppendFormat(Resources.TableStartTag, "grid");
                //html.AppendFormat(Resources.TableHeaderTag, 3, GlobalStringResource.BusinessProcessandBusinessRuleMapping);

                html.Append(Resources.TableRowStartTag);
                html.AppendFormat(Resources.TableHeaderTag, 1, GlobalStringResource.Activity);
                html.AppendFormat(Resources.TableHeaderTag, 1, GlobalStringResource.ParagraphName);
                html.AppendFormat(Resources.TableHeaderTag, 1, GlobalStringResource.ParagraphReference);
                html.Append(Resources.TableRowEndTag);

                List <string> renderedTitles = new List <string>();
                foreach (EntityDTO section in sections)
                {
                    List <EntityDTO> paragraphs = entityData.GetSubProcessParagraphs(section.ID);
                    if (paragraphs.Count > 0)
                    {
                        section.ExtractProperties();
                        html.Append(Resources.TableRowStartTag);

                        foreach (EntityDTO paragraph in paragraphs)
                        {
                            paragraph.ExtractProperties();


                            if (paragraphs.Count == 1)
                            {
                                html.AppendFormat(Resources.TableCellWithRowSpan, string.Empty, paragraphs.Count, section.RenderAsPopupLink());
                            }
                            else
                            {
                                if (!renderedTitles.Contains(section.Name))
                                {
                                    html.AppendFormat(Resources.TableCellWithRowSpan, string.Empty, paragraphs.Count, section.RenderAsPopupLink());
                                    renderedTitles.Add(section.Name);
                                }
                                else
                                {
                                    html.Append(Resources.TableRowStartTag);
                                }
                            }

                            //html.AppendFormat(Resources.TableCell, string.Empty, paragraph.RenderHTMLAsAnchor(paragraph.Name, Resources.ParagraphReference, RenderOption.Span, true));

                            html.AppendFormat(Resources.TableCell, string.Empty, MappingToolUrlHelper.GenerateValidParagraphLinkMarkup(paragraph.Name));
                            html.AppendFormat(Resources.TableCell, string.Empty, paragraph.RenderHTMLAsAnchor(GlobalStringResource.ParagraphReference, RenderOption.Span, false));
                            html.Append(Resources.TableRowEndTag);
                        }
                        validCount++;
                    }
                }

                html.Append(Resources.TableEndTag);
            }

            return(validCount > 0 ? html.ToString() : string.Empty);
        }
Exemplo n.º 5
0
        public override object BuildDetail(EntityDTO dto)
        {
            BpmnDetailDTO detail = new BpmnDetailDTO();
            EntityData    data   = new EntityData();

            detail.Title = dto.Name;
            EntityDTO parent = data.GetActivityOverviewParent(dto.ID);

            //TODO:
            detail.RelatedSubprocess = parent.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.Break);

            List <EntityDTO> variations = data.GetActivityVariations(dto.ID);

            if (variations.Count > 0)
            {
                foreach (EntityDTO variation in variations)
                {
                    ActivityVariationItem av = new ActivityVariationItem();
                    variation.ExtractProperties();
                    av.ActivityVariation = variation.Name;
                    av.Description       = variation.RenderHTML(GlobalStringResource.Description, RenderOption.Break);
                    detail.ActivityVariations.Add(av);
                }
            }

            List <EntityDTO> mappings = data.GetSubProcessParagraphs(dto.ID);

            if (mappings.Count > 0)
            {
                foreach (EntityDTO map in mappings)
                {
                    ParagraphItem p = new ParagraphItem();
                    map.ExtractProperties();
                    p.ParagraphName = MappingToolUrlHelper.GenerateValidParagraphLinkMarkup(map.Name);
                    p.ParagraphRef  = map.RenderHTMLAsAnchor(GlobalStringResource.ParagraphReference, RenderOption.Span, true);
                    detail.Paragraphs.Add(p);
                }
            }

            List <EntityDTO> useCases = data.GetUseCases(dto.ID);

            if (useCases.Count > 0)
            {
                foreach (EntityDTO useCase in useCases)
                {
                    UseCaseItem uc = new UseCaseItem();
                    useCase.ExtractProperties();
                    uc.UseCaseID   = useCase.Name;
                    uc.Description = useCase.RenderHTML(GlobalStringResource.Description, RenderOption.Break);
                    detail.UseCases.Add(uc);
                }
            }

            List <EntityDTO> requiredData = data.GetRequiredData(dto.ID);

            if (requiredData.Count > 0)
            {
                requiredData.Sort((b1, b2) => string.Compare(b1.Name, b2.Name, true));
                foreach (EntityDTO document in requiredData)
                {
                    RequiredDataItem rq = new RequiredDataItem();
                    document.ExtractProperties();
                    rq.RequiredData = document.Name;
                    rq.Description  = document.RenderHTML(GlobalStringResource.Description, RenderOption.Break);
                    detail.RequiredData.Add(rq);
                }
            }

            List <EntityDTO> sampleReferences = data.GetSampleReference(dto.ID);

            if (sampleReferences.Count > 0)
            {
                foreach (EntityDTO reference in sampleReferences)
                {
                    SampleReferenceItem sr = new SampleReferenceItem();
                    reference.ExtractProperties();
                    sr.SampleReference = reference.Name;
                    sr.Description     = reference.RenderHTML(GlobalStringResource.Description, RenderOption.Break);
                    sr.ReferenceLink   = reference.RenderHTMLAsAnchor(GlobalStringResource.ReferenceLink, RenderOption.Span, true);
                    detail.SampleReferences.Add(sr);
                }
            }
            return(detail);
        }
Exemplo n.º 6
0
        public string BuildHtml(List <Strategy2020DTO> strategyList)
        {
            StringBuilder html = new StringBuilder();

            html.Append("<div id='float-header'>");
            html.Append("<table border='0'>");
            html.Append("<tr><td colspan='100'><h5><strong>Strategy 2020 and its elements</strong></h5></td></tr>");
            html.Append("<tr>");
            html.Append("<td class='strategy-table-header width-100'>Agenda</td>");
            html.Append("<td><table border='0' width='100%'><tr><td class='strategy-table-header width-150'>Business Policy</td><td class='strategy-table-header width-200'>Business Rule</td><td class='strategy-table-header width-200'>Process</td><td class='strategy-table-header width-150' style='text-indent:5px;'>Application</td><td class='strategy-table-header width-200' style='text-indent:5px;'>Sub-Process</td><td class='strategy-table-header' style='text-indent:5px;'>Module</td></tr></table></td>");
            html.Append("</tr>");
            html.Append("</table>");
            html.Append("</div>");

            html.Append("<div id='ia-holder'>");
            html.Append("<table class='table table-striped main-table' width='100%' height='100%'>");

            if (strategyList.Count > 0)
            {
                int ctr0 = 0;
                foreach (var item in strategyList)
                {
                    StringBuilder policies = new StringBuilder();

                    policies.Append("<table  class='table table-striped ia-table-override bp-table' width='100%' height='100%'>");
                    int ctr1 = 0;
                    foreach (var ip in item.Policies)
                    {
                        policies.Append("<tr>");
                        policies.AppendFormat("<td class='{0} width-150'>{1}</td>", DetermineCSS(ctr1), ip.BusinessPolicyName);

                        ctr1++;
                        policies.Append("<td class='td-nested'>");
                        policies.Append("<table class='table table-striped ia-table-override br-table'  width='100%'  height='100%'>");

                        int ctr2 = 0;
                        foreach (var r in ip.Rules)
                        {
                            policies.Append("<tr>");
                            policies.AppendFormat("<td class='{0} width-200'>{1}</td>",
                                                  DetermineCSS(ctr2),
                                                  string.Format(GlobalStringResource.Presenter_ParagraphReferenceLinkMarkupFormat,
                                                                MappingToolUrlHelper.GenerateValidSectionLinkOnly(r.ShortBusinessRuleName),
                                                                r.BusinessRuleName));

                            ctr2++;
                            policies.Append("<td class='td-nested'>");

                            policies.Append("<table class='table table-striped ia-table-override proc-table' width='100%' height='100%'>");
                            int ctr3 = 0;
                            foreach (var p in r.Processes)
                            {
                                policies.Append("<tr>");
                                if (p.ProcessDiagramID > 0)
                                {
                                    policies.AppendFormat("<td class='{0} width-200'><a href=\"Default.aspx?id={1}\" target=\"_blank\">{2}</a></td>", DetermineCSS(ctr3), p.ProcessDiagramID, p.ProcessName);
                                }
                                else
                                {
                                    policies.AppendFormat("<td class='{0} width-200'>{1}</td>", DetermineCSS(ctr3), p.ProcessName);
                                }

                                ctr3++;

                                if (p.Application.Count == 1)
                                {
                                    policies.Append(
                                        "<td class='width-150'>");
                                    policies.AppendFormat("<ul class='mod-list'><li>{0}</li></ul>",
                                                          p.Application.FirstOrDefault().ApplicationName);
                                    policies.Append("</td>");
                                }
                                else
                                {
                                    policies.Append("<td class='width-150'>");
                                    //policies.Append("<ul class='table-ul'>");
                                    int ctr4 = 0;
                                    policies.Append("<ul class='mod-list'>");
                                    foreach (var app in p.Application)
                                    {
                                        //policies.Append("<tr>");
                                        //policies.AppendFormat("<li class='{0} width-150 table-li'>{1}</li>", DetermineCSS(ctr4), app.ApplicationName);
                                        //policies.Append("</tr>");
                                        //policies.AppendFormat("<span class='width-150'>{0}</span><br />", app.ApplicationName);
                                        policies.AppendFormat("<li>{0}</li>", app.ApplicationName);
                                        ctr4++;
                                    }
                                    policies.Append("</ul>");
                                    policies.Append("</td>");
                                }

                                policies.Append("<td class='td-nested'>");
                                policies.Append("<table class='table table-striped ia-table-override sproc-table' width='100%' height='100%'>");
                                int ctr5 = 0;
                                foreach (var sp in p.SubProcesses)
                                {
                                    string lastRowCss = string.Empty;
                                    if (ctr5 + 1 == (p.SubProcesses.Count))
                                    {
                                        lastRowCss = " sproc-last-row ";
                                    }
                                    policies.Append("<tr>");
                                    if (sp.SubProcessDiagramID > 0)
                                    {
                                        policies.AppendFormat("<td class='{0} width-200 {1}'><a href=\"Default.aspx?id={2}\" target=\"_blank\">{3}</a></td>", DetermineCSS(ctr5), lastRowCss, sp.SubProcessDiagramID, sp.SubProcessName);
                                    }
                                    else
                                    {
                                        policies.AppendFormat("<td class='{0} width-200 {1}'>{2}</td>", DetermineCSS(ctr5), lastRowCss, sp.SubProcessName);
                                    }
                                    ctr5++;

                                    policies.Append("<td class='td-nested'>");

                                    /*
                                     *  policies.Append("<table class='table table-striped  ia-table-override mod-table' width='100%' height='100%'>");
                                     *  int ctr6 = 0;
                                     *  string modLastRowCss = string.Empty;
                                     *
                                     *  foreach (var mod in sp.Modules)
                                     *  {
                                     *
                                     *      if (ctr6 + 1 == (sp.Modules.Count))
                                     *      {
                                     *          modLastRowCss = " mod-last-row ";
                                     *      }
                                     *
                                     *      policies.Append("<tr>");
                                     *      policies.AppendFormat("<td class='{0} {1}'>{2}</td>", DetermineCSS(ctr6), modLastRowCss, mod.ModuleName);
                                     *      policies.Append("</tr>");
                                     *      ctr6++;
                                     *  }
                                     *
                                     *  if (sp.Modules.Count == 0)
                                     *  {
                                     *      policies.Append("<tr><td>&nbsp;</td></tr>");
                                     *  }
                                     *
                                     *  policies.Append(ENDTABLETAG);*/
                                    policies.Append("<ul class='mod-list'>");
                                    foreach (var mod in sp.Modules)
                                    {
                                        policies.AppendFormat("<li>{0}</li>", mod.ModuleName);
                                    }
                                    policies.Append("</ul>");
                                    policies.Append("</td>");

                                    policies.Append("</tr>");
                                }
                                policies.Append(ENDTABLETAG);

                                policies.Append("</td>");


                                policies.Append("</tr>");
                            }
                            policies.Append(ENDTABLETAG);
                            policies.Append("</td>");
                            policies.Append("</tr>");
                        }
                        policies.Append(ENDTABLETAG);
                        policies.Append("</td>");
                        policies.Append("</tr>");
                    }
                    policies.Append(ENDTABLETAG);
                    string css0 = DetermineCSS(ctr0);
                    html.AppendFormat(
                        "<tr><td class='{0} width-100 agenda-column'>{1}</td><td class='td-nested'>{2}</td></tr>",
                        css0,
                        item.Agenda,
                        policies.ToString()
                        );
                }
            }
            else
            {
                html.Append("<tr><td colspan='4'>No Data Found!<td></tr>");
            }
            html.Append(ENDTABLETAG);
            html.Append("</div>");

            return(html.ToString());
        }