Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (BlockInfo != null)
     {
         PageBlockFacade facade = new PageBlockFacade();
         facade.LoadBlockContent(BlockInfo);
         if (BlockInfo.ContentItem != null)
         {
             lblTitle.Text = BlockInfo.ContentItem.Name;
             if (BlockInfo.ContentItem is ItemCollectionInfo)
             {
                 ctrlBlockHtml.Visible      = false;
                 ctrlBlockList.Visible      = true;
                 ctrlBlockList.BlockObject  = BlockInfo.ContentItem;
                 ctrlBlockList.DisplayCount = BlockInfo.DisplayCount;
                 ctrlBlockList.OrderBy      = BlockInfo.OrderBy;
                 ctrlBlockList.Direction    = (ORM.SortDirection)BlockInfo.Direction;
             }
             else if (BlockInfo.ContentItem is ItemHtmlInfo ||
                      BlockInfo.ContentItem is ItemDetailInfo)
             {
                 ctrlBlockHtml.Visible     = true;
                 ctrlBlockList.Visible     = false;
                 ctrlBlockHtml.BlockObject = BlockInfo.ContentItem;
             }
             else
             {
                 throw new ArgumentOutOfRangeException("不支持类型\"" + BlockInfo.ContentItem.GetType().FullName + "\"在模块中展示。");
             }
         }
     }
 }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageBlockFacade facade = new PageBlockFacade();

        IList <PageBlockInfo> blockListLeft = facade.GetColumnBlockList(0);

        rptLeftBlocks.DataSource = blockListLeft;
        rptLeftBlocks.DataBind();

        IList <PageBlockInfo> blockListMiddle = facade.GetColumnBlockList(1);

        rptMiddleBlocks.DataSource = blockListMiddle;
        rptMiddleBlocks.DataBind();

        IList <PageBlockInfo> blockListRight = facade.GetColumnBlockList(2);

        rptRightBlocks.DataSource = blockListRight;
        rptRightBlocks.DataBind();
    }