📄 searchhistorymain.asp
字号:
<%
'/************************************
'/*帒椏惪媮堦棗儊僀儞僋儔僗
'/************************************
Class SearchHistoryMain
Dim l_CutilObject
Dim l_CommonObject
Dim l_PgCtrlObject
Dim l_DBObject
Dim l_Page
Dim l_RsPageCount
Dim l_RsRecordCount
Dim l_DemandHistoryMdlObject
Dim l_Basp
'/********************************************
'/* 弶婜張棟
'/********************************************
Public Function Init()
Set l_CutilObject = New CharUtil
Set l_CommonObject = New Common
Set l_PgCtrlObject = New PageControl
Set l_DemandHistoryMdlObject = New DemandHistoryMdl
Set l_Basp = Server.CreateObject("basp21")
Call l_CommonObject.SearchSession
'DB僐僱僋僔儑儞庢摼
Set l_DBObject = New DbAccess
Call l_DBObject.ProcConnection(DSN,USERID,PASSWD)
'僙僢僔儑儞傛傝儐乕僓乕忣曬庢摼
l_DemandHistoryMdlObject.l_SystemId = Session("User").Item("SYSTEM_ID")
l_DemandHistoryMdlObject.l_CompanyId = Session("User").Item("COMPANY_ID")
l_DemandHistoryMdlObject.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_SearchMasterObject
Dim l_RecordSet
Dim l_retList,l_retRec,l_cnt
Dim l_Result
Dim l_dic
l_Result = True
'擖椡抣愝掕
Call l_CommonObject.SetSearchInfoSession("DemandHistory")
'僙僢僔儑儞忣曬懚嵼僠僃僢僋
If IsObject(Session("DemandHistory")) Then
If Session("DemandHistory").Item("recept_no") <> "" Then
l_DemandHistoryMdlObject.l_inReceptNo = Replace(l_CutilObject.html_chg(l_Basp,Session("DemandHistory").Item("recept_no")),"""",""")
End If
l_DemandHistoryMdlObject.l_StrY = Session("DemandHistory").Item("recept_start_year")
l_DemandHistoryMdlObject.l_StrM = Session("DemandHistory").Item("recept_start_mon")
l_DemandHistoryMdlObject.l_StrD = Session("DemandHistory").Item("recept_start_day")
l_DemandHistoryMdlObject.l_ReceptStart = l_DemandHistoryMdlObject.l_StrY & _
l_DemandHistoryMdlObject.l_StrM & _
l_DemandHistoryMdlObject.l_StrD
l_DemandHistoryMdlObject.l_EndY = Session("DemandHistory").Item("recept_end_year")
l_DemandHistoryMdlObject.l_EndM = Session("DemandHistory").Item("recept_end_mon")
l_DemandHistoryMdlObject.l_EndD = Session("DemandHistory").Item("recept_end_day")
l_DemandHistoryMdlObject.l_ReceptEnd = l_DemandHistoryMdlObject.l_EndY & _
l_DemandHistoryMdlObject.l_EndM & _
l_DemandHistoryMdlObject.l_EndD
If l_DemandHistoryMdlObject.l_ReceptStart <> "" Then
l_DemandHistoryMdlObject.l_ReceptStart = _
l_DemandHistoryMdlObject.l_StrY & "/" & _
l_DemandHistoryMdlObject.l_StrM & "/" & _
l_DemandHistoryMdlObject.l_StrD
End If
If l_DemandHistoryMdlObject.l_ReceptEnd <> "" Then
l_DemandHistoryMdlObject.l_ReceptEnd = _
l_DemandHistoryMdlObject.l_EndY & "/" & _
l_DemandHistoryMdlObject.l_EndM & "/" & _
l_DemandHistoryMdlObject.l_EndD
End If
l_DemandHistoryMdlObject.l_Situation = Session("DemandHistory").Item("claim_situation")
l_DemandHistoryMdlObject.l_Method1 = Session("DemandHistory").Item("method1")
l_DemandHistoryMdlObject.l_Method2 = Session("DemandHistory").Item("method2")
l_DemandHistoryMdlObject.l_Method3 = Session("DemandHistory").Item("method3")
l_DemandHistoryMdlObject.l_Method4 = Session("DemandHistory").Item("method4")
l_DemandHistoryMdlObject.l_SortKey = Session("DemandHistory").Item("sortkey")
l_DemandHistoryMdlObject.l_SortDesc = Session("DemandHistory").Item("sortdesc")
'擖椡僠僃僢僋
l_Result = CheckInput(l_DemandHistoryMdlObject)
Else
Set l_dic = CreateObject("Scripting.Dictionary")
l_dic.add "method1","000001"
l_dic.add "method2","000002"
l_dic.add "sortkey",SORT_KEY1
l_dic.add "sortdesc",FLG_ON
Set Session("DemandHistory") = l_dic
l_DemandHistoryMdlObject.l_Method1 = CLM_METHOD_NOMAL
l_DemandHistoryMdlObject.l_Method2 = CLM_METHOD_KANI
l_DemandHistoryMdlObject.l_SortKey = SORT_KEY1
l_DemandHistoryMdlObject.l_SortDesc = FLG_ON
End If
Set l_retList = CreateObject("Scripting.Dictionary")
If l_Result Then
'DB傛傝忣曬庢摼
Set l_SearchMasterObject = New SearchHistoryMaster
Set l_RecordSet = l_SearchMasterObject.SearchDemandBase(l_DBObject,l_DemandHistoryMdlObject,Session("DemandHistory"))
'儗僐乕僪曇廤
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 = Fix(l_retList.Count / 20 + 0.95) '儁乕僕僒僀僘愝掕
l_RsRecordCount = l_retList.Count '儗僐乕僪審悢愝掕
End If
Set GetList = l_retList
End Function
Public Function EditRec(l_rs)
Dim l_rec
Dim l_tmp_arr
Set l_rec = New DemandHistoryMdl
l_rec.l_ReceptNo = l_rs.Fields.Item("RECEPT_NO")
l_rec.l_ReceptYmd = l_rs.Fields.Item("RECEPT_YMD")
l_rec.l_DeliveryId = l_rs.Fields.Item("DELIVERY_ID")
l_rec.l_CompanyName = l_rs.Fields.Item("COMPANY_NAME")
l_rec.l_SectionName = l_rs.Fields.Item("SECTION_NAME")
l_rec.l_Building = l_rs.Fields.Item("BUILDING")
'彫悢揰偑偁傞応崌
If InStr(l_rs.Fields.Item("SUB_TOTAL"),".") <> 0 Then
l_tmp_arr = Split(l_rs.Fields.Item("SUB_TOTAL"),".")
l_rec.l_SubTotal = l_CutilObject.NumericFormat(l_rs.Fields.Item("SUB_TOTAL"),true,Len(l_tmp_arr(1)))
Else
l_rec.l_SubTotal = l_CutilObject.NumericFormat(l_rs.Fields.Item("SUB_TOTAL"),true,0)
End If
l_rec.ClaimMethod = l_rs.Fields.Item("CLAIM_METHOD")
'l_rec.ClaimSituation = l_rs.Fields.Item("CLAIM_SITUATION")
l_rec.l_TotalSituation = l_rs.Fields.Item("TOTAL_SITUATION")
l_rec.l_DspDelivery = "[" & l_rec.l_DeliveryId & "] " & l_rec.l_CompanyName & " " & _
l_rec.l_Building & " " & l_rec.l_SectionName
'l_rec.l_DspClaimMethod = l_CommonObject.GetCodeName(l_DBObject,CD_METHOD,l_rec.ClaimMethod)
'2006/1/11 曄峏
l_rec.l_DspClaimMethod = l_rs.Fields.Item("CLAIM_METHOD_NAME")
'l_rec.l_DspClaimSituation = l_CommonObject.GetCodeName(l_DBObject,CD_SITUATION,l_rec.ClaimSituation)
'l_rec.l_DspTotalSituation = l_CommonObject.GetCodeName(l_DBObject,CD_SITUATION,l_rec.l_TotalSituation)
l_rec.l_DspTotalSituation = l_rs.Fields.Item("TOTAL_SITUATION_NAME")
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
'/********************************************
'/* 僋儘乕僘
'/********************************************
Public Function Close
Call l_DBObject.CloseRecodeset
Call l_DBObject.CloseConnection
End Function
'/********************************************
'/* 擖椡僠僃僢僋
'/* param丗l_mdl丂挔昜堦棗専嶕忦審曐帩梡僋儔僗
'/* return丗boolean
'/********************************************
Public Function CheckInput(Mdl)
Dim l_Index
Dim l_CharUtil
Dim l_CheckUtil
CheckInput = True
Set l_CharUtil = New CharUtil
Set l_CheckUtil = New CheckUtil
l_Index = 0
'庴晅斣崋僠僃僢僋
If Mdl.l_inReceptNo <> "" Then
If l_CheckUtil.number_chk(l_Basp,Mdl.l_inReceptNo) = 0 Then
l_ErrArray(l_Index) = IG11018E
l_Index = l_Index + 1
CheckInput = False
End If
End If
'庴晅擔(奐巒)
If Not l_CheckUtil.IsYMD(Mdl.l_StrY,Mdl.l_StrM,Mdl.l_StrD) Then
' l_errarray(l_Index) = "庴晅擔(奐巒)偑晄惓偱偡"
l_errarray(l_Index) = IG11019E
l_Index = l_Index + 1
CheckInput = False
End If
'庴晅擔(廔椆)
If Not l_CheckUtil.IsYMD(Mdl.l_EndY,Mdl.l_EndM,Mdl.l_EndD) Then
' l_errarray(l_Index) = "庴晅擔(廔椆)偑晄惓偱偡"
l_errarray(l_Index) = IG11020E
l_Index = l_Index + 1
CheckInput = False
End If
'2005/12/12捛壛
'庴晅擔(奐巒偲廔椆)僠僃僢僋
If l_DemandHistoryMdlObject.l_StrY <> "" And l_DemandHistoryMdlObject.l_StrM <> "" And l_DemandHistoryMdlObject.l_StrD <> "" And _
l_DemandHistoryMdlObject.l_EndY <> "" And l_DemandHistoryMdlObject.l_EndM <> "" And l_DemandHistoryMdlObject.l_EndD <> "" Then
If l_DemandHistoryMdlObject.l_ReceptStart > l_DemandHistoryMdlObject.l_ReceptEnd Then
l_errarray(l_Index) = IG11027E
l_Index = l_Index + 1
CheckInput = False
End If
End If
End Function
'/*************************************
'/ 堦棗僿僢僟
'/ return:html
'/*************************************
Public Function ListHeadDsp
Dim l_html
Dim l_CRLF
Dim l_sortdsp
l_CRLF = Chr(13) & Chr(10)
'僜乕僩弴丂徃弴丗(仾)丂崀弴丗(伀)
If l_DemandHistoryMdlObject.l_SortDesc = FLG_ON Then
l_sortdsp = "(伀)"
Else
l_sortdsp = "(仾)"
End If
l_html = "<tr align=""center"" bgcolor=""#666666""> " & l_CRLF &_
"<td class=""txt_m"" width=""80"" height=""20"">" &_
"<a href=""search_history.asp?" & GetSortParmHtml("2",l_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">庴晅斣崋"
'庴晅斣崋偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">庴晅擔帪"
'庴晅擔帪偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">攝憲愭"
'攝憲愭偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">嬥妟"
'嬥妟偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">惪媮曽朄"
'惪媮曽朄偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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=""60"" bgcolor=""#666666"">" &_
"<a href=""search_history.asp?" & GetSortParmHtml("7",l_DemandHistoryMdlObject.l_SortDesc) & """>" &_
"<font color=""#FFFFFF"">忬嫷"
'忬嫷偱僜乕僩偺応崌
If l_DemandHistoryMdlObject.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
End Class
'/************************************
'/*専嶕忦審曐帩僋儔僗
'/************************************
Class DemandHistoryMdl
Dim l_SystemId
Dim l_CompanyId
Dim l_UserName
Dim l_SortKey
Dim l_SortDesc
'専嶕忦審擖椡棑崁栚
Dim l_inReceptNo
Dim l_StrY,l_StrM,l_StrD
Dim l_ReceptStart
Dim l_EndY,l_EndM,l_EndD
Dim l_ReceptEnd
Dim l_Situation
Dim l_Method1
Dim l_Method2
Dim l_Method3
Dim l_Method4
'昞帵崁栚
Dim l_ReceptNo
Dim l_ReceptYmd
Dim l_DeliveryId
Dim l_CompanyName
Dim l_SectionName
Dim l_Building
Dim l_SubTotal
Dim ClaimMethod
Dim ClaimSituation
Dim l_TotalSituation
Dim l_DspDelivery
Dim l_DspClaimMethod
Dim l_DspClaimSituation
Dim l_DspTotalSituation
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -