?? checkoptiongroup.frm
字號:
Key = "last"
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":3D3A
Key = "xx"
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":40D4
Key = "define"
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":446E
Key = "exec"
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":4808
Key = "xz"
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":4BA2
Key = "sc"
EndProperty
BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":4F3C
Key = "sx"
EndProperty
BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":52D6
Key = "cx"
EndProperty
BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":5670
Key = "zd"
EndProperty
BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":5A0A
Key = "dz"
EndProperty
BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":5DA4
Key = "ph"
EndProperty
BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":613E
Key = "fz"
EndProperty
BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":64D8
Key = "Locate"
EndProperty
BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":6872
Key = "hf"
EndProperty
BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":6C0C
Key = "pz"
EndProperty
BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":6FA6
Key = "check"
EndProperty
BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":7340
Key = "Sum"
EndProperty
BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":76DA
Key = "Total"
EndProperty
BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":7A74
Key = "Detail"
EndProperty
BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "CheckOptionGroup.frx":7E0E
Key = "Order"
EndProperty
EndProperty
End
End
Attribute VB_Name = "CheckOptionGroup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 塊 名 稱 :檢驗產品項目組管理用戶操作界面
'* 功 能 描 述 :檢驗產品項目組管理用戶操作界面
'* 程序員姓名 : 黃朝和
'* 最后修改人 : 黃朝和
'* 最后修改時間:2005/09/19
'**************************************
Option Explicit
Public z_rowname As String
Private m_checkoptiongroupDAO As checkoptiongroupDAO
Private m_recordset As ADODB.Recordset
Dim ret As Boolean
Dim currentrow As Integer
Public j_rowname As String
Private q As Integer
Private m_idList As String ' 在執行查詢時查詢到的ID列表字符串
Private Sub Form_Load()
Set m_recordset = New ADODB.Recordset
Set m_checkoptiongroupDAO = New checkoptiongroupDAO
sxjl
End Sub
Private Sub Form_Resize()
MSHFlexGrid1.Height = Me.Height - 1400
MSHFlexGrid1.Width = Me.Width - 350
' Image1.Stretch = False
If (MSHFlexGrid1.Height > MSHFlexGrid1.Height - 300) Or (MSHFlexGrid1.Width > MSHFlexGrid1.Width - 200) Then
MSHFlexGrid1.Height = MSHFlexGrid1.Height + 400
MSHFlexGrid1.Width = MSHFlexGrid1.Width + 200
'
' Image1.Stretch = True
End If
End Sub
Private Sub MSHFlexGrid1_DblClick()
checkoptiongrouplist.z_type = 0 ' 傳遞參數--表示修改商品記錄
If Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.row, 0)) <> "" Then
z_rowname = MSHFlexGrid1.RowSel ' 選取MSHFlexGrid1的某一行的商品編號
checkoptiongrouplist.show 1
If q = 1 Then
RefreshQueryList
Else
sxjl
End If
Else
MainForm.g_msgText = "對不起您的操作有誤,請重試!!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Exit Sub
End If
End Sub
Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "xz"
checkoptiongrouplist.z_type = 1 ' 參數---表示增加商品記錄
checkoptiongrouplist.show 1
sxjl
Case "sx"
q = 0
Call sxjl
Case "cx"
Call cxjl
Case "sc"
Call delete
Call sxjl
Case "tc"
Unload Me
Case "fq"
If Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.row, 0)) <> "" Then
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
m_checkoptiongroupDAO.CheckOptionGroup_findbyjybj rec, Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.RowSel, 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)
CheckOptionGroupDetail.judge = 1
j_rowname = MSHFlexGrid1.RowSel
CheckOptionGroupDetail.show 1
Exit Sub
End If
rec.MoveNext
Loop
Set rec = Nothing
CheckOptionGroupDetail.judge = 0
j_rowname = MSHFlexGrid1.RowSel
CheckOptionGroupDetail.show 1
Else
MainForm.g_msgText = "對不起您的操作有誤,請重試!!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Exit Sub
End If
Case "yl"
checkoptiongrouplist.z_type = 0 ' 傳遞參數--表示修改商品記錄
If Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.row, 0)) <> "" Then
z_rowname = MSHFlexGrid1.RowSel ' 選取MSHFlexGrid1的某一行的商品編號
checkoptiongrouplist.show 1
If q = 1 Then
RefreshQueryList
Else
sxjl
End If
Else
MainForm.g_msgText = "對不起您的操作有誤,請重試!!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Exit Sub
End If
End Select
End Sub
Private Sub showform()
MSHFlexGrid1.TextMatrix(0, 0) = "產品檢驗組編號"
MSHFlexGrid1.TextMatrix(0, 1) = "產品檢驗組名稱"
MSHFlexGrid1.TextMatrix(0, 2) = "備注"
'設置列對齊方式 7-右對齊 5-居中對齊 2-左對齊
MSHFlexGrid1.ColAlignment(0) = 2
MSHFlexGrid1.ColAlignment(1) = 2
MSHFlexGrid1.ColAlignment(2) = 2
MSHFlexGrid1.ColWidth(0) = 5
MSHFlexGrid1.ColWidth(1) = 1500
MSHFlexGrid1.ColWidth(2) = 2500
End Sub
Private Sub sxjl()
ret = m_checkoptiongroupDAO.CheckOptionGroup_show(m_recordset)
MSHFlexGrid1.clear
MSHFlexGrid1.Rows = 2
Call showform
GetRecordToList m_recordset
m_recordset.Close
End Sub
Private Sub cxjl()
q = 1
QueryFom.m_currentQuery = QUERY_CHECKOPTIONGROUP
QueryFom.m_operateType = 1
QueryFom.show 1
' 如果此原料已有BOM記錄,則調出些條BOM的信息
m_idList = MainForm.g_application.m_queryResultId
RefreshQueryList ' 顯示查詢到的結果
End Sub
Private Sub delete() ' 根據商品編號刪除記錄
If Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.row, 0)) = "" Then
MainForm.g_msgText = "請選擇一條記錄!!"
Call 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
ret = m_checkoptiongroupDAO.CheckOptionGroupid_delete(m_recordset, Trim(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.row, 0)))
End If
End Sub
Private Sub RefreshQueryList()
' 顯示查詢到的結果
On Error GoTo EXITFUN
MainForm.g_application.m_databaseCon.m_adoConnection.BeginTrans ' 開始事務
InsertQueryIdList m_idList ' 把要顯示的記錄ID列表插入臨時表
ret = m_checkoptiongroupDAO.CheckOptionGroup_findbyidList(m_recordset) ' 查找記錄
MainForm.g_application.m_databaseCon.m_adoConnection.CommitTrans ' 提交事務
MSHFlexGrid1.clear
MSHFlexGrid1.Rows = 2
showform
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 > MSHFlexGrid1.Rows - 1 Then
MSHFlexGrid1.AddItem ""
End If
'[>>自定義填充內容
MSHFlexGrid1.TextMatrix(currentrow, 0) = Trim(.Fields("checkoptiongroupid")) '商品名稱
MSHFlexGrid1.TextMatrix(currentrow, 1) = Trim(.Fields("name")) '商品條碼
MSHFlexGrid1.TextMatrix(currentrow, 2) = Trim(.Fields("memo")) '商品簡稱
'<<]
'設置數據行高度(Fixed)
MSHFlexGrid1.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 + -