Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string htmlstring = "";

        BoardNews announce = new BoardNews();
        int RecordCount = announce.LoadLastNews(15);
        if (RecordCount > 0)
        {
            htmlstring += "<ul class=\"wonderfulComment dashed\" id=\"commentList\">\n";
            for (int i = 0; i < RecordCount; ++i)
            {
                htmlstring += "<li>" + "<div class=\"f_l_img\">" + announce.LastNews[i].newsTitle + "</div>\n"
                    + "<div class=\"f_r_info\">\n" + announce.LastNews[i].newsContent + "</div>"
                    + "<div class=\"clearfix\"></div>\n</li>";
            }
            htmlstring += "</ul>";
        }
        else
            htmlstring += "●暂无公告信息\n";
        this.div_board.InnerHtml = htmlstring;

        // 首页滚动公告
        if (RecordCount > 0)
        {
            if (RecordCount > 9) RecordCount = 9;
            htmlstring = "<div class=\"carousel auto\">\n"
                + "<div class=\"jCarouselLite\" style=\"visibility: visible; overflow: hidden; position: relative; z-index: 2; top: 10px; left: 640px; height: 435px;\">\n"
                + "<ul style=\"margin: 0px; padding: 0px; position: relative; list-style-type: none; z-index: 1; height: 2465px; top: -435px;\">";
            for (int i = 0; i < RecordCount; ++i)
            {
                htmlstring += "<li style=\"overflow: hidden; float: none; width: 220px; height: 20px; margin: 0;\">"
                    + "<a href=\"board/board.aspx?id="+ announce.LastNews[i].newsID.ToString() + "\" target=\"_blank\">"
                    + (i+1).ToString() +". "
                    + announce.LastNews[i].newsTitle
                    + "</a></li>\n";
            }
            htmlstring += "</ul>\n" + "</div>\n<div class=\"clear\"></div>\n" + "</div>";
        }
        else
            htmlstring += "●暂无公告信息\n";
        this.div_boardlist.InnerHtml = htmlstring;
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string htmlstring = "";

        BoardNews boardNews = new BoardNews();

        if (Request["ID"] != null)
        {
            boardNews.LoadData(Request["ID"].ToString());
            Page.Title = boardNews.Title;

            htmlstring += "<div class=\"art-post post-94269 post type-post status-publish format-standard hentry category-camera-lens tag-canon tag-ebay\">\n"
                                + "<div class=\"art-post-body\">\n"
                                + "<div class=\"art-post-inner art-article\">\n"
                                + "<div class=\"updatetime\">发布在 " + Function.getDateTimeLaterThan(boardNews.Datetime)
                                + "</div>\n"
                                + "<div class=\"art-article-up\">\n"
                                + "<h2 class=\"art-postheader\">"
                                + boardNews.Title + "</h2>\n"
                                + "<div class=\"art-postcontent\">\n"
                                + boardNews.Content
                                + "</div>\n"
                                + "</div>\n"
                                + "<div class=\"cleared\"></div>\n"
                                + "</div>\n"
                                + "<div class=\"cleared\"></div>\n"
                                + "</div>\n" + "</div>\n";
        }
        else
        {
            int RecordCount = boardNews.LoadLastNews(20);
            if (RecordCount > 0)
            {
                for (int i = 0; i < RecordCount; ++i)
                {
                    TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks);
                    TimeSpan ts2 = new TimeSpan(boardNews.LastNews[i].updateTime.Ticks);
                    TimeSpan ts = ts1.Subtract(ts2).Duration();

                    htmlstring += "<div class=\"art-post post-94269 post type-post status-publish format-standard hentry category-camera-lens tag-canon tag-ebay\">\n"
                                + "<div class=\"art-post-body\">\n"
                                + "<div class=\"art-post-inner art-article\">\n"
                                + "<div class=\"updatetime\">发布在 " + Function.getDateTimeLaterThan(boardNews.LastNews[i].updateTime)
                                + "</div>\n"
                                + "<div class=\"art-article-up\">\n"
                                + "<h2 class=\"art-postheader\">"
                                + (i+1).ToString() + ". " + boardNews.LastNews[i].newsTitle + "</h2>\n"
                                + "<div class=\"art-postcontent\">\n"
                                + boardNews.LastNews[i].newsContent
                                + "</div>\n"
                                + "</div>\n"
                                + "<div class=\"cleared\"></div>\n"
                                + "</div>\n"
                                + "<div class=\"cleared\"></div>\n"
                                + "</div>\n" + "</div>\n";
                }
            }
            else
                htmlstring += "●暂无信息\n";
        }
        this.div_post.InnerHtml = htmlstring;
    }