
????
Dim
?oHtml
????
set
?rs
=
server.createobject(
"
adodb.recordset
"
)
????Sql?
=
?
"
select?top?10?id,Title?From?tbl_News??order?by?id?desc
"
????rs.open?sql,conn,
1
,
1
????oHtml
=
"
<ul>
"
????
do
?
while
?
not
?rs.eof
????????oHtml
=
oHtml?
&
?
"
<li><a?href=""shownews.asp?id=
"
?
&
?rs(
"
id
"
)?
&
?
"
""?title=""
"
?
&
?rs(
"
title
"
)?
&
?
"
"">
"
?
&
?rs(
"
title
"
)?
&
?
"
</a></li>
"
????rs.movenext
????
loop
????oHtml
=
oHtml?
&
?
"
</ul>
"
????rs.close
????
set
?rs
=
nothing
????response.write?(oHtml)

????Public?Class?News
????????Protected?_id?As?Integer
????????Protected?_typeId?As?Integer
????????Protected?_title?As?String
????????Protected?_author?As?String
????????Protected?_original?As?String
????????Protected?_updateTime?As?DateTime
????????Protected?_content?As?String
????????Protected?_clickCount?As?Integer
????????Public?Property?Id()?As?Integer
????????????Get
????????????????Return?_id
????????????End?Get
????????????Set(ByVal?Value?As?Integer)
????????????????_id?=?Value
????????????End?Set
????????End?Property
????????Public?Property?TypeId()?As?Integer
????????????Get
????????????????Return?_typeId
????????????End?Get
????????????Set(ByVal?Value?As?Integer)
????????????????_typeId?=?Value
????????????End?Set
????????End?Property
????????Public?Property?Title()?As?String
????????End?Property
????????Public?Property?Author()?As?String
????????End?Property
????????Public?Property?original()?As?String
????????End?Property
????????Public?Property?UpdateTime()?As?DateTime
????????End?Property
????????Public?Property?Content()?As?String
????????End?Property
????????Public?Property?ClickCount()?As?Integer
????????End?Property
????End?Class
Public?Class?Newss


End?Class
????Public?Function?ReadNews(ByVal?ID?As?Integer)?As?News
????End?Function
????'读取新闻列表
????Public?Function?ReadNewss(ByVal?newsType?As?eNewsType,?ByVal?nCount?As?Integer)?As?News
????End?Function
????'增加一新闻
????Public?Function?InsertNews(ByVal?n?As?News)?As?Integer
????End?Function
????'更新一条新闻
????Public?Function?UpdateNews(ByVal?n?As?News)?As?Integer
????End?Function
????'删除一条新闻
????Public?Function?DeleteNews(ByVal?ID?As?Integer)?As?Integer
????End?Function
????????????<asp:Repeater?ID="topNewsList"?runat="server"?>
????????????????<HeaderTemplate>
????????????????????<ul>
????????????????</HeaderTemplate>
????????????????<ItemTemplate>
????????????????????<li><a?href="shownews.asp?id=<%#Container.DataItem("?temp_href="shownews.asp?id=<%#Container.DataItem("id")%>"><%#Container.DataItem("title")%></a></li>
????????????????</ItemTemplate>
????????????????<FooterTemplate>
????????????????????</ul>
????????????????</FooterTemplate>
????????????</asp:Repeater>


topNewsList.DataSource?=?New?facade.newsFacade().ReadNewss(eNewsType,?newsCount)