📄 frm_typeset.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frm_typeset
BorderStyle = 3 'Fixed Dialog
Caption = "IC卡类型设置"
ClientHeight = 6105
ClientLeft = 30
ClientTop = 420
ClientWidth = 9255
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6105
ScaleWidth = 9255
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txt_ZK
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
MaxLength = 3
TabIndex = 11
Text = "txt_DutyName"
Top = 1200
Width = 2772
End
Begin VB.TextBox txt_DutyName
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
MaxLength = 10
TabIndex = 7
Text = "txt_DutyName"
Top = 720
Width = 2772
End
Begin VB.TextBox txt_DutyNO
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
MaxLength = 2
TabIndex = 6
Text = "tx"
Top = 240
Width = 1332
End
Begin VB.CommandButton cmd_Co
Caption = "退出(&Q)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 5
Left = 7560
TabIndex = 5
Top = 720
Width = 1284
End
Begin VB.CommandButton cmd_Co
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 4
Left = 6240
TabIndex = 4
Top = 720
Width = 1284
End
Begin VB.CommandButton cmd_Co
Caption = "确定(&O)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 3
Left = 4920
TabIndex = 3
Top = 720
Width = 1284
End
Begin VB.CommandButton cmd_Co
Caption = "删除(&D)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 2
Left = 7560
TabIndex = 2
Top = 240
Width = 1284
End
Begin VB.CommandButton cmd_Co
Caption = "修改(E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 1
Left = 6240
TabIndex = 1
Top = 240
Width = 1284
End
Begin VB.CommandButton cmd_Co
Caption = "新增(&A)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 0
Left = 4920
TabIndex = 0
Top = 240
Width = 1284
End
Begin MSComctlLib.ListView ListView_Duty
Height = 4095
Left = 240
TabIndex = 8
Top = 1800
Width = 8775
_ExtentX = 15478
_ExtentY = 7223
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
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 = 0
End
Begin VB.Label Label1
Caption = "折扣:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 240
TabIndex = 12
Top = 1200
Width = 1470
End
Begin VB.Label Label3
Caption = "类型名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 384
Left = 240
TabIndex = 10
Top = 720
Width = 1464
End
Begin VB.Label Label2
Caption = "类型编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 384
Left = 240
TabIndex = 9
Top = 240
Width = 1464
End
End
Attribute VB_Name = "frm_typeset"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim active As Integer
Dim listview_index As Integer
Dim str_DutyNo, str_DutyName, str_ZK As String
Dim rs As New ADODB.Recordset
Private Sub cmd_Co_Click(Index As Integer)
Select Case Index
Case 0
active = 0
Cmd_F
txt_DutyNO.Enabled = True
txt_DutyNO.SetFocus
txt_DutyNO.Text = ""
txt_DutyName.Text = ""
txt_ZK.Text = ""
Case 1
active = 1
str_Set
If str_DutyNo >= "32" Then Call Cmd_T: MsgBox "该记录不可修改!", vbInformation + vbOKOnly, "中芯德立提示信息": Exit Sub
txt_DutyNO.Enabled = False
Case 2
str_Set
If str_DutyNo >= "32" Then Call Cmd_T: MsgBox "该记录不可修改!", vbInformation + vbOKOnly, "中芯德立提示信息": Exit Sub
If active <> 3 Then
If MsgBox("确实要删除该记录吗?", vbCritical + vbYesNo, "中芯德立提示信息") = vbYes Then
maSys_db.Execute "delete from 会员类型设置表 where 类型编号='" & str_DutyNo & "'"
Rs_Record_Set
End If
End If
Cmd_T
Case 3
If txt_DutyNO >= "32" Then Call Cmd_T: MsgBox "卡类型非法!", vbInformation + vbOKOnly, "中芯德立提示信息": Exit Sub
If Val(txt_ZK.Text) > 100 Or Val(txt_ZK.Text) <= 0 Then MsgBox "折扣非法!", vbInformation + vbOKOnly, "中芯德立提示信息": txt_ZK.Text = "": Exit Sub
If active = 1 Then
If txt_DutyNO <> "" And txt_DutyName <> "" Then
maSys_db.Execute "update 会员类型设置表 set 类型名称='" & Trim(txt_DutyName) & "',折扣='" & Format(txt_ZK.Text, "000") & "' where 类型编号='" & Trim(str_DutyNo) & "'"
Rs_Record_Set
End If
Else
If txt_DutyNO <> "" And txt_DutyName <> "" Then
Set rs = GetRecordset(maSys_db, "select * from 会员类型设置表 where 类型编号='" & Trim(txt_DutyNO.Text) & "'")
If Not rs.EOF Then '该员工编号在数据库中已经存在!
str_Msg = MsgBox("该职务编号在数据库中已经存在,请核对!", vbInformation + vbOKOnly, "中芯德立提示信息")
Exit Sub
End If
maSys_db.Execute "insert into 会员类型设置表(类型编号,类型名称,折扣) values('" & Format(txt_DutyNO.Text, "00") & "','" & Trim(txt_DutyName.Text) & "','" & Format(txt_ZK.Text, "000") & "')"
Rs_Record_Set
End If
End If
Cmd_T
Case 4
Cmd_T
Case 5
Unload Me
End Select
End Sub
Private Sub str_Set()
If ListView_Duty.ListItems.Count <> 0 Then
listview_index = ListView_Duty.SelectedItem
' str_DutyNo = ListView_Duty.ListItems(listview_index).SubItems(1)
' str_DutyName = ListView_Duty.ListItems(listview_index).SubItems(2)
txt_DutyNO = ListView_Duty.ListItems(listview_index).SubItems(1)
txt_DutyName = ListView_Duty.ListItems(listview_index).SubItems(2)
txt_ZK = ListView_Duty.ListItems(listview_index).SubItems(3)
str_DutyNo = txt_DutyNO
str_DutyName = txt_DutyName
str_ZK = txt_ZK
Cmd_F
Else
str_Msg = MsgBox("没有可供操作的记录!", vbInformation + vbOKOnly, "中芯德立提示信息")
active = 3
Exit Sub
End If
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
txt_DutyNO.Text = ""
txt_DutyName.Text = ""
txt_ZK.Text = ""
Rs_Record_Set
Cmd_T
' maSys_db.Execute "delete from Full_UserDict "
' maSys_db.Execute "delete from linkdatabuffer "
End Sub
Private Sub Rs_Record_Set() '显示记录到listview
Dim L As ListItem
Dim i As Integer
Set rs = GetRecordset(maSys_db, "select * from 会员类型设置表")
ListView_Duty.ColumnHeaders.Clear
ListView_Duty.ListItems.Clear
ListView_Duty.View = lvwReport
ListView_Duty.ColumnHeaders.Add , , "ID", 800
ListView_Duty.ColumnHeaders.Add , , "类型编号", 1500
ListView_Duty.ColumnHeaders.Add , , "类型名称", 6000
ListView_Duty.ColumnHeaders.Add , , "折扣", 1500
i = 1
If rs.EOF Then
Exit Sub
Else
rs.MoveFirst
Do While Not rs.EOF
Set L = ListView_Duty.ListItems.Add(, , i)
L.SubItems(1) = CStr(rs!类型编号)
L.SubItems(2) = CStr(rs!类型名称)
L.SubItems(3) = CStr(rs!折扣)
i = i + 1
rs.MoveNext
Loop
End If
End Sub
Private Sub Cmd_T()
cmd_Co(0).Enabled = True
cmd_Co(1).Enabled = True
cmd_Co(2).Enabled = True
cmd_Co(3).Enabled = False
cmd_Co(4).Enabled = False
cmd_Co(5).Enabled = True
End Sub
Private Sub Cmd_F()
cmd_Co(0).Enabled = False
cmd_Co(1).Enabled = False
cmd_Co(2).Enabled = False
cmd_Co(3).Enabled = True
cmd_Co(4).Enabled = True
cmd_Co(5).Enabled = False
End Sub
Private Sub txt_DutyNO_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub txt_DutyNO_LostFocus()
txt_DutyNO = Format(txt_DutyNO, "00")
End Sub
Private Sub txt_ZK_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub txt_ZK_LostFocus()
If Val(txt_ZK.Text) > 100 Or Val(txt_ZK.Text) <= 0 Then MsgBox "折扣非法!", vbInformation + vbOKOnly, "中芯德立提示信息": txt_ZK.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -