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

📄 searchhistorymain.asp

📁 印刷物の発注、在庫管理、出庫処理を一元管理
💻 ASP
字号:
<%
'/************************************
'/*晹栧堦棗儊僀儞僋儔僗
'/************************************
Class SearchHistoryMain
	Dim l_CutilObject
	Dim l_CheckObject
	Dim l_CommonObject
	Dim l_PgCtrlObject
	Dim l_DBObject
	Dim l_Page
	Dim l_RsPageCount
	Dim l_RsRecordCount
	Dim l_SearchHistoryMdlObject
	Dim l_objbasp

	'/********************************************
	'/* 弶婜張棟
	'/********************************************
	Public Function Init()
		Set l_CutilObject = New CharUtil
		Set l_CheckObject = New CheckUtil
		Set l_CommonObject = New Common
		Set l_PgCtrlObject = New PageControl
		Set l_SearchHistoryMdlObject = New SearchHistoryMdl
		Set l_objbasp = Server.CreateObject("basp21")

		Call l_CommonObject.SearchSession
		'DB僐僱僋僔儑儞庢摼
		Set l_DBObject = New DbAccess
		Call l_DBObject.ProcConnection(DSN,USERID,PASSWD)

		'僙僢僔儑儞傛傝儐乕僓乕忣曬庢摼
		l_SearchHistoryMdlObject.l_SystemId = Session("User").Item("SYSTEM_ID")
		l_SearchHistoryMdlObject.l_CompanyId = Session("User").Item("COMPANY_ID")
		l_SearchHistoryMdlObject.l_SectionId = Session("User").Item("SECTION_ID")
		l_SearchHistoryMdlObject.l_UserId = Session("User").Item("USER_ID")
		l_SearchHistoryMdlObject.l_UserName = Session("User").Item("NAME")

		'尰嵼偺儁乕僕悢愝掕(僷儔儊乕僞偵儁乕僕偑側偗傟偽1傪愝掕)
		l_Page = Request.QueryString("page")
		If l_Page = "" Then
			l_Page = 1
		End If
	End Function

	'/********************************************
	'/* 晹栧堦棗儗僐乕僪拪弌
	'/* return丗Scripting.Dictionary 昞帵儕僗僩(FormListMdl宆偺攝楍)
	'/********************************************
	Public Function GetList()
		Dim l_SearchDataClaimOrderMasterObject
		Dim l_RecordSet
		Dim l_retList
		Dim l_flg

		Set l_retList = CreateObject("Scripting.Dictionary")

		'擖椡抣愝掕
		Call l_CommonObject.SetSearchInfoSession("DemandSearchHistory")

		l_flg = true

		'僙僢僔儑儞忣曬懚嵼僠僃僢僋
		If IsObject(Session("DemandSearchHistory")) Then
			If Session("DemandSearchHistory").Item("recept_no") <> "" Then
				l_SearchHistoryMdlObject.l_ReceptNo = Replace(l_CutilObject.html_chg(l_objbasp,Session("DemandSearchHistory").Item("recept_no")),"""","&quot;")
			End If
			l_SearchHistoryMdlObject.l_ClaimSituation = Session("DemandSearchHistory").Item("claim_situation")
			l_SearchHistoryMdlObject.l_StrY = Session("DemandSearchHistory").Item("recept_start_year")
			l_SearchHistoryMdlObject.l_StrM = Session("DemandSearchHistory").Item("recept_start_mon")
			l_SearchHistoryMdlObject.l_StrD = Session("DemandSearchHistory").Item("recept_start_day")
			l_SearchHistoryMdlObject.l_ReceptStart = l_SearchHistoryMdlObject.l_StrY & _
													 l_SearchHistoryMdlObject.l_StrM & _
													 l_SearchHistoryMdlObject.l_StrD
			l_SearchHistoryMdlObject.l_EndY = Session("DemandSearchHistory").Item("recept_end_year")
			l_SearchHistoryMdlObject.l_EndM = Session("DemandSearchHistory").Item("recept_end_mon")
			l_SearchHistoryMdlObject.l_EndD = Session("DemandSearchHistory").Item("recept_end_day")
			l_SearchHistoryMdlObject.l_ReceptEnd = l_SearchHistoryMdlObject.l_EndY & _
												   l_SearchHistoryMdlObject.l_EndM & _
												   l_SearchHistoryMdlObject.l_EndD
			l_SearchHistoryMdlObject.l_ClaimMethod1 = Session("DemandSearchHistory").Item("claim_method1")
			l_SearchHistoryMdlObject.l_ClaimMethod2 = Session("DemandSearchHistory").Item("claim_method2")
			l_SearchHistoryMdlObject.l_ClaimMethod3 = Session("DemandSearchHistory").Item("claim_method3")

			If l_SearchHistoryMdlObject.l_ReceptStart <> "" Then
				l_SearchHistoryMdlObject.l_ReceptStart = _
					l_SearchHistoryMdlObject.l_StrY & "/" & _
					l_SearchHistoryMdlObject.l_StrM & "/" & _
					l_SearchHistoryMdlObject.l_StrD
			End If
			If l_SearchHistoryMdlObject.l_ReceptEnd <> "" Then
				l_SearchHistoryMdlObject.l_ReceptEnd = _
					l_SearchHistoryMdlObject.l_EndY & "/" & _
					l_SearchHistoryMdlObject.l_EndM & "/" & _
					l_SearchHistoryMdlObject.l_EndD
			End If

				l_SearchHistoryMdlObject.l_SortKey = Session("DemandSearchHistory").Item("sortkey")
				l_SearchHistoryMdlObject.l_SortDesc = Session("DemandSearchHistory").Item("sortdesc")

			If CheckInHistory Then
				'DB傛傝忣曬庢摼
				Set l_SearchDataClaimOrderMasterObject = New SearchDataClaimOrderMaster
				Set l_RecordSet = l_SearchDataClaimOrderMasterObject.SearchDataClaimOrderBase(l_DBObject,l_SearchHistoryMdlObject,Session("DemandSearchHistory"))
			End If

		Else
			l_SearchHistoryMdlObject.l_ClaimMethod1 = "000001"
			l_SearchHistoryMdlObject.l_ClaimMethod2 = "000002"
			l_SearchHistoryMdlObject.l_SortKey = SORT_KEY1
			l_SearchHistoryMdlObject.l_SortDesc = FLG_ON

		'DB傛傝忣曬庢摼
			Set l_SearchDataClaimOrderMasterObject = New SearchDataClaimOrderMaster
			Set l_RecordSet = l_SearchDataClaimOrderMasterObject.SearchDataClaimOrderBase(l_DBObject,l_SearchHistoryMdlObject,Session("DemandSearchHistory"))
		End If

		If IsObject(l_RecordSet) Then
			'儗僐乕僪曇廤
			Dim l_retRec
			Dim l_cnt
		
			l_cnt = 0
			Do Until l_RecordSet.eof
				Set l_retRec = EditRec(l_RecordSet)
				l_retList.add CStr(l_cnt), l_retRec
				l_cnt = l_cnt + 1
				l_RecordSet.MoveNext
			Loop

			'儁乕僕惂屼梡偺僒僀僘丄審悢傪愝掕
			'l_RsPageCount = l_RecordSet.PageCount		'儁乕僕僒僀僘愝掕
			l_RsPageCount = Fix(l_retList.count / 20 + 0.95)		'儁乕僕僒僀僘愝掕
			l_RsRecordCount = l_retList.count	'儗僐乕僪審悢愝掕
			Set GetList = l_retList
		Else
			'儁乕僕惂屼梡偺僒僀僘丄審悢傪愝掕
			l_RsPageCount = 0
			l_RsRecordCount = 0

			Set GetList = l_retList
		End If

	End Function

	'/********************************************
	'/* 昞帵僨乕僞曇廤
	'/********************************************
	Public Function EditRec(l_rs)
		Dim l_rec
		Dim l_arr
		Set l_rec = New SearchHistoryMdl

		l_rec.l_DspReceptNo = l_rs.Fields.Item("RECEPT_NO")
		l_rec.l_DspReceptYmd = l_rs.Fields.Item("RECEPT_YMD")
		l_rec.l_inReceiveName = l_rs.Fields.Item("RECEIVE_NAME")
		'彫悢揰偑懚嵼偡傞応崌
		If InStr(l_rs.Fields.Item("SUB_TOTAL"),".") <> 0 Then
			l_arr = Split(l_rs.Fields.Item("SUB_TOTAL"),".")
			l_rec.l_DspSubTotal = l_CutilObject.NumericFormat(l_rs.Fields.Item("SUB_TOTAL"),true,Len(l_arr(1)))
		Else
			l_rec.l_DspSubTotal = l_CutilObject.NumericFormat(l_rs.Fields.Item("SUB_TOTAL"),true,0)
		End If
		l_rec.l_inBuilding = l_rs.Fields.Item("BUILDING")
		l_rec.l_inCompanyName = l_rs.Fields.Item("COMPANY_NAME")
		l_rec.l_inSectionName = l_rs.Fields.Item("SECTION_NAME")
		l_rec.l_inDeliveryId = l_rs.Fields.Item("DELIVERY_ID")
		l_rec.l_inClaimMethod = l_rs.Fields.Item("CLAIM_METHOD")
		l_rec.l_inTotalSituation = l_rs.Fields.Item("TOTAL_SITUATION")

		If l_rec.l_inDeliveryId <> "" Then
			l_rec.l_DspDelivery = "[" & l_rec.l_inDeliveryId & "] "
		End If
		If l_rec.l_inCompanyName <> "" Then
			l_rec.l_DspDelivery = l_rec.l_DspDelivery & l_rec.l_inCompanyName & " "
		End If
		If l_rec.l_inBuilding <> "" Then
			l_rec.l_DspDelivery = l_rec.l_DspDelivery & l_rec.l_inBuilding & " "
		End If
		If l_rec.l_inSectionName <> "" Then
			l_rec.l_DspDelivery = l_rec.l_DspDelivery & l_rec.l_inSectionName & " "
		End If

		l_rec.l_DspDelivery = l_rec.l_DspDelivery & " "

		l_rec.l_DspClaimMethod =  l_CommonObject.GetCodeName(l_DBObject,CD_METHOD,l_rec.l_inClaimMethod)
		l_rec.l_DspClaimSituation = l_CommonObject.GetCodeName(l_DBObject,CD_SITUATION,l_rec.l_inTotalSituation)

		Set EditRec = l_rec
	End Function

	'/********************************************
	'/* 僜乕僩帪偺俫俿俵俴儕儞僋庢摼
	'/* param丗String l_sortkey 僜乕僩僉乕
	'/* return丗String 俫俿俵俴暥帤楍
	'/********************************************
	Public Function GetSortParmHtml(l_sortkey,l_oldSortDesc)
		Dim l_retStr
		Dim l_newSortDesc

		'僜乕僩弴偺愝掕(徃弴佁崀弴愗傝懼偊)
		If l_oldSortDesc = FLG_ON Then
			l_newSortDesc = FLG_OFF		'崀弴仺徃弴
		Else 
			l_newSortDesc =  FLG_ON		'徃弴仺崀弴
		End If

		'僷儔儊乕僞亖僜乕僩僉乕丄専嶕忦審
		l_retStr = "sessave=" & "2"  &_
			"&sortkey=" & l_sortkey &_
			"&sortdesc=" & l_newSortDesc 
		GetSortParmHtml = l_retStr
	End Function

	'/*************************************
	'/ 堦棗僿僢僟
	'/ return:html
	'/*************************************
	Public Function ListHeadDsp
		Dim l_html
		Dim l_CRLF
		Dim l_sortdsp

		l_CRLF = Chr(13) & Chr(10)

		'僜乕僩弴丂徃弴丗(仾)丂崀弴丗(伀)
		If l_SearchHistoryMdlObject.l_SortDesc = FLG_ON Then
			l_sortdsp = "(伀)"
		Else
			l_sortdsp = "(仾)"
		End If

		l_html = "<tr align=""center"" bgcolor=""#333399""> " & l_CRLF &_
				 "<td class=""txt_m"" width=""80"" height=""20"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("2",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">庴晅斣崋"

		'庴晅斣崋偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "2" Then
			l_html = l_html & l_sortdsp
		End If

		l_html = l_html & "</font></a></td>" & l_CRLF &_
				 "<td class=""txt_m"" width=""110"" height=""20"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("3",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">庴晅擔帪"

		'庴晅擔帪偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "3" Then
			l_html = l_html & l_sortdsp
		End If

		l_html = l_html & "</font></a></td>" & l_CRLF &_
				 "<td class=""txt_m"" height=""20"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("4",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">攝憲愭"

		'攝憲愭偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "4" Then
			l_html = l_html & l_sortdsp
		End If
	
		l_html = l_html & "</font></a></td>" & l_CRLF &_
				 "<td class=""txt_m"" height=""20"" width=""70"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("5",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">嬥妟"

		'嬥妟偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "5" Then
			l_html = l_html & l_sortdsp
		End If
	
		l_html = l_html & "</font></a></td>" & l_CRLF &_
		  		 "<td class=""txt_m"" height=""20"" width=""70"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("6",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">惪媮曽朄"

		'惪媮曽朄偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "6" Then
			l_html = l_html & l_sortdsp
		End If
	
		l_html = l_html & "</font></a></td>" & l_CRLF &_
				 "<td class=""txt_m"" height=""20"" width=""70"">" &_
				 "<a href=""search_history.asp?" & GetSortParmHtml("7",l_SearchHistoryMdlObject.l_SortDesc) & """>" &_
				 "<font color=""#FFFFFF"">忬嫷"

		'惪媮曽朄偱僜乕僩偺応崌
		If l_SearchHistoryMdlObject.l_Sortkey = "7" Then
			l_html = l_html & l_sortdsp
		End If
	
		l_html = l_html & "</font></a></td>" & l_CRLF &_
				 "</tr>" & l_CRLF

		
		ListHeadDsp = l_html
	End Function
	'/********************************************
	'/* 僋儘乕僘
	'/********************************************
	Public Function Close
		Call l_DBObject.CloseRecodeset
		Call l_DBObject.CloseConnection
	End Function

	'/***************************************
	'/* 擖椡僠僃僢僋
	'/* return丗boolean
	'/***************************************
	Public Function CheckInHistory
		Dim l_ErrArray(5)
		Dim l_element
		Dim l_Index


		l_element = 0
		CheckInHistory = true

		'庴晅斣崋僠僃僢僋
		If Session("DemandSearchHistory").Item("recept_no") <> "" Then
			If l_CheckObject.number_chk(l_objbasp,Session("DemandSearchHistory").Item("recept_no")) = 0 Then
				l_ErrArray(l_element) = IG11018E
				l_element = l_element + 1
				CheckInHistory = false
			End If
		End If

		'庴晅擔(奐巒)僠僃僢僋
		If l_SearchHistoryMdlObject.l_ReceptStart <> "" Then
			If Not IsDate(l_SearchHistoryMdlObject.l_ReceptStart) Then
				l_ErrArray(l_element) = IG11019E
				l_element = l_element + 1
				CheckInHistory = false
			End If
		End If

		'庴晅擔(廔椆)僠僃僢僋
		If l_SearchHistoryMdlObject.l_ReceptEnd <> "" Then
			If Not IsDate(l_SearchHistoryMdlObject.l_ReceptEnd) Then
				l_ErrArray(l_element) = IG11020E
				l_element = l_element + 1
				CheckInHistory = false
			End If
		End If

		'庴晅擔(奐巒偲廔椆)僠僃僢僋
		If l_SearchHistoryMdlObject.l_ReceptStart <> "" and l_SearchHistoryMdlObject.l_ReceptEnd <> "" Then
			If l_SearchHistoryMdlObject.l_ReceptStart > l_SearchHistoryMdlObject.l_ReceptEnd Then
				l_ErrArray(l_element) = IG11027E
				l_element = l_element + 1
				CheckInHistory = false
			End If
		End If

		ReDim l_ReErrArray(l_element)

		If Not CheckInHistory Then
			For l_Index = 0 to l_element
				l_ReErrArray(l_Index) = l_ErrArray(l_Index)
			Next
			Session("ErrMsg") = l_ReErrArray
		End If
	End Function
End Class

'/************************************
'/*専嶕忦審曐帩僋儔僗
'/************************************
Class SearchHistoryMdl
	Dim l_SystemId
	Dim l_CompanyId
	Dim l_SectionId
	Dim l_UserId
	Dim l_UserName
	Dim l_SortKey
	Dim l_SortDesc

	'専嶕忦審擖椡棑崁栚
	Dim l_ReceptNo
	Dim l_ClaimSituation
	Dim l_StrY,l_StrM,l_StrD
	Dim l_ReceptStart
	Dim l_EndY,l_EndM,l_EndD
	Dim l_ReceptEnd
	Dim l_ClaimMethod1
	Dim l_ClaimMethod2
	Dim l_ClaimMethod3

	Dim l_DspReceptNo
	Dim l_DspReceptYmd
	Dim l_DspDelivery
	Dim l_DspSubTotal
	Dim l_DspClaimMethod
	Dim l_DspClaimSituation
	Dim l_inReceiveName
	Dim l_inBuilding
	Dim l_inCompanyName
	Dim l_inSectionName
	Dim l_inDeliveryId
	Dim l_inClaimMethod
	Dim l_inTotalSituation

End Class
%>

⌨️ 快捷键说明

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