strURL = DBEngine.LocationDir'系统远程目录,如http://www.oapro.com/
'在此统一定义数据源名称变量,以方便以后修改
g_strSource_Base = "干部基本情况"
g_strSource_JianLi = "工作简历"
'控制是否允许编辑的变量
g_bCanEdit_Base = FALSE
g_bCanEdit_JianLi = FALSE
'注释:
Sub DBEngine_EventLoad(strInitData, strInitType)
Page1_EditBox64.Visible=false
'使输入控件处于失效状态
call SetEnableInput(g_strSource_Base, FALSE)
call SetEnableInput(g_strSource_JianLi, FALSE)
End Sub
'-----------------------------------------------------------------------------------------------
'首记录按钮
Sub FirstRecord_Click()
Call DBEngine.FirstRecord(g_strSource_Base)
End Sub
'下一记录按钮
Sub NextRecord_Click()
Call DBEngine.NextRecord(g_strSource_Base)
End Sub
'前一记录按钮
Sub PrevRecord_Click()
Call DBEngine.PrevRecord(g_strSource_Base)
End Sub
'尾记录按钮
Sub LastRecord_Click()
Call DBEngine.LastRecord(g_strSource_Base)
End Sub
'响应新记录按钮
Sub NewRecord_Click()
Call DBEngine.NewRecord(g_strSource_Base)
End Sub
'响应保存按钮
Sub SaveRecord_Click()
Call DBEngine.SaveRecord(g_strSource_Base)
End Sub
'响应删除记录按钮
Sub DeleteRecord_Click()
call DBEngine.DeleteRecord(g_strSource_Base)
End Sub
'响应关闭按钮
Sub CloseWindow_Click()
DBEngine.CloseWindow(0)
End Sub
Sub GongZuoJianLiGrid_EventWebFunction(strFunName, strInputXML, strOutputXML)
GongZuoJianLiGrid.SetWebFunReturnValue(DBEngine.WebFunction(strFunName, strInputXML, strOutputXML))
End Sub
Sub JiaTingGird_EventWebFunction(strFunName, strInputXML, strOutputXML)
JiaTingGird.SetWebFunReturnValue(DBEngine.WebFunction(strFunName, strInputXML, strOutputXML))
End Sub
Sub btnSend_Click()
strInput = "<Input><FromTable>干部任免</FromTable><SQLWhere>"&DBEngine.GetSQLWhere&"</SQLWhere></Input>"
strRet = DBEngine.WebFunction("SendXmlData", strInput, "")
strError = DBEngine.GetElemData(strRet, "Error")
if strError <> "" then
DBEngine.MsgBox(strError)
elseif strRet = "1" then
DBEngine.MsgBox("发送成功!")
end if
End Sub
Sub DBEngine1_EventUserEnvent(strEventName, strInputXML)
if strEventName = "TabCtrlCanChange" And strInputXML = "基本情况" then
if DBEngine.IsNewRecord = true then
MsgBox("请先保存数据")
DBEngine.SetUserEventReturnValue("0")
End if
End if
MsgBox strEventName
if strEventName = "SaveRecord" then '外界(如工作流)调用保存函数
DBEngine.SetUserEventReturnValue(SaveRecord())
end if
End Sub
'注释:
Sub DBEngine_EventUserEvent(strEventName, strInputXML)
if strEventName = "GetName" then
DBEngine_EventUserEvent = "AVASVFS"
End if
End Sub
'-----------------------------------------------------------------------------------------------
'首记录按钮
Sub Page1_FirstRecord_Click()
Call DBEngine.FirstRecord(g_strSource_JianLi)
End Sub
'下一记录按钮
Sub Page1_NextRecord_Click()
Call DBEngine.NextRecord(g_strSource_JianLi)
End Sub
'前一记录按钮
Sub Page1_PrevRecord_Click()
Call DBEngine.PrevRecord(g_strSource_JianLi)
End Sub
'尾记录按钮
Sub Page1_LastRecord_Click()
Call DBEngine.LastRecord(g_strSource_JianLi)
End Sub
'响应新记录按钮
Sub Page1_NewRecord_Click()
Call DBEngine.NewRecord(g_strSource_JianLi)
End Sub
'响应保存按钮
Sub Page1_SaveRecord_Click()
Call DBEngine.SaveRecord(g_strSource_JianLi)
Page2_DBGrid18.UpdateFromDataSourceUrl("")
End Sub
'响应删除记录按钮
Sub Page1_DeleteRecord_Click()
call DBEngine.DeleteRecord(g_strSource_JianLi)
Page2_DBGrid18.UpdateFromDataSourceUrl("")
End Sub
Sub Page2_DBGrid18_EventWebFunction(strFunName, strInputXML, strOutputXML)
Page2_DBGrid18.SetWebFunReturnValue(DBEngine.WebFunction(strFunName, strInputXML, strOutputXML))
End Sub
'响应网络当前行改变事件
Sub Page2_DBGrid18_EventCurRowChanged(nRowIndex)
'改变数据引擎的当前记录
if DBEngine.GetCurIndex(g_strSource_JianLi) <> nRowIndex-Page2_DBGrid18.GetFixedRowCount then
call DBEngine.GoToRecord(g_strSource_JianLi, nRowIndex-Page2_DBGrid18.GetFixedRowCount())
End If
End Sub
'注释:响应"基本情况"编辑按钮
Sub EditRecord_Click()
'使"基本情况"数据源的输入控件处于有效状态
if g_bCanEdit_Base = FALSE then
g_bCanEdit_Base = TRUE
EditRecord.Caption = "取消编辑"
else
g_bCanEdit_Base = FALSE
EditRecord.Caption = "编辑记录"
end if
call SetEnableInput(g_strSource_Base, g_bCanEdit_Base)
End Sub
'-----------------------------------------------------------------------------------------------
'注释:响应"工作简历"编辑按钮
Sub Page1_EditRecord_Click()
'使"基本情况"数据源的输入控件处于有效状态
if g_bCanEdit_JianLi = FALSE then
g_bCanEdit_JianLi = TRUE
Page1_EditRecord.Caption = "取消编辑"
else
g_bCanEdit_JianLi = FALSE
Page1_EditRecord.Caption = "编辑记录"
end if
call SetEnableInput(g_strSource_JianLi, g_bCanEdit_JianLi)
End Sub