📄 maintemain.asp
字号:
<%
Class MainteMain
Dim l_MainteMdlObject
Dim l_DBObject
Dim l_Regist
Dim l_Delete
Dim l_Update
Dim l_Mainte
Dim l_CheckUtil
Dim l_CharUtil
Dim l_Basp
Dim l_ErrCnt,l_ErrArray()
Public Function Init()
Set l_MainteMdlObject = New MainteMdl
'DB僐僱僋僔儑儞庢摼
Set l_DBObject = New DbAccess
Call l_DBObject.ProcConnection(DSN,USERID,PASSWD)
'僙僢僔儑儞傛傝儐乕僓乕忣曬庢摼
l_MainteMdlObject.l_SystemId = Session("User").Item("SYSTEM_ID")
l_MainteMdlObject.l_CompanyId = Session("User").Item("COMPANY_ID")
l_MainteMdlObject.l_UserName = Session("User").Item("NAME")
'慜夋柺儃僞儞墴壓忬嫷庢摼
l_Regist = Request.Form("regist")
l_Delete = Request.Form("delete")
l_Mainte = Request.Form("section")
l_Update = Request.QueryString("P1")
End Function
Public Function GetFormParam()
'搊榐偡傞儃僞儞墴壓帪
If l_Regist <> "" Then
'擖椡僠僃僢僋
Set l_CheckUtil = New CheckUtil
Set l_CharUtil = New CharUtil
Set l_Basp = Server.CreateObject("basp21")
l_ErrCnt = 0
'暘椶僐乕僪僠僃僢僋
If Request.Form("classified") = "" Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11056E
l_ErrCnt = l_ErrCnt + 1
Else
If l_CheckUtil.number_chk(l_Basp,Request.Form("classified")) = 0 Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11057E
l_ErrCnt = l_ErrCnt + 1
End If
End If
'柤徧僠僃僢僋
If Request.Form("classified_name") = "" Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG07013E
l_ErrCnt = l_ErrCnt + 1
End If
'暘椶侾寘悢僠僃僢僋丂11/4
If Request.Form("category") = CD_CLASS1 Then
If Len(Request.Form("classified_name")) > 15 Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG12001W
l_ErrCnt = l_ErrCnt + 1
End If
End If
'嬫暘寘悢僠僃僢僋丂11/4
If Request.Form("category") = CD_CLASS Then
If Len(Request.Form("classified_name")) > 10 Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG12002W
l_ErrCnt = l_ErrCnt + 1
End If
End If
'僄儔乕桳柍敾掕
If l_ErrCnt > 0 then
Session("ErrMsg") = l_ErrArray
Response.ReDirect "../error.asp"
End If
'慜夋柺傛傝忣曬庢摼
l_MainteMdlObject.l_CategoryId = Request.Form("category")
l_MainteMdlObject.l_ClassifiedId = Request.Form("classified")
'僇僥僑儕偑帒椏惪媮丂僇儔乕埲奜偺応崌丗慡妏曄姺
If l_MainteMdlObject.l_CategoryId = CD_CLASS1_COLOR Then
l_MainteMdlObject.l_ClassifiedName = l_CharUtil.kinsoku_chg(l_Basp,Request.Form("classified_name"))
l_MainteMdlObject.l_ClassifiedName = l_CharUtil.str_conv(l_Basp,l_MainteMdlObject.l_ClassifiedName,8)
Else
l_MainteMdlObject.l_ClassifiedName = l_CharUtil.chg_HantoZen(Request.Form("classified_name"))
End If
l_MainteMdlObject.l_Status = Request.Form("status")
If l_MainteMdlObject.l_Status = "" Then
l_MainteMdlObject.l_Status = "0"
End If
End If
'嶍彍儃僞儞墴壓帪
If l_Mdm.l_Delete <> "" Then
'慜夋柺傛傝僇僥僑儕ID丄暘椶僐乕僪庢摼
l_MainteMdlObject.l_CategoryId = Request.Form("category")
l_MainteMdlObject.l_ClassifiedId = Request.Form("classified")
End If
End Function
Public Function MainteUpdate()
l_ErrCnt = 0
MainteUpdate = true
'暘椶懚嵼僠僃僢僋
If Not l_Mm.CheckMainte(l_DBObject,l_MainteMdlObject) Then
'晹栧憓擖
If Not l_Mm.InsertMainte(l_DBObject,l_MainteMdlObject) Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11041E
l_ErrCnt = l_ErrCnt + 1
MainteUpdate = false
End If
Else
If l_Update = "UPDATE" Then
'峏怴帪
If Not l_Mm.UpdateMainte(l_DBObject,l_MainteMdlObject) Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11042E
l_ErrCnt = l_ErrCnt + 1
MainteUpdate = false
End If
Else
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11043E
l_ErrCnt = l_ErrCnt + 1
MainteUpdate = false
End If
End If
If l_ErrCnt > 0 Then
Session("ErrMsg") = l_ErrArray
Response.ReDirect "../error.asp"
End If
End Function
Public Function MainteDelete()
MainteDelete = true
'暘椶懚嵼僠僃僢僋
If l_Mm.CheckMainte(l_DBObject,l_MainteMdlObject) Then
'晹栧嶍彍
If Not l_Mm.DeleteMainte(l_DBObject,l_MainteMdlObject) Then
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11044E
l_ErrCnt = l_ErrCnt + 1
MainteDelete = false
End If
Else
Redim Preserve l_ErrArray(l_ErrCnt)
l_ErrArray(l_ErrCnt) = IG11045E
l_ErrCnt = l_ErrCnt + 1
MainteDelete = false
End If
If l_ErrCnt > 0 Then
Session("ErrMsg") = l_ErrArray
Response.ReDirect "../error.asp"
End If
End Function
End Class
Class MainteMdl
Dim l_SystemId
Dim l_CompanyId
Dim l_UserName
'擖椡棑崁栚
Dim l_CategoryId
Dim l_ClassifiedId
Dim l_ClassifiedName
Dim l_Status
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -