Пример #1
0
        private void SortRecursiveTable(ref string output, ref MainDataSet.ArticleDataTable input, Guid?parentArticleId)
        {
            OrderedEnumerableRowCollection <MainDataSet.ArticleRow> query = null;

            if (parentArticleId.HasValue)
            {
                query = input.Where(w => w.IsParentArticleGuidNull() ? false : w.ParentArticleGuid.Equals(parentArticleId.Value)).OrderBy(o => o.Subject);
            }
            else
            {
                query = input.Where(w => w.IsParentArticleGuidNull()).OrderBy(o => o.Subject);
            }
            int cnt = query.Count();

            if (cnt > 0)
            {
                output += "<ul>";
            }
            foreach (MainDataSet.ArticleRow row in query)
            {
                output += string.Format(CultureInfo.CurrentCulture, "<li><a style=\"vertical-align:top\" href=\"Default.aspx?i={0}&t={1}\">{2}</a>", this.InstanceGuid.ToString("N"), row.ArticleGuid.ToString("N"), row.Subject);
                SortRecursiveTable(ref output, ref input, row.ArticleGuid);
            }
            if (cnt > 0)
            {
                output += "</ul>";
            }
        }
Пример #2
0
 private void SetCustomLink(ref Telerik.Web.UI.EditorLink link, MainDataSet.ArticleDataTable articles, Guid articleGuid)
 {
     foreach (MainDataSet.ArticleRow row in articles.Where(p => !p.IsParentArticleGuidNull() && p.ParentArticleGuid == articleGuid))
     {
         Telerik.Web.UI.EditorLink newlink = new Telerik.Web.UI.EditorLink(row.Subject, string.Format("{0}/Default.aspx?i={1}&t={2}", Request.ApplicationPath, row.DepartmentGuid.ToString("N"), row.ArticleGuid.ToString("N")));
         SetCustomLink(ref newlink, articles, row.ArticleGuid);
         link.ChildLinks.Add(newlink);
     }
 }
Пример #3
0
        private void SortRecursiveTable(ref MainDataSet.ArticleDataTable output, ref MainDataSet.ArticleDataTable input, Guid?parentArticleId)
        {
            OrderedEnumerableRowCollection <MainDataSet.ArticleRow> query = null;

            if (parentArticleId.HasValue)
            {
                query = input.Where(w => w.IsParentArticleGuidNull() ? false : w.ParentArticleGuid.Equals(parentArticleId.Value)).OrderBy(o => o.Subject);
            }
            else
            {
                query = input.Where(w => w.IsParentArticleGuidNull()).OrderBy(o => o.Subject);
            }
            foreach (MainDataSet.ArticleRow row in query)
            {
                output.ImportRow(row);
                SortRecursiveTable(ref output, ref input, row.ArticleGuid);
            }
        }
Пример #4
0
        private void CustomLinksDataBind(Guid instanceGuid)
        {
            HtmlEditorBody.Links.Clear();

            MainDataSet.ArticleDataTable dtLinks = this.ArticleTableAdapter.GetRecursiveByDepartmentGuid(instanceGuid);
            foreach (MainDataSet.ArticleRow row in dtLinks.Where(p => p.IsParentArticleGuidNull()))
            {
                Telerik.Web.UI.EditorLink link = new Telerik.Web.UI.EditorLink(row.Subject, string.Format("{0}/Default.aspx?i={1}&t={2}", Request.ApplicationPath, instanceGuid.ToString("N"), row.ArticleGuid.ToString("N")));
                SetCustomLink(ref link, dtLinks, row.ArticleGuid);
                HtmlEditorBody.Links.Add(link);
            }
        }