📄 basedataset.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{40D97E01-4259-4398-B597-183C348B488F}#1.0#0"; "BSE.ocx"
Begin VB.Form BaseDataSet
Caption = "零件基本数据设置"
ClientHeight = 5820
ClientLeft = 60
ClientTop = 450
ClientWidth = 8430
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5820
ScaleWidth = 8430
Begin BSE_Engine.BSE BSE1
Left = 4440
Top = 5040
_ExtentX = 6588
_ExtentY = 1085
End
Begin MSComctlLib.ListView lstBaseData
Height = 5775
Left = 0
TabIndex = 15
Top = 0
Width = 3255
_ExtentX = 5741
_ExtentY = 10186
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 0
End
Begin VB.Frame Frame2
Height = 5775
Left = 3240
TabIndex = 8
Top = 0
Width = 2895
Begin VB.CommandButton Command3
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 1560
TabIndex = 14
Top = 3360
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 240
TabIndex = 13
ToolTipText = "增加新记录"
Top = 3360
Width = 1095
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 12
Top = 2160
Width = 2655
End
Begin VB.CommandButton Command2
Height = 495
Index = 2
Left = 1440
Picture = "BaseDataSet.frx":0000
Style = 1 'Graphical
TabIndex = 11
ToolTipText = "删除"
Top = 240
Width = 495
End
Begin VB.CommandButton Command2
Height = 495
Index = 1
Left = 840
Picture = "BaseDataSet.frx":014A
Style = 1 'Graphical
TabIndex = 10
ToolTipText = "修改"
Top = 240
Width = 495
End
Begin VB.CommandButton Command2
Height = 495
Index = 0
Left = 240
Picture = "BaseDataSet.frx":0294
Style = 1 'Graphical
TabIndex = 9
ToolTipText = "增加"
Top = 240
Width = 495
End
End
Begin VB.Frame Frame1
Height = 5775
Left = 6120
TabIndex = 0
Top = 0
Width = 2295
Begin VB.CommandButton Command1
Caption = "客户性质"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 7
Left = 360
TabIndex = 16
Top = 3600
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "支付方式"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 6
Left = 360
TabIndex = 7
Top = 3120
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "计量单位"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 5
Left = 360
TabIndex = 6
Top = 2640
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "货品产地"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 4
Left = 360
TabIndex = 5
Top = 2160
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "商标品牌"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 3
Left = 360
TabIndex = 4
Top = 1680
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "货品分类"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 2
Left = 360
TabIndex = 3
Top = 1200
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "客户分类"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 360
TabIndex = 2
Top = 720
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "地区设置"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 360
TabIndex = 1
Top = 240
Width = 1575
End
End
End
Attribute VB_Name = "BaseDataSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private ModifyBS As Boolean
Private CommandIndex As Integer
Private Command2Index As Integer
Private lstBaseDataIndex As Long
Private Sub Command1_Click(Index As Integer)
Dim TempSQL As String
TempSQL = VarInitData.DisplayDynSQLVal(VarInitData.SureNameFrIndex(Index))
VarInitData.LoadData lstBaseData, TempSQL
CommandIndex = Index
VarInitData.DealListView lstBaseData, lstBaseDataIndex
lstBaseData.ColumnHeaders(1).Width = lstBaseData.Width - 100
End Sub
Private Sub Command2_Click(Index As Integer)
Dim i As Integer
Dim TempSQL As String
Text1.Text = ""
Select Case Index
Case 0 '增加新记录
For i = 0 To 2
Command2(i).Enabled = False
Next i
For i = 0 To 1
Command3(i).Visible = True
Next i
Text1.Visible = True
Text1.SetFocus
Frame1.Enabled = False
Case 1 '修改
If lstBaseData.ListItems.Count > 0 Then
For i = 0 To 2
Command2(i).Enabled = False
Next i
For i = 0 To 1
Command3(i).Visible = True
Next i
Text1.Visible = True
Frame1.Enabled = False
ModifyBS = True
Text1.Text = lstBaseData.ListItems(lstBaseData.SelectedItem.Index).Text
Text1.SetFocus
End If
Case 2 '删除
If lstBaseData.SelectedItem Is Nothing Then Exit Sub
If MsgBox("确定删除这一项吗?", vbOKCancel, "提示") = vbOK Then
TempSQL = "Delete From basedatatable Where datacontxt = " & Quote(Trim(lstBaseData.SelectedItem.Text))
gCnn.Execute TempSQL
TempSQL = VarInitData.DisplayDynSQLVal(VarInitData.SureNameFrIndex(CommandIndex))
VarInitData.LoadData lstBaseData, TempSQL
End If
End Select
lstBaseData.SetFocus
Command2Index = Index
End Sub
Private Sub Command3_Click(Index As Integer)
Dim i As Integer
Select Case Index
Case 0 '确定
Select Case Command2Index
Case 0, 1
If LenB(Text1) >= 100 Then
MsgBox "描述的内容太多了,操作失败", , VarInitData.SysPrompt
Exit Sub
End If
BaseSave VarInitData.SureNameFrIndex(CommandIndex)
End Select
Case 1 '取消
ModifyBS = False
End Select
For i = 0 To 2
Command2(i).Enabled = True
Next i
For i = 0 To 1
Command3(i).Visible = False
Next i
Text1.Visible = False
Frame1.Enabled = True
lstBaseData.SetFocus
End Sub
Private Sub Form_Activate()
Command1_Click 0
End Sub
Private Sub Form_Load()
VarInitData.InitBSE BSE1
Text1.Visible = False
Command3(0).Visible = False
Command3(1).Visible = False
End Sub
Private Sub BaseSave(VarName As String)
Dim TempRS As MYSQL_RS
Dim i As Integer
Dim TempSQL As String
Set TempRS = New MYSQL_RS
If ModifyBS = True Then
SQL = "Select * From basedatatable Where datacontxt = " & Quote(Trim(lstBaseData.ListItems(lstBaseData.SelectedItem.Index).Text)) & " and basedataname = " & Quote(VarName)
Else
SQL = "Select * From basedatatable" 'Where AKey = " & Val(txtAKey)
End If
TempRS.OpenRs SQL, gCnn
If ModifyBS = False Then
If TempRS.RecordCount > 0 Then
TempRS.MoveLast
TempRS.MoveNext
End If
End If
With TempRS
If .EOF Then .AddNew
.Fields("basedataname") = VarName
.Fields("datacontxt") = Trim(Text1.Text)
.Update
End With
Set TempRS = Nothing
TempSQL = VarInitData.DisplayDynSQLVal(VarInitData.SureNameFrIndex(CommandIndex))
VarInitData.LoadData lstBaseData, TempSQL
ModifyBS = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
If BSE1.EngineStarted Then BSE1.EndSubClassing
End Sub
Private Sub lstBaseData_ItemClick(ByVal Item As MSComctlLib.ListItem)
lstBaseDataIndex = Item.Index
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -