📄 maintemaster.asp
字号:
<%
Class MainteMaster
Dim l_SQL
Dim l_Cost
'暘椶忣曬庢摼
Public Function SearchMainteBase(Param1,Param2,Param3)
'SQL暥惗惉
l_SQL = "SELECT ROWNUM,CA_M.CLASSIFIED_CODE,CA_M.CLASSIFIED_NAME,C_M.CODE,C_M.NAME,C_M.STATUS" & _
" FROM CATEGORY_M CA_M,CODE_M C_M" & _
" WHERE CA_M.SYSTEM_ID = '" & Param2.l_SystemId & "'" & _
" AND CA_M.SYSTEM_ID = C_M.SYSTEM_ID" & _
" AND CA_M.CLASSIFIED_CODE = C_M.CLASSIFIED_CODE" & _
" AND CA_M.UPDATE_POSSIBLE = '1'" & _
" AND CA_M.DEL_FLG = '0'" & _
" AND CA_M.DEL_FLG = C_M.DEL_FLG"
If IsObject(Param3) Then
If Param3.Item("category") <> "" Then
l_SQL = l_SQL & " AND CA_M.CLASSIFIED_CODE = '" & Param2.l_SearchCategoryId & "'"
End If
If Param3.Item("status") <> "" Then
l_SQL = l_SQL & " AND C_M.STATUS = '" & Param2.l_SearchStatus & "'"
End If
l_SQL = l_SQL & " ORDER BY " & GetOrderByStr(Param3.Item("sortkey"),Param3.Item("sortdesc"))
Else
l_SQL = l_SQL & " ORDER BY CA_M.CLASSIFIED_CODE,C_M.CODE"
End If
'response.write l_SQL & "<br>"
'僨僶僢僌暥
debug_t("SQL丗" & l_SQL)
Set SearchMainteBase = Param1.ProcRecordset(l_SQL,20,0)
End Function
Public Function GetOrderByStr(l_sortkey, l_sortdesc)
Dim l_retStr
Dim l_seq
'僜乕僩弴愝掕
If l_sortdesc = FLG_ON Then
l_seq = " DESC"
End If
'僜乕僩暥嶌惉
If l_sortkey = SORT_KEY1 Then '僨僼僅儖僩(僇僥僑儕僐乕僪(徃弴)丄暘椶僐乕僪(徃弴))
l_retStr = "CA_M.CLASSIFIED_CODE,C_M.CODE"
ElseIf l_sortkey = SORT_KEY2 Then '僇僥僑儕柤弴
l_retStr = "CA_M.CLASSIFIED_NAME" & l_seq
ElseIf l_sortkey = SORT_KEY3 Then '暘椶僐乕僪弴
l_retStr = "C_M.CODE" & l_seq
ElseIf l_sortkey = SORT_KEY4 Then '柤徧弴
l_retStr = "C_M.NAME" & l_seq
ElseIf l_sortkey = SORT_KEY5 Then '忬嫷弴
l_retStr = "C_M.STATUS" & l_seq
End If
GetOrderByStr = l_retStr
End Function
'暘椶僐乕僪懚嵼僠僃僢僋
Public Function CheckMainte(Param1,Param2)
Dim l_RecSet
CheckMainte = False
'SQL暥惗惉
l_SQL = "SELECT COUNT(*) FROM CODE_M" & _
" WHERE SYSTEM_ID = '" & Param2.l_SystemId & "'" & _
" AND CLASSIFIED_CODE = '" & Param2.l_CategoryId & "'" & _
" AND CODE = '" & Param2.l_ClassifiedId & "'"
Set l_RecSet = Param1.ProcRecordset(l_SQL,10,0)
'懚嵼偡傟偽True丄側偗傟偽False
If l_RecSet.Fields.Item("COUNT(*)") <> 0 Then
CheckMainte = True
End If
End Function
'暘椶嶍彍
Public Function DeleteMainte(Param1,Param2)
DeleteMainte = True
l_SQL = "UPDATE CODE_M SET DEL_FLG = '1'," & _
" UPDATE_YMD = SYSDATE " &_
" WHERE SYSTEM_ID = '" & Param2.l_SystemId & "'" & _
" AND CLASSIFIED_CODE = '" & Param2.l_CategoryId & "'" & _
" AND CODE = '" & Param2.l_ClassifiedId & "'"
'SQL敪峴
If Not Param1.ProcExecute(l_SQL) Then
Param1.ProcRollBack
DeleteMainte = False
Exit Function
End If
End Function
'暘椶憓擖
Public Function InsertMainte(Param1,Param2)
InsertMainte = True
'SQL暥惗惉
l_SQL = "INSERT INTO CODE_M VALUES ('" & Param2.l_SystemId & "','" & _
Param2.l_CategoryId & "','" & _
Param2.l_ClassifiedId & "','" & _
Param2.l_ClassifiedName & "','" & _
Param2.l_Status & "'," & _
"SYSDATE,null,'0')"
'SQL敪峴
If Not Param1.ProcExecute(l_SQL) Then
Param1.ProcRollBack
InsertMainte = False
Exit Function
End If
End Function
'暘椶峏怴
Public Function UpdateMainte(Param1,Param2)
UpdateMainte = True
l_SQL = "UPDATE CODE_M SET NAME = '" & Param2.l_ClassifiedName & "'," & _
"STATUS = '" & Param2.l_Status & "'," & _
"UPDATE_YMD = SYSDATE" & _
" WHERE SYSTEM_ID = '" & Param2.l_SystemId & "'" & _
" AND CLASSIFIED_CODE = '" & Param2.l_CategoryId & "'" & _
" AND CODE = '" & Param2.l_ClassifiedId & "'"
'SQL敪峴
If Not Param1.ProcExecute(l_SQL) Then
Param1.ProcRollBack
UpdateMainte = False
Exit Function
End If
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -