<%@ Control Language="VB" Inherits="WanerSoft.Provider.BaseControl" AutoEventWireup="false" EnableViewState="false"%>
<%@ Import Namespace="WanerSoft" %>
<%@ Import Namespace="WanerSoft.Provider" %>
<%@ Import Namespace="WanerSoft.Provider.Validate" %>
<%@ Import Namespace="WanerSoft.Model" %>
<%@ Import Namespace="WanerSoft.Data.Factory" %>
<%@ Register TagPrefix="Ws" TagName="Header" Src="../Common/HeaderTop2.ascx" %>
<%@ Register TagPrefix="Ws" TagName="Menu" Src="../Common/Menu2.ascx" %>
<%@ Register TagPrefix="Ws" TagName="Footer" Src="../Common/Footer.ascx" %>
<Ws:Header id="Header" PageTitle="连载阅读排行" StyleSheet="Book/ShowBookTop" Runat="Server" />
<Ws:Menu id="Menu" Runat="Server" />
<script runat="server">
Private i As Integer = 1
Private Nclass As Integer
Private CacheNum As Integer = 30 '定义缓存刷新时间,单位分钟

Protected Overrides Sub CreateChildControls()
    Nclass = Common.Request.Sift("id", "int", 1)
	Dim Key As String = "Ws.Web.BookTopB." + Nclass.ToString
	If Caches.GetCache(Key) Is Nothing Then
	    Caches.SetCache(Key, Ws.Instance.WebBookListTop(GetRows, GetWhere, InfoShowNum.BookTop), CacheNum)
	End IF
    ListData.DataSource = CType(Caches.GetCache(Key), System.Data.DataTable)
    ListData.DataBind()
End Sub
Private Function ChkShow(ByVal Obj As Object) As Object
   If Nclass = 12 Then
       Return FormatDateTime(Obj, 2)
   Else
       Return Obj   
   End IF
End Function
Private Function GetMeg() As String
   Select Case Nclass
       Case 1
	       Return "总点击榜"
       Case 2
	       Return "月点击榜"
       Case 3
	       Return "周点击榜"
       Case 4
	       Return "总推荐榜"
       Case 5
	       Return "月推荐榜"
       Case 6
	       Return "周推荐榜"
       Case 7
	       Return "总收藏榜"
       Case 8
	       Return "总字数榜"
       Case 9
	       Return "原创点击"
       Case 10
	       Return "新书周榜"
       Case 11
	       Return "全本回顾榜"
       Case 12
	       Return "入站时间"
   End Select     
End Function
Private Function GetWhere() As String
   Select Case Nclass
       Case 9
            Return " and bookyc=1"
       Case 10
            Return " and id in(select top "+InfoShowNum.BookTop.ToString+" id From Ws_BookList where bookonoff=1 order by id desc)"
       Case 11
            Return " and bookstate=1"
   End Select   
End Function
Private Function GetRows() As String
   Select Case Nclass
       Case 1,9,11
	       Return "bookhits"
       Case 2
	       Return "bookmhits"
       Case 3,10
	       Return "bookzhits"
       Case 4
	       Return "bookrecom"
       Case 5
	       Return "bookmrecom"
       Case 6
	       Return "bookzrecom"
       Case 7
	       Return "booksave"
       Case 8
	       Return "booklen"
       Case 12
	       Return "bookaddtime"
   End Select   
