📄 goodsdao.cls
字号:
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
judge_goods = True
Else
judge_goods = False
End If
End With
Exit Function
Cwcl:
judge_goods = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :显示商品名称函数
'* 输 入 参 数 :无
'* 输 出 参 数 :true -新增成功
'* false -新增失败
'**************************************
Public Function name_goods(recSet As ADODB.Recordset, goodsid As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
name_goods = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "show_goods_name" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = goodsid ' 商品编号
' 执行命令 把查询到的结果放在recSet中
On Error GoTo Cwcl
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
name_goods = True
Else
name_goods = False
End If
End With
Exit Function
Cwcl:
name_goods = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :判断该商品是不是已经入库
'* 输 入 参 数 :无
'* 输 出 参 数 :true -新增成功
'* false -新增失败
'**************************************
Public Function judge_position_goods(recSet As ADODB.Recordset, goodsid As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
judge_position_goods = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "judge_position_goods" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = goodsid ' 商品编号
' 执行命令 把查询到的结果放在recSet中
On Error GoTo Cwcl
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
' With recSet
' If Not .EOF Then
' judge_position_goods = True
' Else
' judge_position_goods = False
' End If
' End With
Exit Function
Cwcl:
judge_position_goods = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :判断该商品是不是已经存在供应商表中
'* 输 入 参 数 :无
'* 输 出 参 数 :true -新增成功
'* false -新增失败
'**************************************
Public Function judge_goods1(recSet As ADODB.Recordset, supplierId As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
judge_goods1 = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "relation_findid" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = supplierId ' 商品编号
' 执行命令 把查询到的结果放在recSet中
On Error GoTo Cwcl
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
judge_goods1 = True
Else
judge_goods1 = False
End If
End With
Exit Function
Cwcl:
judge_goods1 = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :判断修改所填商品函数
'* 输 入 参 数 :无
'* 输 出 参 数 :true -新增成功
'* false -新增失败
'**************************************
Public Function goods2_show(recSet As ADODB.Recordset, name As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
goods2_show = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "goods2_show" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = name ' 商品编号
' 执行命令 把查询到的结果放在recSet中
On Error GoTo Cwcl
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
goods2_show = True
Else
goods2_show = False
End If
End With
Exit Function
Cwcl:
goods2_show = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :根据商品ID从表中显示一条商品记录
'* 输 入 参 数 :无
'* 输 出 能 数 :True - 数据库连接成功
'* False - 数据库连接失败
'**************************************
Public Function goods_showone(recSet As ADODB.Recordset, goodsid As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
goods_showone = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "goods_showone" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = goodsid ' 参数
On Error GoTo Cwcl
' 执行命令 把查询到的结果放在recSet中
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
goods_showone = True
Else
goods_showone = False
End If
End With
Exit Function
Cwcl:
goods_showone = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :根据商品ID从表中显示一条商品记录
'* 输 入 参 数 :无
'* 输 出 能 数 :True - 数据库连接成功
'* False - 数据库连接失败
'**************************************
Public Function goods_showone1(recSet As ADODB.Recordset, goodsid As String, warehouseid As String) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
goods_showone1 = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "goods_showone1" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
cmdProc.Parameters(1) = goodsid ' 参数
cmdProc.Parameters(2) = warehouseid
On Error GoTo Cwcl
' 执行命令 把查询到的结果放在recSet中
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
goods_showone1 = True
Else
goods_showone1 = False
End If
End With
Exit Function
Cwcl:
goods_showone1 = False
Exit Function
End Function
'**************************************
'* 功 能 描 述 :查询显示所有商品函数
'* 输 入 参 数 :无
'* 输 出 参 数 :true -新增成功
'* false -新增失败
'**************************************
Public Function goods_showoneList(recSet As ADODB.Recordset) As Boolean
Dim cmdProc As ADODB.Command ' 执行存储过程的命令
goods_showoneList = False
Set cmdProc = New ADODB.Command
Set cmdProc.ActiveConnection = MainForm.g_application.m_databaseCon.m_adoConnection
' 执行存储过程的命令的设置
cmdProc.CommandText = "goods_showoneList" ' 指定存储过程的名子
cmdProc.CommandType = adCmdStoredProc
cmdProc.Parameters.Refresh
' 执行命令 把查询到的结果放在recSet中
On Error GoTo Cwcl
With recSet
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmdProc
End With
With recSet
If Not .EOF Then
goods_showoneList = True
Else
goods_showoneList = False
End If
End With
Exit Function
Cwcl:
goods_showoneList = False
Exit Function
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -