📄 checkvaluegroupform.frm
字号:
End Sub
Private Sub hfg_houseList_DblClick()
checkvaluegroupsingleform.m_operatorType = 1 ' 传递参数--表示修改商品记录
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) <> "" Then
checkvaluegroupsingleform.m_checkvaluegroupid = Trim(hfg_houseList.TextMatrix(hfg_houseList.RowSel, 0)) ' 选取MSHFlexGrid1的某一行的商品编号
checkvaluegroupsingleform.show 1
If q = 1 Then
RefreshQueryList
Else
refreshlist
End If
Else
MainForm.g_msgText = "对不起您的操作有误,请重试!!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Exit Sub
End If
End Sub
'**************************************
'* 功 能 描 述 :工具栏按钮的单击操作按钮
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "xz" ' 新增
checkvaluegroupsingleform.m_operatorType = 0
checkvaluegroupsingleform.show 1
refreshlist
Case "xg" ' 修改
checkvaluegroupsingleform.m_operatorType = 1
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) <> "" Then
checkvaluegroupsingleform.m_checkvaluegroupid = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
checkvaluegroupsingleform.show 1
If q = 1 Then
RefreshQueryList
Else
refreshlist
End If
End If
Case "sz"
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) <> "" Then
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
m_checkvaluegroupDAO.checkvaluegroup_findjybj rec, Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
Do While Not rec.EOF
If Trim(rec.Fields("检验标记")) = "1" Or Trim(rec.Fields("检验标记")) = "2" Or Trim(rec.Fields("检验标记")) = "3" Or Trim(rec.Fields("检验标记")) = "4" Or Trim(rec.Fields("检验标记")) = "5" Then
MainForm.g_msgText = "已经被质量检验用过了,不能修改!"
Call HMsgBox(MainForm.g_msgText, 0, 4)
CheckValueGroupDetailform.judge = 1
CheckValueGroupDetailform.m_id = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
CheckValueGroupDetailform.show
Exit Sub
End If
rec.MoveNext
Loop
Set rec = Nothing
CheckValueGroupDetailform.judge = 0
CheckValueGroupDetailform.m_id = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
CheckValueGroupDetailform.show
End If
Case "sc" ' 删除
Call delete
Call refreshlist
Case "cx" ' 查询
Call Query
Case "sx" '刷 新
q = 0
Call refreshlist
Case "tc" '退 出
Unload Me
End Select
End Sub
'**************************************
'* 功 能 描 述 :刷新检验值组列表
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub refreshlist()
m_checkvaluegroupDAO.FindAll m_recordset
hfg_houseList.clear
hfg_houseList.Rows = 2
RefreshListTitle
GetRecordToList m_recordset
m_recordset.Close
End Sub
'**************************************
'* 功 能 描 述 :删除一条记录
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub delete()
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) = "" Then
MainForm.g_msgText = "请选择一条记录!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
MainForm.g_msgText = "确定删除这条记录吗?"
Dim f As String
f = HMsgBox(MainForm.g_msgText, 2, 1)
If f = 1 Then
m_checkvaluegroupDAO.DeleteById m_recordset, _
Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
End If
End Sub
'**************************************
'* 功 能 描 述 :刷新列表的标题栏
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub RefreshListTitle()
hfg_houseList.TextMatrix(0, 0) = "检验组ID"
hfg_houseList.TextMatrix(0, 1) = "检验组名称"
hfg_houseList.TextMatrix(0, 2) = "备注"
'设置列对齐方式 7-右对齐 5-居中对齐 2-左对齐
hfg_houseList.ColAlignment(0) = 2
hfg_houseList.ColAlignment(1) = 2
hfg_houseList.ColAlignment(2) = 2
hfg_houseList.ColWidth(0) = 1
End Sub
'**************************************
'* 功 能 描 述 :查询记录
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Query()
q = 1
QueryFom.m_currentQuery = QUERY_CHECKVALUEGROUP
QueryFom.m_operateType = 1
QueryFom.show 1
' 如果此原料已有BOM记录,则调出些条BOM的信息
m_idList = MainForm.g_application.m_queryResultId
RefreshQueryList ' 显示查询到的结果
End Sub
Private Sub RefreshQueryList()
Dim ret As Boolean
' 显示查询到的结果
On Error GoTo EXITFUN
MainForm.g_application.m_databaseCon.m_adoConnection.BeginTrans ' 开始事务
InsertQueryIdList m_idList ' 把要显示的记录ID列表插入临时表
ret = m_checkvaluegroupDAO.checkvaluegroup_findidList(m_recordset) ' 查找记录
MainForm.g_application.m_databaseCon.m_adoConnection.CommitTrans ' 提交事务
hfg_houseList.clear
hfg_houseList.Rows = 2
RefreshListTitle
If ret Then
GetRecordToList m_recordset
End If
Text1.text = Trim(m_recordset.RecordCount)
m_recordset.Close
Exit Sub
EXITFUN:
MainForm.g_application.m_databaseCon.m_adoConnection.RollbackTrans ' 回滚事务
End Sub
'**************************************
'* 功 能 描 述 :从数据集中取出记录在列表中显示
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub GetRecordToList(recSet As ADODB.Recordset)
Dim currentrow As Integer
With m_recordset
currentrow = 1
Do While Not .EOF
If currentrow > hfg_houseList.Rows - 1 Then
hfg_houseList.AddItem ""
End If
'[>>自定义填充内容
hfg_houseList.TextMatrix(currentrow, 0) = Trim(.Fields(0))
hfg_houseList.TextMatrix(currentrow, 1) = Trim(.Fields(1))
hfg_houseList.TextMatrix(currentrow, 2) = Trim(.Fields(2))
'<<]
'设置数据行高度(Fixed)
hfg_houseList.RowHeight(currentrow) = 300
'动态集指针加1,同时将计数器加1(Fixed)
.MoveNext
currentrow = currentrow + 1
Loop
End With
Text1.text = Trim(m_recordset.RecordCount)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -