⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmdd.frm

📁 KTV管理系统,实现了基本的日常操作.程序有不完善之处,请自修升级修改.
💻 FRM
📖 第 1 页 / 共 4 页
字号:
.Label17.Caption = zh
.Label18.Caption = zhuohao
.Label19.Caption = admin
.Label20.Caption = Date & " " & Time
.Label16.Caption = BZ
End With
printJZD.PrintForm
printJZD.Show
Else

End If

'删除'点单'里的数据
Adodc3.Recordset.MoveFirst
For j = 1 To Adodc3.Recordset.RecordCount
Adodc3.Recordset.Delete
Adodc3.Recordset.Update
'Adodc3.Recordset.MoveNext
Next
Command10.Enabled = False
End Sub

Private Sub Command11_Click()
Picture2.Visible = True
End Sub


Private Sub Command3_Click()
Me.Caption = "补单"
Frame3.Visible = True
Frame4.Visible = False
End Sub

Private Sub Command4_Click()
List1.Clear
Adodc1.RecordSource = "select distinct 帐单号 from 点单 order by 帐单号"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
List1.AddItem "帐单号| " & Adodc1.Recordset.Fields("帐单号")
Adodc1.Recordset.MoveNext
Next
End Sub

Private Sub Command5_Click()
Dim rs As New ADODB.Recordset
Set rs = New ADODB.Recordset
Text4.Text = Text19.Text
rs.Open "select * from 点单 where 牌号='" & paihao & "'and 帐单号='" & zh & "' and 项目='调整金额'", conn1, 3, 3
With Adodc3.Recordset
If rs.RecordCount = 0 Then
    .AddNew
Else
End If
    .Fields("牌号") = paihao
    .Fields("项目") = "调整金额"
    .Fields("数量") = 1
    .Fields("单价") = Val(Text17.Text) - Val(Text18.Text)
    .Fields("总价") = Val(Text17.Text) - Val(Text18.Text)
    .Fields("付款方式") = "现金"
    .Fields("消费开始日期") = Format(Date, FmDate)
    .Fields("消费开始时间") = Time
    .Fields("预付押金") = 0
    .Fields("服务员") = fwy
    .Fields("帐单号") = zh
    .Update
End With
Label6.Caption = Text4.Text
Picture2.Visible = False
End Sub

Private Sub Command6_Click()
Text12.Enabled = False
Text13.Enabled = False
Text14.Enabled = False
Text15.Enabled = False
Text16.Enabled = False
End Sub

Private Sub Command7_Click()
Picture2.Visible = False
End Sub

Private Sub Command8_Click()
Unload Me
End Sub

Private Sub DataCombo1_Click(Area As Integer)
Text3.Enabled = False
Text5.Enabled = False
Select Case DataCombo1.Text
Case "金卡用户"
Text5.Enabled = True
Text5.SetFocus
Case "签单用户"
Text3.Enabled = True
Text3.SetFocus
Case "免费客人"
Text3.Enabled = True
Text3.SetFocus
Case Else
End Select
If DataCombo1.Text = "金卡用户" Then

End If
End Sub

Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Then 删除_Click
End Sub
 
Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu edit
End If
End Sub

Private Sub DataGrid2_DblClick()
If paihao = "" Then
MsgBox "请对具体牌号点单", vbOKOnly, "警告!"
Else
With Adodc3.Recordset
    .AddNew
    .Fields("牌号") = paihao
    .Fields("项目") = Adodc2.Recordset.Fields("项目")
    .Fields("数量") = 1
    .Fields("单价") = Adodc2.Recordset.Fields("单价")
    .Fields("总价") = .Fields("数量") * .Fields("单价")
    .Fields("付款方式") = "现金"
    .Fields("消费开始日期") = Date
    .Fields("消费开始时间") = Format(Time, FmTime)
    .Fields("预付押金") = 0
    .Fields("帐单号") = zh
    .Fields("服务员") = fwy
    .Update
End With
End If
End Sub

Private Sub DataGrid2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then DataGrid2_DblClick
End Sub


Private Sub Form_Activate()
Call MDIhide

