Esempio n. 1
0
        public static BreadcrumbCollection GenerateBreadCrumbs(Guid articleGuid, Guid instanceGuid, bool isAdmin)
        {
            BreadcrumbCollection breadCrumbs = new BreadcrumbCollection();

            using (MainDataSetTableAdapters.ArticleTableAdapter m_taArticle = new MainDataSetTableAdapters.ArticleTableAdapter())
            {
                if (articleGuid != Guid.Empty && instanceGuid != Guid.Empty)
                {
                    MainDataSet.ArticleDataTable dtArticle = m_taArticle.GetRecursiveAllByArticleGuid(articleGuid);
                    if (dtArticle.Count > 0)
                    {
                        for (int i = dtArticle.Count - 1; i >= 0; i--)
                        {
                            MainDataSet.ArticleRow row = dtArticle[i];
                            breadCrumbs.Add(
                                row.Subject,
                                isAdmin ? string.Format("~/ArticleViewAdmin.aspx?id={0}", row.ArticleGuid.ToString("N")) : string.Format("~/?i={0}&t={1}", instanceGuid.ToString("N"), row.ArticleGuid.ToString("N")),
                                row.Subject, false);
                        }
                    }
                }
            }
            return(breadCrumbs);
        }
Esempio n. 2
0
 public ActionCustomHandler()
 {
     taArticle = new MainDataSetTableAdapters.ArticleTableAdapter();
     taComment = new MainDataSetTableAdapters.CommentTableAdapter();
 }
Esempio n. 3
0
 public static BreadcrumbCollection GenerateBreadCrumbs(Guid articleGuid, Guid instanceGuid, bool isAdmin)
 {
     BreadcrumbCollection breadCrumbs = new BreadcrumbCollection();
     using (MainDataSetTableAdapters.ArticleTableAdapter m_taArticle = new MainDataSetTableAdapters.ArticleTableAdapter())
     {
         if (articleGuid != Guid.Empty && instanceGuid != Guid.Empty)
         {
             MainDataSet.ArticleDataTable dtArticle = m_taArticle.GetRecursiveAllByArticleGuid(articleGuid);
             if (dtArticle.Count > 0)
             {
                 for (int i = dtArticle.Count - 1; i >= 0; i--)
                 {
                     MainDataSet.ArticleRow row = dtArticle[i];
                     breadCrumbs.Add(
                         row.Subject,
                         isAdmin ? string.Format("~/ArticleViewAdmin.aspx?id={0}", row.ArticleGuid.ToString("N")) : string.Format("~/?i={0}&t={1}", instanceGuid.ToString("N"), row.ArticleGuid.ToString("N")),
                         row.Subject, false);
                 }
             }
         }
     }
     return breadCrumbs;
 }