📄 simpleset.frm
字号:
GridLines = -1 'True
_Version = 393217
ForeColor = 0
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "Name"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Address"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "City, State, Zip"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Notes"
Object.Width = 2540
EndProperty
End
End
End
Attribute VB_Name = "SimpleSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim NewRecord As Boolean
Dim LastSortIndex As Long, LastSortDir As Long
Private VarOption As Integer
Private ModifyBS As Boolean
Public lstBillDocuIndex As Long
Private Sub ButtonTimer_Timer()
' VarInitData.CheckFlatButtons PassPicture1, 11
' VarInitData.CheckFlatButtons PassPicture2, 3
End Sub
Private Sub Command1_Click(Index As Integer)
Dim i As Integer
Dim TempRS As MYSQL_RS
Dim TempVar As Long
Dim TempSQL As String
Dim TempBillType As Integer
Select Case Index
Case 1
ClearFrame
Frame1.Enabled = True
Frame1.Visible = True
lstBillDocu.Visible = False
For i = 0 To 1
With Command2(i)
.left = Command1(i + 1).left
.top = Command1(i + 1).top
.Visible = True
End With
Next i
For i = 1 To 4
Command1(i).Visible = False
Next i
SSStock.TabEnabled(0) = False
SSStock.Tab = 1
Case 2
If lstBillDocuIndex > 0 And lstBillDocu.ListItems.Count > 0 Then
ClearFrame
Frame1.Visible = True
lstBillDocu.Visible = False
For i = 0 To 1
With Command2(i)
.left = Command1(i + 1).left
.top = Command1(i + 1).top
.Visible = True
End With
Next i
For i = 1 To 4
Command1(i).Visible = False
Next i
SSStock.TabEnabled(0) = False
SSStock.Tab = 1
With lstBillDocu.ListItems(lstBillDocuIndex)
TexGoods(0) = .Text
TexGoods(1) = .SubItems(1)
TexGoods(2) = .SubItems(2)
TexGoods(3) = .SubItems(3)
End With
Frame1.Enabled = True
ModifyBS = True
End If
Case 3
If lstBillDocu.ListItems.Count > 0 And lstBillDocuIndex > 0 Then
If MsgBox("确定删除这一项吗?", vbOKCancel, "提示") = vbOK Then
TempSQL = "Delete From simplecodetable Where goodsname = " & Quote(Trim(lstBillDocu.ListItems(lstBillDocuIndex).Text))
gCnn.Execute TempSQL
TempSQL = VarInitData.DisplaySQLVal(4)
VarInitData.LoadData lstBillDocu, TempSQL
If lstBillDocuIndex > lstBillDocu.ListItems.Count Then
lstBillDocuIndex = lstBillDocu.ListItems.Count
End If
VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End If
End If
Case 4
TempSQL = VarInitData.DisplaySQLVal(4)
VarInitData.LoadData lstBillDocu, TempSQL
If lstBillDocu.ListItems.Count > 0 Then
lstBillDocuIndex = 1
End If
VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End Select
End Sub
Private Sub Command2_Click(Index As Integer)
Dim TempRS As MYSQL_RS
Dim i As Integer
Dim TempSQL As String
Select Case Index
Case 0 '保存
If LenB(TexGoods(0)) >= 50 Then
MsgBox "货品名称的内容太多了,操作失败", , VarInitData.SysPrompt
Exit Sub
End If
Set TempRS = New MYSQL_RS
If ModifyBS = True Then
SQL = "Select * From simplecodetable Where goodsname = " & Quote(Trim(lstBillDocu.ListItems(lstBillDocuIndex).Text))
Else
SQL = "Select * From simplecodetable" '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("goodsname") = Trim(TexGoods(0).Text)
.Fields("alias") = Trim(TexGoods(1).Text)
.Fields("simplecode") = Trim(TexGoods(2).Text)
.Fields("customcoding") = Trim(TexGoods(3).Text)
.Update
End With
Set TempRS = Nothing
TempSQL = VarInitData.DisplaySQLVal(4)
VarInitData.LoadData lstBillDocu, TempSQL
If ModifyBS = False Then lstBillDocuIndex = lstBillDocu.ListItems.Count
Case 1
ClearFrame
If lstBillDocuIndex > 0 And lstBillDocu.ListItems.Count > 0 Then
With lstBillDocu.ListItems(lstBillDocuIndex)
TexGoods(0) = .Text
TexGoods(1) = .SubItems(1)
TexGoods(2) = .SubItems(2)
TexGoods(3) = .SubItems(3)
End With
End If
End Select
ModifyBS = False
SSStock.TabEnabled(0) = True
' Frame1.Visible = False
' lstBillDocu.Visible = True
Frame1.Enabled = False
For i = 0 To 1
Command2(i).Visible = False
Next i
For i = 1 To 4
Command1(i).Visible = True
Next i
' DealListview
End Sub
Private Sub Form_Activate()
VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End Sub
Private Sub Form_Load()
Dim i As Integer
VarInitData.InitBSE BSE1
Frame1.Visible = False
Frame1.Enabled = False
lstBillDocu.Visible = True
For i = 0 To 1
Command2(i).Visible = False
Next i
VarInitData.LoadData lstBillDocu, VarInitData.DisplaySQLVal(4)
' For i = 0 To 11
' Set PassPicture1(i) = Picture1(i)
' Next i
' For i = 0 To 3
' Picture2(i).left = Picture1(i + 4).left
' Picture2(i).tOp = Picture1(i + 4).tOp
' Set PassPicture2(i) = Picture2(i)
' Next i
frameInfo.BackColor = vb3DFace
End Sub
Private Sub Form_Resize()
If Me.ScaleHeight > 0 And Me.ScaleWidth > 0 Then
frameInfo.left = Me.ScaleLeft
frameInfo.top = Me.ScaleTop
frameInfo.Width = Me.ScaleWidth
SSStock.top = frameInfo.top + frameInfo.Height
SSStock.left = Me.ScaleLeft + 70
SSStock.Width = Me.ScaleWidth - 140
SSStock.Height = Me.ScaleHeight - frameInfo.Height - 50 'Screen.Height - 2650
lstBillDocu.top = 450
lstBillDocu.left = 70
lstBillDocu.Width = SSStock.Width - 140
lstBillDocu.Height = SSStock.Height - 550
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If BSE1.EngineStarted Then BSE1.EndSubClassing
End Sub
Private Sub lstBillDocu_ItemClick(ByVal Item As MSComctlLib.ListItem)
lstBillDocuIndex = Item.Index
End Sub
Private Sub Option1_Click(Index As Integer)
VarOption = Index + 1
End Sub
Private Sub SSStock_Click(PreviousTab As Integer)
Dim TempSQL As String
Dim TempStr As String
Dim TempRS As MYSQL_RS
Dim TempBillType As Integer
Dim i As Integer
If Frame1.Enabled = False Then
If PreviousTab <> 0 Then
lstBillDocu.Visible = True
Frame1.Visible = False
VarInitData.DealListView lstBillDocu, lstBillDocuIndex
Else
lstBillDocu.Visible = False
Frame1.Visible = True
ClearFrame
Frame1.Enabled = False
If lstBillDocuIndex > 0 And lstBillDocu.ListItems.Count > 0 Then
With lstBillDocu.ListItems(lstBillDocuIndex)
TexGoods(0) = .Text
TexGoods(1) = .SubItems(1)
TexGoods(2) = .SubItems(2)
TexGoods(3) = .SubItems(3)
End With
End If
End If
End If
End Sub
Private Sub ClearFrame()
Dim i As Integer
For i = 0 To 3
TexGoods(i).Text = ""
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -