Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Log log = MainMasterPage.InitPage(this);

//			ucArticles.InitControl(ArticleType.Article, 3, false);
        try
        {
            ucPositions.InitControl("Positions", 8, false);
            Article article = null;
            using (var conn = Global.CreateConnection())
            {
                article = Article.GetArticle(conn, "Default");
                if (article != null)
                {
                    ArticleParam.GetArticleParams(conn, article.Id, sd);
                }
            }

            //			ucDigests.InitControl(ArticleType.Digest, 2, false);
        }
        catch (Exception ex)
        {
            log.Exception(ex);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(PageTag))
     {
         int articleId = articleIds.ContainsKey(PageTag) ? articleIds[PageTag] : 0;
         using (var conn = Global.CreateConnection())
         {
             if (articleId == 0)
             {
                 var article = Article.GetArticle(conn, PageTag);
                 if (article != null)
                 {
                     articleId           = article.Id;
                     articleIds[PageTag] = articleId;
                 }
             }
             if (articleId != 0)
             {
                 ArticleParam.GetArticleParams(conn, articleId, sd);
             }
         }
     }
 }