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

📄 房态图.frm

📁 利用VB编写的一个完整的酒店管理程序,支持双数据库!
💻 FRM
📖 第 1 页 / 共 2 页
字号:
             
            EF.MoveNext
         Loop
      End If
  EF.Close
  db.Close
  
  
  If Form26.Command1.Enabled = True Then
 Frame5.Visible = True
 Else
 Frame5.Visible = False
  End If
    
End Sub

Private Sub Form_Load()
'On Error GoTo err18
'FIXIT: Me.CurrentY property 没有 Visual Basic .NET 等效项,将不升级。                                FixIT90210ae-R7593-R67265
'FIXIT: Me.CurrentX property 没有 Visual Basic .NET 等效项,将不升级。                                FixIT90210ae-R7593-R67265
retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, 11880, 8280, SWP_SHOWWINDOW)

SfIt

End Sub



Private Sub Option1_Click()
    
    Me.Frame2.Visible = True
    Me.Frame3.Visible = False
    Me.Text1.SetFocus
    
End Sub

Private Sub Option2_Click()

    
    
    Me.Combo1.Clear
    Me.Frame2.Visible = False
    Me.Frame3.Visible = True
   
    SearchIt
   

End Sub

Private Sub Option3_Click()



    Me.Combo1.Clear
    Me.Frame2.Visible = False
    Me.Frame3.Visible = True
    Me.Combo1.Clear
   
   SIt
   
   
   
   
   

End Sub

Private Sub Option4_Click()

 Dim i As Long
Dim List_item As ListItem
checkPath ""
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, True, Constr)
  Set EF = db.OpenRecordset("select * from kf where 房间号<'999999' order by 房间号", dbOpenDynaset)
  
 
      
      
  
     '列出记录
     
    Me.ListView1.ListItems.Clear
    For i = 0 To 4
        Room(i) = 0
    Next
    While Not EF.EOF
        Select Case EF("房态")
        Case "空房"
            ListView1.ListItems.Add , , EF("房间号"), 1
            Room(0) = Room(0) + 1
        Case "脏房"
            ListView1.ListItems.Add , , EF("房间号"), 2
            Room(1) = Room(1) + 1
        Case "维修"
            ListView1.ListItems.Add , , EF("房间号"), 3
            Room(2) = Room(2) + 1
        Case "售出"
            ListView1.ListItems.Add , , EF("房间号"), 4
            Room(3) = Room(3) + 1
        Case "预订"
            ListView1.ListItems.Add , , EF("房间号"), 5
            Room(4) = Room(4) + 1
         Case "自用"
            ListView1.ListItems.Add , , EF("房间号"), 6
            
        Case Else
            ListView1.ListItems.Add , , EF("房间号"), 1
        End Select
        EF.MoveNext
        
    Wend
    EF.Close
    db.Close
    Me.Label7.caption = "空房:" & CStr(Room(0))
    Me.Label8.caption = "脏房:" & CStr(Room(1))
    Me.Label9.caption = "维修房:" & CStr(Room(2))
    Me.Label10.caption = "售出:" & CStr(Room(3))
    Me.Label11.caption = "预订:" & CStr(Room(4))
    Me.Label12.caption = "合计:" & CStr(Room(0) + Room(1) + Room(2) + Room(3) + Room(4))
    Me.Label13.caption = "出租率:" & (Round(Room(3) / (Room(0) + Room(1) + Room(2) + Room(3) + Room(4)), 2) * 100) & "%"
    Select Case Load_Statu
    Case "使用"
        Me.Command5.Visible = True
        Me.Command6.Visible = True
        Me.Command4.Visible = False
    Case "显示"
        If Registration_Type = "" Then
            Me.Command4.Visible = True
        Else
            Me.Command4.Visible = False
        End If
    End Select
    
    Exit Sub
    
err18:
    MsgBox "操作错误,错误代码1018", 48, "提示"

End Sub






 



Private Sub SearchIt()

 '检索数据
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, True, Constr)
  Set EF = db.OpenRecordset("select * from 房间状态", dbOpenDynaset)
  
  
  
     '列出记录
      If Not (EF.BOF And EF.EOF) Then
         Do While Not EF.EOF
            Combo1.AddItem EF("房间状态")
                    
           
          
            EF.MoveNext
         Loop
      End If
      
 '
  EF.Close
  db.Close

End Sub


Private Sub SIt()

 '检索数据
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, True, Constr)
  Set EF = db.OpenRecordset("select * from kflx", dbOpenDynaset)
  
  
  
     '列出记录
      If Not (EF.BOF And EF.EOF) Then
         Do While Not EF.EOF
            Combo1.AddItem EF("客房类型")
                    
           
          
            EF.MoveNext
         Loop
      End If
      
 '
  EF.Close
  db.Close

End Sub


Private Sub Timer2_Timer()
checkPath ""
SfIt
End Sub
Private Sub SfIt()
Dim i As Long
Dim List_item As ListItem

  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, True, Constr)
  Set EF = db.OpenRecordset("select * from kf where 房间号<'999999' order by 房间号", dbOpenDynaset)
  
 
      
      
  
     '列出记录
     
    Me.ListView1.ListItems.Clear
    For i = 0 To 4
        Room(i) = 0
    Next
    While Not EF.EOF
        Select Case EF("房态")
        Case "空房"
            ListView1.ListItems.Add , , EF("房间号"), 1
            Room(0) = Room(0) + 1
        Case "脏房"
            ListView1.ListItems.Add , , EF("房间号"), 2
            Room(1) = Room(1) + 1
        Case "维修"
            ListView1.ListItems.Add , , EF("房间号"), 3
            Room(2) = Room(2) + 1
        Case "售出"
            ListView1.ListItems.Add , , EF("房间号"), 4
            Room(3) = Room(3) + 1
        Case "预订"
            ListView1.ListItems.Add , , EF("房间号"), 5
            Room(4) = Room(4) + 1
         Case "自用"
            ListView1.ListItems.Add , , EF("房间号"), 6
            
        Case Else
            ListView1.ListItems.Add , , EF("房间号"), 1
        End Select
        EF.MoveNext
        
    Wend
    EF.Close
    db.Close
    Me.Label7.caption = "空房:" & CStr(Room(0))
    Me.Label8.caption = "脏房:" & CStr(Room(1))
    Me.Label9.caption = "维修房:" & CStr(Room(2))
    Me.Label10.caption = "售出:" & CStr(Room(3))
    Me.Label11.caption = "预订:" & CStr(Room(4))
    Me.Label12.caption = "合计:" & CStr(Room(0) + Room(1) + Room(2) + Room(3) + Room(4))
   ' Me.Label13.caption = "出租率:" & (Round(Room(3) / (Room(0) + Room(1) + Room(2) + Room(3) + Room(4)), 2) * 100) & "%"
    Select Case Load_Statu
    Case "使用"
        Me.Command5.Visible = True
        Me.Command6.Visible = True
        Me.Command4.Visible = False
    Case "显示"
        If Registration_Type = "" Then
            Me.Command4.Visible = True
        Else
            Me.Command4.Visible = False
        End If
    End Select
    
    Exit Sub
    

End Sub

'---------------------------------------------------------------------------------
Private Sub Command9_Click()
If Trim(txtfield(0).Text) = "" Then
      MsgBox "对不起,房间号必须输入?   ", vbInformation, "Hello!"
      txtfield(0).SetFocus
      Exit Sub
  End If
   
 '开始保存内容
   Dim db As Database
  Dim EF As Recordset
  
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from kf where 房间号= '" & txtfield(0).Text & "'", dbOpenDynaset)
  
    
      '==================1
'FIXIT: 用 "Trim$" 函数替换 "Trim" 函数                                                           FixIT90210ae-R9757-R1B8ZE
       If Trim(txtfield(0).Text) <> "" Then
          EF.Edit
          EF("房态") = "空房"
          
           
          
          EF.Update
          
          
       End If
      '-----------------2
      
      '-----------------
      
  EF.Close
  db.Close
   
  MsgBox "房间状态已经修改为空闲   ", vbInformation
 'Caozuo = "修改房态按钮 '" & txtfield(0).Text & " '房间为空闲 "
'lu_time = Now
'RiZhil
 txtfield(0) = ""
 txtfield(0).SetFocus


End Sub




Private Sub Command8_Click()
If Trim(txtfield(0).Text) = "" Then
      MsgBox "对不起,房间号必须输入?   ", vbInformation, "Hello!"
      txtfield(0).SetFocus
      Exit Sub
  End If
   
 '开始保存内容
   Dim db As Database
  Dim EF As Recordset
  
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from kf where 房间号= '" & txtfield(0).Text & "'", dbOpenDynaset)
  
    
      '==================1
'FIXIT: 用 "Trim$" 函数替换 "Trim" 函数                                                           FixIT90210ae-R9757-R1B8ZE
       If Trim(txtfield(0).Text) <> "" Then
          EF.Edit
          EF("房态") = "维修"
          
           
          
          EF.Update
          
          
       End If
      '-----------------2
      
      '-----------------
      
  EF.Close
  db.Close
    'Caozuo = "修改房态按钮 '" & txtfield(0).Text & " '房间为维修 "
'lu_time = Now
'RiZhil
  MsgBox "房间状态已经修改为维修   ", vbInformation

 txtfield(0).Text = ""
 txtfield(0).SetFocus
End Sub

Private Sub Command7_Click()
If Trim(txtfield(0).Text) = "" Then
      MsgBox "对不起,房间号必须输入?   ", vbInformation, "Hello!"
      txtfield(0).SetFocus
      Exit Sub
  End If
   
 '开始保存内容
   Dim db As Database
  Dim EF As Recordset
  
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from kf where 房间号= '" & txtfield(0).Text & "'", dbOpenDynaset)
  
    
      '==================1
'FIXIT: 用 "Trim$" 函数替换 "Trim" 函数                                                           FixIT90210ae-R9757-R1B8ZE
       If Trim(txtfield(0).Text) <> "" Then
          EF.Edit
          EF("房态") = "售出"
          
           
          
          EF.Update
          
          
       End If
      '-----------------2
      
      '-----------------
      
  EF.Close
  db.Close
   
  MsgBox "房间状态已经修改为入住   ", vbInformation
 'Caozuo = "修改房态按钮 '" & txtfield(0).Text & " '房间为入住 "
'lu_time = Now
'RiZhil
 txtfield(0).Text = ""
 txtfield(0).SetFocus
End Sub

Private Sub Command4_Click()
If Trim(txtfield(0).Text) = "" Then
      MsgBox "对不起,房间号必须输入?   ", vbInformation, "Hello!"
      txtfield(0).SetFocus
      Exit Sub
  End If
   
 '开始保存内容
   Dim db As Database
  Dim EF As Recordset
  
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from kf where 房间号= '" & txtfield(0).Text & "'", dbOpenDynaset)
  
    
      '==================1
'FIXIT: 用 "Trim$" 函数替换 "Trim" 函数                                                           FixIT90210ae-R9757-R1B8ZE
       If Trim(txtfield(0).Text) <> "" Then
          EF.Edit
          EF("房态") = "脏房"
          
           
          
          EF.Update
          
          
       End If
      '-----------------2
      
      '-----------------
      
  EF.Close
  db.Close
   
  MsgBox "房间状态已经修改为打扫   ", vbInformation
' Caozuo = "修改房态按钮 '" & txtfield(0).Text & " '房间为打扫 "
'lu_time = Now
'RiZhil
 txtfield(0).Text = ""
 txtfield(0).SetFocus
End Sub

Private Sub Command5_Click()
If Trim(txtfield(0).Text) = "" Then
      MsgBox "对不起,房间号必须输入?   ", vbInformation, "Hello!"
      txtfield(0).SetFocus
      Exit Sub
  End If
   
 '开始保存内容
   Dim db As Database
  Dim EF As Recordset
  
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset("Select * from kf where 房间号= '" & txtfield(0).Text & "'", dbOpenDynaset)
  
    
      '==================1
'FIXIT: 用 "Trim$" 函数替换 "Trim" 函数                                                           FixIT90210ae-R9757-R1B8ZE
       If Trim(txtfield(0).Text) <> "" Then
          EF.Edit
          EF("房态") = "自用"
          
           
          
          EF.Update
          
          
       End If
      '-----------------2
      
      '-----------------
      
  EF.Close
  db.Close
   
  MsgBox "房间状态已经修改为自用   ", vbInformation
' Caozuo = "修改房态按钮 '" & txtfield(0).Text & " '房间为自用"
'lu_time = Now
'RiZhil

 txtfield(0).Text = ""
 txtfield(0).SetFocus
End Sub
































⌨️ 快捷键说明

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