End Function
</script>
<div id="main">
        <!-- 左列 begin -->
        <div id="left">
	<div id="title1"><div id="bluesj">排列方式</div></div>
	<ul id="box">
	<li class="t14red lt3j"><a href="?id=1">总点击榜</a></li>
	<li><a href="?id=2">月点击榜</a></li>
	<li><a href="?id=3">周点击榜</a></li>
	</ul>
	<div class="line"></div>
	<ul id="box">
	<li><a href="?id=4">总推荐榜</a></li>
	<li><a href="?id=5">月推荐榜</a></li>
	<li><a href="?id=6">周推荐榜</a></li>
	</ul>
	<div class="line"></div>
	<ul id="box">
	<li><a href="?id=7">总收藏榜</a></li>
	<li><a href="?id=8">总字数榜</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="?id=9">原创点击</a></li>
	<li><a href="?id=10">新书周榜</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="?id=11">全本回顾</a></li>
	<li><a href="?id=12">入站时间</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/ShowBookTopOver.aspx">完成作品</a></li>
	<li><a href="/Essay/Top.aspx">经典短篇</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/LC/1.aspx">玄幻魔法</a></li>
	<li><a href="/Book/LC/3.aspx">武侠修真</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/LC/5.aspx">都市言情</a></li>
	<li><a href="/Book/LC/7.aspx">历史军事</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/LC/9.aspx">网游竞技</a></li>
	<li><a href="/Book/LC/11.aspx">科幻小说</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/LC/13.aspx">恐怖灵异</a></li>
	<li><a href="/Book/LC/15.aspx">耽美同人</a></li>
	</ul>
        <div class="line"></div>
	<ul id="box">
	<li><a href="/Book/LC/17.aspx">纯爱女生</a></li>
	<li><a href="/Book/LC/19.aspx">其他小说</a></li>
	</ul>
	</div>  
        <!-- 左列 end -->
        <!-- 右列 begin -->
        <div id="right">
            <div id="title2">
                <div class="left lt"></div>
                <div id="p" class="left"><a href="/" target="_blank" class="t14r">首页</a> > <a href="/book/ShowBookTop.aspx" target="_blank" class="t14r">排行榜</a> > <%=GetMeg()%></div>
                <div class="right rt">
                </div>
            </div>
            <div id="htmlTitle" class="tit3"><ul><li class="t0">排名</li><li class="t1">类别</li><li class="tt3">小说名/最新章节</li><li class="t4">作者</li><li class="t5">更新时间</li><li class="t6">状态</li><li class="t7"><%=GetMeg()%></li></ul></div>
            <div id="lbox">
<asp:Repeater id="ListData" runat="server" EnableViewState="false">
<ItemTemplate>
<ul>
<li class="t0 No<%=i%>"><%=i%></li>
<li class="t1"><a href="<%#ReUrl(DataBinder.Eval(Container.DataItem,"nclassid"),InfoUrl.BookNclassUrlR,InfoUrl.BookNclassUrl)%>"><%# DataBinder.Eval(Container.DataItem,"nclass") %></a></li>
<li class="tt3"><a href="<%#VolumeUrl(DataBinder.Eval(Container.DataItem,"bookhtml"),DataBinder.Eval(Container.DataItem, "id"))%>">[目录]</a> <a href="<%#ReUrl(DataBinder.Eval(Container.DataItem, "id"),InfoUrl.BookUrlR,InfoUrl.BookUrl) %>"><%# DataBinder.Eval(Container.DataItem,"booktitle") %></a> / <a href="<%#ChapterUrl(DataBinder.Eval(Container.DataItem,"bookhtml"),DataBinder.Eval(Container.DataItem,"id"),DataBinder.Eval(Container.DataItem,"bookupdateid"))%>" class="gray"><%# DataBinder.Eval(Container.DataItem,"bookupdatetitle") %></a></li>
<li class="t4"><%# DataBinder.Eval(Container.DataItem,"bookwriter") %></li>
<li class="t5"><%# DataBinder.Eval(Container.DataItem,"bookupdatetime","{0:M}") %></li>
<li class="t6"><%#GetState(DataBinder.Eval(Container.DataItem,"bookstate"))%></li>
<li class="t7"><%#ChkShow(DataBinder.Eval(Container.DataItem,"bookss"))%></li>
</ul>
<%i = i+1%>
</ItemTemplate>
</asp:Repeater>

</div>
</div>

</div>
<!-- 右列 end -->
</div>

<Ws:Footer id="Footer" Runat="Server" />