Пример #1
0
        /// <summary>
        /// 获取最新更新的书籍 Metro风格
        /// </summary>
        /// <param name="top"></param>
        /// <returns></returns>
        public string getnoveltopmetroupdate(string top)
        {
            int           i_top = top.ToInt32();
            List <Book>   bs    = BookView.GetModelList("Enable=1 order by UpdateTime desc", i_top);
            StringBuilder sb    = new StringBuilder();
            int           i     = 1;

            foreach (Book b in bs)
            {
                Class c = BookView.GetClass(b);
                sb.AppendLine(string.Format("<li style=\" background-color:{0};\"><div class=\"item\"><h1><a href=\"{1}\">" + i + ".{2}</a></h1><div><div class=\"lastchapter\"><a href=\"{5}\">{6}</a></div></div></div><div class=\"item\"><h1><a href=\"{1}\">阅读书籍</a></h1><div><div class=\"lastchapter\"><a href=\"{5}\" title=\"{6}\">阅读最新章节</a></div><div class=\"class\">分类:<a href=\"{3}\">{4}</a></div><div class=\"author\">作者:{8}</div><div class=\"time\">更新时间:{9}</div></div></div></li>",
                                            BasePage.RandomBGColor(),
                                            BasePage.GetBookUrl(b, c),
                                            b.Title,
                                            BasePage.GetClassUrl(c),
                                            b.ClassName,
                                            BasePage.GetBookChapterUrl(BookChapterView.GetModelByID(b.LastChapterID.ToS()), c),
                                            b.LastChapterTitle,
                                            b.LastChapterTitle.CutString(12),
                                            b.Author,
                                            b.UpdateTime.ToString("MM-dd HH:mm")
                                            ));
                i++;
            }
            return(sb.ToS());
        }