'/// 摘要说明。
'/// </summary>
Class BLL_Guest
Private mycom,mymod,mydal
Private LI,UL
Private DEL
'获取信息
Public Sub GetGuest()
mydal.GetGuest(Id)
End Sub
'新增信息
Public Sub Insert()
mymod.Content = Request("content")
mymod.re = Request("Re")
mymod.Addtime = Now()
mymod.Ip = request.servervariables("HTTP_X_FORWARDED_FOR")
If len(mymod.Ip)<=0 Then mymod.Ip = request.servervariables("REMOTE_ADDR")
Call mydal.Insert(mymod)
End Sub
'更新信息
Public Sub Update()
Call mydal.Update(mymod)
End Sub
'删除信息
Public Sub Delete()
mydal.Delete(Request("Id"))
End Sub
'查找信息
Public Function FindByPage()
Dim PageSize,CurrentPage,WhereValue,OrderValue,RecordCount
Dim objRS
Dim tmp1,tmp2,tmp3,parms,i
Dim tCMD
tCMD = Request("tCMD")
PageSize = "8"
CurrentPage = Request("PageNo")
If Len(CurrentPage)<=0 Then
CurrentPage=1
End If
WhereValue = ""
OrderValue = "Id"
Set objRS = mydal.FindByPage(PageSize,CurrentPage-1,WhereValue,OrderValue)
i = 1
RecordCount = mydal.Count(WhereValue)
Do While Not objRS.EOF
If tCMD="DEL" Then
DEL = "<a href=""?tCMD=DEL&Id="&objRS("Id")&""">删除</a>"
Else
DEL = ""
End If
parms=Array(i,objRS("content"),objRS("ip"),objRS("addtime"),DEL)
tmp1 = tmp1 & mycom.Format(LI,parms)
objRs.Movenext
i = i + 1
Loop
tmp3 = mycom.Page(PageSize,CurrentPage,RecordCount,"guest/index.asp?tCMD=LIST")
parms=Array(tmp1,tmp3)
tmp2 = tmp2 & mycom.Format(UL,parms)
FindByPage = tmp2
End Function作者: 孔隆 时间: 2009-11-4 11:05
我来自火星刚到地球什么都不懂