Adodc4.ConnectionString = conn1
Adodc4.RecordSource = "select * from 类别设置 where 标识='FK'"
Adodc4.Refresh

End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = conn1
Adodc2.ConnectionString = conn1
Adodc3.ConnectionString = conn1
Me.Caption = BBcaption
Select Case BBcaption
Case "点单"
Frame3.Visible = True
Frame4.Visible = False
Case "结帐"
Frame3.Visible = False
Frame4.Visible = True
End Select
'初始化picture2窗口参数
With Combo1
.AddItem "无"
.AddItem "附加费率"
.AddItem "指定金额"
.ListIndex = 0
End With
With Combo2
.AddItem "无"
.AddItem "折扣率"
.AddItem "指定金额"
.ListIndex = 0
End With
With Combo3
.AddItem "无"
.AddItem "5元优惠券"
.AddItem "10元优惠券"
.AddItem "指定金额"
.ListIndex = 0
End With
Adodc2.RecordSource = "select 项目,单价 from 费用"
Adodc2.Refresh
Adodc1.RecordSource = "select distinct 帐单号 from 点单 order by 帐单号"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
List1.AddItem "帐单号| " & Adodc1.Recordset.Fields("帐单号")
Adodc1.Recordset.MoveNext
Next

Adodc1.RecordSource = "select distinct 类别 from 费用"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
    If Not Adodc1.Recordset.EOF Then
    TreeView1.Nodes.Add , , , Adodc1.Recordset.Fields("类别"), 1
    Adodc1.Recordset.MoveNext
    End If
Next
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call MDIview
End Sub

Private Sub Image1_Click()
If Text1.Text <> "" Then
Adodc3.RecordSource = "select * from 点单 where 牌号='" & Trim(Text1.Text) & "'and 帐单号='" & zh & "'"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
fwy = Adodc3.Recordset.Fields("服务员")
Label1.Caption = "客户名称: " & List2.Text
Label3.Caption = "入店时间: " & Adodc3.Recordset.Fields("消费开始日期") & " " & Adodc3.Recordset.Fields("消费开始时间")
Label4.Caption = "付款方式: " & Adodc3.Recordset.Fields("付款方式")
Adodc1.RecordSource = "select sum(总价) as 消费总额 from 点单 where 牌号='" & Trim(Text1.Text) & "'and 帐单号='" & zh & "'"
Adodc1.Refresh
Label6.Caption = Adodc1.Recordset.Fields("消费总额")
Text4.Text = Label6.Caption
Else
MsgBox "SORRY 查无此牌号,请输入正确牌号.", vbOKOnly, "提示"
Text1.SetFocus
End If
End If
End Sub

Private Sub List1_Click()
List2.Clear
paihao = ""
If List1.Text <> "" Then
zh = Format(Right(List1.Text, 6), "000000")
sqll = "where 帐单号='" & zh & "'"
Call listV("1")
End If
End Sub

Private Sub List2_Click()
If List2.Text <> "" Then
paihao = Right(List2.Text, 4)
sqll = "where 牌号='" & paihao & "'and 帐单号='" & zh & "'"
Call listV("2")
End If
End Sub

Private Sub ListView1_Click()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Image1_Click
End Sub

Private Sub Text12_LostFocus()
Text17.Text = Val(Text9.Text) * Val(Text12.Text) / 100
Text19.Text = Val(Text9.Text) + Val(Text17.Text) + Val(Text16.Text) - Val(Text18.Text)
End Sub

Private Sub Text13_Change()
Text17.Text = Text13.Text
Text19.Text = Val(Text9.Text) + Val(Text17.Text) + Val(Text16.Text) - Val(Text18.Text)
End Sub

Private Sub Text14_LostFocus()
Text18.Text = Val(Text9.Text) * Val(Text14.Text) / 100
Text19.Text = Val(Text9.Text) + Val(Text17.Text) + Val(Text16.Text) - Val(Text18.Text)
End Sub

Private Sub Text15_Change()
Text18.Text = Text15.Text
Text19.Text = Val(Text9.Text) + Val(Text17.Text) + Val(Text16.Text) - Val(Text18.Text)
End Sub

Private Sub Text16_Change()
Text18.Text = Val(Text15.Text) + Val(Text16.Text)
Text19.Text = Val(Text9.Text) + Val(Text17.Text) - Val(Text18.Text)
End Sub

Private Sub Text18_Change()
Text19.Text = Val(Text19.Text) + Val(Text17.Text) - Val(Text18.Text)
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.RecordSource = "select * from 签单用户 where 姓名='" & Text3.Text & "'"
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "查无此用户,请与管理员联系!", vbOKOnly, "提示"
Else
Text7.Enabled = True
Text7.SetFocus
End If
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.RecordSource = "select * from 金卡用户 where 卡号='" & Text5.Text & "'"
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "查无此用户,请与管理员联系!", vbOKOnly, "提示"
Else
Text7.Enabled = True
Text7.SetFocus
End If
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
Dim sumM, sumM1 As Integer
If KeyAscii = 13 Then
    If Text7.Text <> Adodc1.Recordset.Fields("密码") Then
    MsgBox "密码不正确!", vbOKOnly, "提示"
    Else
    Select Case DataCombo1.Text
    Case "金卡用户"
    sumM = Adodc1.Recordset.Fields("卡内金额")
    sumM1 = sumM - CInt(Text4.Text)
    If sumM1 < 0 Then
        MsgBox "对不起,卡内余额不足,请再补交现金" & CInt(Text4.Text) - sumM & "元!", vbOKOnly, "提示"
       Adodc1.Recordset.Fields("卡内余额") = 0
       
        Else
        Adodc1.Recordset.Fields("卡内余额") = sumM1
        MsgBox "您的帐已划掉,卡内最新余额为" & sumM1 & "元!谢谢光临!", vbOKOnly, "提示"
    End If
    Case "签单用户"
    sumM = Adodc1.Recordset.Fields("消费金额")
    sumM1 = sumM + CInt(Text4.Text)
    Adodc1.Recordset.Fields("消费金额") = sumM1
    Adodc1.Recordset.Update
    MsgBox "您的帐已划掉,帐户内累计金额为" & sumM1 & "元!谢谢光临!", vbOKOnly, "提示"
    Case Else
    End Select
    For i = 1 To Adodc2.Recordset.RecordCount
    Adodc2.Recordset.Delete
    Adodc2.Recordset.MoveNext
    Next
    Adodc2.Recordset.Update
    End If
End If
End Sub

Private Sub Text8_GotFocus()
Text8.SelStart = 0
Text8.SelLength = Len(Text8.Text)
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)
'未注册版本,不能结帐操作
If regflag = "请注册使用!" Then Exit Sub

If KeyAscii = 13 Then
    If CInt(Text8.Text) < CInt(Text4.Text) - CInt(Text6.Text) Then
    MsgBox "sorry,您的金额不足,请检查是否输入错误!", vbOKOnly, "无法结帐提示!!"
    Else
        If CInt(Text8.Text) > CInt(Text4.Text) - CInt(Text6.Text) Then
        MsgBox "收到现金{" & Text8.Text & "},找回 {" & CInt(Text8.Text) - CInt(Text4.Text) + CInt(Text6.Text) & "},欢迎再次光临!!", vbOKOnly, "提示!!"
        ElseIf CInt(Text8.Text) = CInt(Text4.Text) - CInt(Text6.Text) Then
        MsgBox "收到现金{" & Text8.Text & "},您已经交清全部费用,欢迎再次光临!!", vbOKOnly, "提示!!"
        End If
        Command10.Enabled = True
        Command10.SetFocus
    End If
End If
End Sub

Private Sub TreeView1_Click()
Adodc2.RecordSource = "select * from 费用 where 类别='" & TreeView1.SelectedItem & "'"
Adodc2.Refresh
End Sub

Private Sub 返回_Click()
Unload Me
End Sub

Private Sub 删除_Click()
On Error Resume Next
Adodc3.Recordset.Delete
If Adodc3.Recordset.EOF Then Adodc3.Recordset.MovePrevious

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -