⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_newsmain.asp

📁 印刷物の発注、在庫管理、出庫処理を一元管理
💻 ASP
字号:
<%
Class s_NewsMain
	Dim l_db		'DbAccess
	Dim l_cmn		'Common
	Dim l_pactl		'PageControl
	Dim l_sysId		'僔僗僥儉ID
	Dim l_coId		'夛幮ID
	Dim l_sectionId	'晹栧ID
	Dim l_RsPageCount
	Dim l_RsRecordCount

	'/**********************************
	'/* 弶婜張棟
	'/**********************************
	Public Sub Init
		Set l_db = New DbAccess
		Set l_cmn = New Common
		Set l_pactl = New PageControl

		Call l_db.ProcConnection(DSN, USERID, PASSWD)

		'僙僢僔儑儞傛傝儐乕僓乕忣曬庢摼
		l_sysId = Session("User").Item("SYSTEM_ID")	'僔僗僥儉ID
		l_coId = Session("User").Item("COMPANY_ID")	'夛幮ID
		l_sectionId = Session("User").Item("SECTION_ID")	'晹栧ID

	End Sub

	'/**********************************
	'/* 怴拝忣曬庢摼
	'/**********************************
	Public Function GetNewsHtml
		Dim l_detaildic
		Dim l_newsdic
		Dim l_count
		Dim l_diccount
		Dim l_strHtml
		Dim l_CRLF
		Dim l_key
		Dim l_rset
		Dim l_DBObj,l_SQL
		l_CRLF = chr(13) & chr(10)

		l_SQL = "SELECT MESSAGE,TO_CHAR(REG_YMD,'YY/MM/DD') AS REG_YMD," & _
				"       REG_YMD AS REG_YMD2 " &_
				"  FROM INFORMATION_M" &_
				" WHERE SYSTEM_ID='" & SYSTEMID & "'" &_
				"   AND GENRE = '" & GENRE_WARE & "'" & _
				"   AND KIND = '1'" & _
				"   AND OPEN_PROP = '1' " &_
				"   AND DEL_FLG = '0'" &_
				" ORDER BY REG_YMD2 DESC"

		Set l_rset = l_db.ProcRecordset(l_SQL,20,0)

		Set l_newsdic = CreateObject("Scripting.Dictionary")

		l_diccount = 0

		Do Until l_rset.Eof
			Set l_detaildic = CreateObject("Scripting.Dictionary")
			For l_count = 0 to l_rset.Fields.Count - 1
				l_detaildic.add l_rset.Fields(l_count).Name,l_rset.Fields(l_count).Value
			Next
			l_newsdic.add CStr(l_diccount),l_detaildic
			l_rset.MoveNext
			l_diccount = l_diccount + 1
		Loop

		l_strHtml = "<table width=""100%"" border=""0"" cellspacing=""2"" cellpadding=""2"">"

		l_key = l_newsdic.Keys

		l_RsPageCount = Fix(l_newsdic.Count / 20 + 0.9)		'儁乕僕僒僀僘愝掕
		l_RsRecordCount = l_newsdic.Count	'儗僐乕僪審悢愝掕

		For l_count = 0 to 19
			If l_newsdic.Count <= l_count Then
				Exit For
			End If
			Set l_detaildic = l_newsdic.Item(l_key(l_count))
			
			l_strHtml = l_strHtml & "<tr>" & l_CRLF &_
		  			    "<td width=""10"">&nbsp;</td>" &_
		  				"<td class=""txt_m"" "
			If l_count mod 2 = 0 Then
				l_strHtml = l_strHtml & "bgcolor=""#FBFAF2"">" 
			Else
				l_strHtml = l_strHtml & ">"
			End If
			l_strHtml = l_strHtml & "[" & l_detaildic.Item("REG_YMD") & "]" &_
					    l_detaildic.Item("MESSAGE") & "</td>" & l_CRLF &_
					   "</tr>" & l_CRLF
		Next

		Do Until l_count => 20
			l_strHtml = l_strHtml & "<tr> " & l_CRLF &_
		  			    "<td width=""10"">&nbsp;</td>" &_
		  			    "<td class=""txt_m"">&nbsp;</td>" &_
					    "</tr>" & l_CRLF
			l_count = l_count + 1
		Loop
	  	l_strHtml = l_strHtml & "</table>" & l_CRLF

		GetNewsHtml = l_strHtml
	End Function

	'/********************************************
	'/* 儁乕僕僐儞僩儘乕儖愝掕
	'/* param丗l_page丂儁乕僕斣崋
	'/********************************************
	Public Sub SetPager(l_page)
		Call l_pactl.Init(20,l_page)
		Call l_pactl.SetTotalPage(l_RsPageCount)
		Call l_pactl.SetTotalRowSize(l_RsRecordCount)
		Call l_pactl.SetBottomRow
	End Sub

	'/********************************************
	'/* 僋儘乕僘
	'/********************************************
	Public Function Close
		If IsObject(l_db.l_objADO_Rset) Then
			Call l_db.CloseRecodeset
		End If
		If IsObject(l_db.l_objADO_Conn) Then
			Call l_db.CloseConnection
		End If
	End Function
End Class
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -