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

📄 住宿登录.frm

📁 利用VB编写的一个完整的酒店管理程序,支持双数据库!
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4800
      TabIndex        =   28
      Top             =   240
      Width           =   1935
   End
   Begin VB.Label Label13 
      BackStyle       =   0  'Transparent
      Caption         =   "应收宿费"
      Height          =   255
      Left            =   4680
      TabIndex        =   27
      Top             =   3000
      Width           =   855
   End
   Begin VB.Label Label12 
      BackStyle       =   0  'Transparent
      Caption         =   "宿    费"
      Height          =   255
      Left            =   720
      TabIndex        =   23
      Top             =   3000
      Width           =   855
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "天数"
      Height          =   255
      Left            =   8400
      TabIndex        =   21
      Top             =   2400
      Width           =   495
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "价格"
      Height          =   255
      Left            =   6000
      TabIndex        =   19
      Top             =   2400
      Width           =   615
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "客房类型"
      Height          =   255
      Left            =   3120
      TabIndex        =   18
      Top             =   2400
      Width           =   855
   End
   Begin VB.Label Label8 
      BackStyle       =   0  'Transparent
      Caption         =   "※"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   480
      TabIndex        =   15
      Top             =   2400
      Width           =   255
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "房间号码"
      Height          =   255
      Left            =   720
      TabIndex        =   14
      Top             =   2400
      Width           =   735
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "※"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   600
      TabIndex        =   12
      Top             =   1080
      Width           =   255
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "联系电话"
      Height          =   255
      Left            =   7800
      TabIndex        =   11
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "出差理由"
      Height          =   255
      Left            =   4920
      TabIndex        =   9
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "详细地址"
      Height          =   255
      Left            =   720
      TabIndex        =   7
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "NO"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   600
      TabIndex        =   3
      Top             =   240
      Width           =   375
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   11040
      Y1              =   720
      Y2              =   720
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "姓 名"
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   1080
      Width           =   615
   End
End
Attribute VB_Name = "form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'FIXIT: 使用 Option Explicit 可以避免隐式创建 Variant 类型的变量                                          FixIT90210ae-R383-H1984
Private Sub Combo2_Click()
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("select * from kf where 房间号='" & Combo2.Text & "'", dbOpenDynaset)
  
     '列出记录
      If Combo2.Text <> "" Then
            txtfield(6).Text = EF.Fields("价格")
            txtfield(5).Text = EF.Fields("房间类型")
            txtfield(8).Text = Val(txtfield(6).Text) * Val(txtfield(7).Text)
            txtfield(10).Text = Val(txtfield(6).Text) * Val(txtfield(7).Text)
           
     End If
      
 '添加合计
  EF.Close
  db.Close

End Sub

Private Sub Command1_Click()



If txtfield(0).Text <> "" And Combo2.Text <> "" And txtfield(1).Text <> "" Then
 '开始保存内容
' Caozuo = "住宿保存按钮 '" & Combo2.Text & " '房间,价格 '" & txtfield(6).Text & " ' "
'lu_time = Now
'RiZhil
   Dim db As Database
  Dim EF As Recordset
   Dim efc As Recordset
    Dim efb As Recordset
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from djb", dbOpenDynaset)
   Set efc = db.OpenRecordset("Select * from kf where 房间号='" & Combo2.Text & "'", dbOpenDynaset)
     Set efb = db.OpenRecordset("select * from steelno where 单据名称='住宿登记'", dbOpenDynaset)
  
      '==================1
     
          EF.AddNew
          '-------------------------
          efc.Edit
          efb.Edit
          efc("房态") = "售出"
           efb("单据号码") = Val(Text1.Text)
         '---------------------------
          EF("凭证号码") = Text1.Text
          EF("姓名") = txtfield(0).Text
          EF("证件名称") = Combo1
          EF("证件号码") = txtfield(1)
          EF("详细地址") = txtfield(2)
          EF("出差事由") = txtfield(3)
          EF("房间号") = Combo2
          EF("客房类型") = txtfield(5)
          EF("联系电话") = txtfield(4)
          EF("客房价格") = txtfield(6)
          EF("住宿日期") = Date
          EF("住宿时间") = Time
          EF("住宿天数") = 1
          EF("宿费") = txtfield(8)
          EF("折扣") = txtfield(9)
          EF("应收宿费") = txtfield(10)
          EF("预收金额") = Val(txtfield(11))
          EF("提醒日期") = txtfield(14)
          EF("退宿日期") = txtfield(14)
          EF("备注") = txtfield(16)
          EF("标志") = "1"
          EF("日期") = Date
          EF("时间") = Time
          EF("提醒时间") = txtfield(15)
          EF("退宿时间") = txtfield(15)
          EF("结款方式") = Combo3.Text
          EF("摘要") = "1"
          EF("BZ") = 0
           efb.Update
          efc.Update
          
          EF.Update
     
      '-----------------
      efb.Close
    efc.Close
  EF.Close
  db.Close
   
   
  MsgBox "住宿信息已经录入!如果有错误请用住宿客人信息修改功能进行修改!   ", vbInformation
  Command1.Enabled = False
  txtfield(0).Text = ""
  Combo2.Clear
  txtfield(6).Text = ""
  txtfield(8).Text = ""
  txtfield(10).Text = ""
  txtfield(11).Text = ""
   txtfield(16).Text = ""
   Command1.Enabled = False
 Else
 MsgBox "对不起!您的房间号码或姓名或身份证号码不能为空!"
End If


End Sub

Private Sub Command3_Click()
'Caozuo = "住宿退出按钮 '" & Combo2.Text & " '房间 "
'lu_time = Now
'RiZhil

Unload Me
 '检索数据
 End Sub




Private Sub Command5_Click()
'Caozuo = "住宿登记按钮  "
'lu_time = Now
'RiZhil


 Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, False, Constr)
 
  Set EF = db.OpenRecordset("select * from kf where 房态='空房' order by 房间号", dbOpenDynaset)
  
     '列出记录
      If Not (EF.BOF And EF.EOF) Then
         Do While Not EF.EOF
            Combo2.AddItem EF("房间号")
          
            EF.MoveNext
         Loop
      End If
      Command1.Enabled = True
      'Command4.Enabled = True
            txtfield(12).Text = Date
            txtfield(14).Text = Date + 1
            txtfield(13).Text = Time
            txtfield(15).Text = Time
            txtfield(0).SetFocus
  EF.Close
  db.Close
  Command1.Enabled = True
  SearchIt
End Sub

Private Sub Form_Load()
checkPath ""
txtfield(12).Text = Date
txtfield(14).Text = Date + 1
txtfield(13).Text = Time
txtfield(15).Text = Time

End Sub

Private Sub Txtfield_Change(Index As Integer)
            txtfield(8).Text = Val(txtfield(6).Text) * Val(txtfield(7).Text)
            txtfield(10).Text = Val(txtfield(6).Text) * Val(txtfield(7).Text)
End Sub


Private Sub SearchIt()
'Grid1.Clear
'Grid1.FormatString = "凭  证  号  码  | 姓    名 |  房 间 号  | 住  宿  日  期 |   退  房  日  期  |退  房  时  间 "

 '检索数据
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("select * from steelno where 单据名称='住宿登记'", dbOpenDynaset)
  
  
     '列出记录
      
            
            Text1.Text = EF("单据号码") + 1
            
        
      
 '添加合计
  'Grid1.AddItem "" & vbTab & "  合  计 " & vbTab & "" _
                     & vbTab & "" & vbTab & vbTab & curSumQuanty & vbTab & "" _
                      & vbTab & curSumMoney & vbTab & ""
 '更换最后一行颜色
  'Grid1.Row = Grid1.Rows - 1
  'Dim X As Integer
      'For X = 7 To 0 Step -1
         'Grid1.Col = X
        ' Grid1.CellBackColor = &HE0E0D0
      'Next
  'Grid1.ColSel = 7
  
  EF.Close
  db.Close

End Sub





⌨️ 快捷键说明

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