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

📄 mdihotelmain.frm

📁 宾馆管理系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:
   End
   Begin VB.Menu mnuskin 
      Caption         =   "更换皮肤(&G)"
      Begin VB.Menu mnuItemYH 
         Caption         =   "咖啡韵味"
      End
      Begin VB.Menu mnuItemKF 
         Caption         =   "深蓝之梦"
      End
      Begin VB.Menu mnuItemSL 
         Caption         =   "浩渺银河"
      End
   End
   Begin VB.Menu mnuxthelp 
      Caption         =   "系统维护(&H)"
      Begin VB.Menu mnubackup 
         Caption         =   "数据备份/恢复"
      End
      Begin VB.Menu mnuhelp 
         Caption         =   "软件帮助"
      End
      Begin VB.Menu mnume 
         Caption         =   "关于本软件"
      End
   End
End
Attribute VB_Name = "mdiHotelmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Pic(1 To 12) As String
Dim i As Integer
Dim icounter As Integer
Dim h As Integer
Dim str As String
Dim rs As New ADODB.Recordset

Private Sub cmd_Click(Index As Integer)
    Dim str1, str2, str3 As Integer
    Dim c, d, no As Integer
     Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select 客户账号 =cAccountId,楼层数=cRoomStory,房间号=cRoomNo,主客户名= cClientName,性别=cSex ,证件类型=cZJ,证件号=cZJ_No ,抵达时间=dRoom_In,离店时间=dRoom_Out,房间类型=cRoomType from tbSK_Book  where cRoomNo='" & Index + 1 & "'"
    Set DataGrid1.DataSource = Adodc1
    Adodc1.Refresh
       

    If Not Adodc1.Recordset.EOF Then
       c = Format(Adodc1.Recordset.Fields(8), "mm") - Format(Now, "mm")
       d = Format(Adodc1.Recordset.Fields(8), "dd") - Format(Now, "dd")
       no = c * 30 + d
       If no >= 0 Then
       
        Label4.Caption = Adodc1.Recordset.Fields(1)
        Label5.Caption = Adodc1.Recordset.Fields(7)
        
        
        str2 = Format(Now, "mm") - Format(Adodc1.Recordset.Fields(7), "mm")
        str3 = Format(Now, "dd") - Format(Adodc1.Recordset.Fields(7), "dd")
        str1 = str2 * 30 + str3 + 1
        Label6.Caption = str1 & "天"
        Else
        Label4.Caption = ""
        Label5.Caption = ""
        Label6.Caption = ""
        Adodc1.Recordset.Delete
        End If
        
    Else
        Label4.Caption = ""
        Label5.Caption = ""
        Label6.Caption = ""
       
    End If
    lblroomno.Caption = Index + 1
   Adodc1.Recordset.Close
    Adodc1.Refresh
    
    Dim rst As New ADODB.Recordset
    If Index + 1 <= 8 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第一层'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
    Label3.Caption = rst!mRoomPrice
    End If
    ElseIf Index + 1 <= 16 And Index + 1 > 8 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第二层'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
    Label3.Caption = rst!mRoomPrice
    End If
    ElseIf Index + 1 > 16 And Index + 1 <= 24 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第三层'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
    Label3.Caption = rst!mRoomPrice
    End If
    ElseIf Index + 1 > 24 And Index + 1 <= 32 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第四层'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
    Label3.Caption = rst!mRoomPrice
    End If
    
    End If
End Sub

Private Sub cmddisplay_Click()
Dim num As Integer
num = 1
While num <= 32
Dim rst As New ADODB.Recordset
txtsql = "select * from tbSK_Book where cRoomNo = '" & num & "'"
Set rst = ExecuteSQL(txtsql)
cmd(num - 1).Visible = True
num = num + 1
Wend
End Sub

Private Sub cmdguolu_Click()
Dim num As Integer
num = 1
While num <= 32
Dim rst As New ADODB.Recordset
txtsql = "select * from tbNewRoomStatus where cRoomType='" & Combo1.Text & "' and cRoomNo = '" & num & "'"
Set rst = ExecuteSQL(txtsql)
If Not rst.EOF Then
    cmd(num - 1).Visible = True
Else
    cmd(num - 1).Visible = False

End If
num = num + 1
Wend
End Sub



Private Sub Command2_Click()
   Unload mdiHotelmain
   Load mdiHotelmain
   mdiHotelmain.Show
End Sub

Private Sub Command8_Click()
List1.AddItem "-" & Now
List1.AddItem "-" & Text1.Text
End Sub




Private Sub Label2_Click()

End Sub

Private Sub MDIForm_Load()
 strSkin = "Web-II.skn"
    Call changeskin(Me, sknmain, strSkin)
    status.Panels("name").Text = "操作人员:" & username
    Dim rstbe As New ADODB.Recordset
    txtsql = "select cPosition from tbLogin where cName='" & username & "'"
    Set rstbe = ExecuteSQL(txtsql)
    If rstbe!cPosition = "管理用户" Then
       mnuAdd.Enabled = True
       mnudelete.Enabled = True
    Else
        mnuAdd.Enabled = False
        mnudelete.Enabled = False
    End If
    rstbe.Close
     
    Dim rstg As New ADODB.Recordset
    txtsql = "delete tbNewRoomStatus where cRoomType='预定' or cRoomType='占用'or cRoomType='停用'"
    Set rstg = ExecuteSQL(txtsql)

    Dim rstlo As New ADODB.Recordset
    txtsql = "insert into tbNewRoomStatus select cRoomStory,cRoomNo,cRoomType from tbSK_Book"
    Set rstlo = ExecuteSQL(txtsql)
    
    Dim rstlog As New ADODB.Recordset
    txtsql = "insert into tbNewRoomStatus select cRoomStory,cRoomNo,cRoomType from tbRoomStatus"
    Set rstlog = ExecuteSQL(txtsql)
               
    Combo1.AddItem "占用"
    Combo1.AddItem "预定"
    Combo1.AddItem "停用"
       
    Pic(1) = "16.jpg"
    Pic(2) = "17.jpg"
    Pic(3) = "18.jpg"
    Pic(4) = "19.jpg"
    Pic(5) = "20.jpg"
    Pic(6) = "21.jpg"
    Pic(7) = "22.jpg"
    Pic(8) = "23.jpg"
    Pic(9) = "24.jpg"
    Pic(10) = "29.jpg"
    Pic(11) = "30.jpg"
    Pic(12) = "31.jpg"
    
    
    
    imaga.Picture = LoadPicture(App.Path + "\图片\" + Pic(1))
    
    Label2.Caption = "32"
    
    
    Dim rst As New ADODB.Recordset
    Dim num As Integer
    Dim icounter, no, a, b, c, d As Integer
    Dim e, f As Integer
    e = 0
    While num <= 32
    txtsql = "select * from tbSK_Book where cRoomNo = '" & num & "'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
        a = Format(rst.Fields(7), "mm") - Format(Now, "mm")
        b = Format(rst.Fields(7), "dd") - Format(Now, "dd")
        
        c = Format(rst.Fields(8), "mm") - Format(Now, "mm")
        d = Format(rst.Fields(8), "dd") - Format(Now, "dd")
        icounter = a * 30 + b
        no = c * 30 + d
        
        If icounter > 0 Then
             cmd(num - 1).Picture = LoadPicture(App.Path + "\图片\12.jpg")
             e = e + 1
        ElseIf icounter <= 0 And no >= 0 Then
            cmd(num - 1).Picture = LoadPicture(App.Path + "\图片\11.jpg")
            f = f + 1
            rst("cRoomType") = "占用"
            rst.Update
            
        ElseIf no < 0 Then
           ' cmd(num - 1).Picture = LoadPicture(App.Path + "\图片\14.jpg")
            'rst("cRoomType") = "可用"
           ' rst.Update
            
            Label4.Caption = ""
            Label5.Caption = ""
            Label6.Caption = ""
        End If
     End If
     num = num + 1
    Wend
    rst.Close
    Label1.Caption = e
    Label10.Caption = f
   
    
    Dim it, inte As Integer
    While it <= 32
    txtsql = "select * from tbRoomStatus where cRoomType='停用' and cRoomNo = '" & it & "'"
    Set rst = ExecuteSQL(txtsql)
    If Not rst.EOF Then
        cmd(it - 1).Picture = LoadPicture(App.Path + "\图片\13.jpg")
        inte = inte + 1
    End If
    it = it + 1
    Wend
    rst.Close
    Label11.Caption = inte
    
    Label9.Caption = 32 - e - f - inte
    
End Sub
Private Sub mnuexit_Click()
    End
End Sub

Private Sub mnuAdd_Click()
frmaddnew.Show
End Sub

Private Sub mnubackup_Click()
frmbackup.Show
End Sub

Private Sub mnubook_menu_Click()
frmYDKD.Show
End Sub

Private Sub mnucheckout_Click()
frmBKJZ.Show
End Sub

Private Sub mnuClient_pay_Click()
frmXFBB.Show
End Sub

Private Sub mnuCZY_Click()
frmuser_info.Show
End Sub

Private Sub mnudelete_Click()
frmdelete.Show
End Sub

Private Sub mnuE_info_Click()
frmEmp_info.Show
End Sub

Private Sub mnuhelp_Click()
App.HelpFile = App.Path & "\help\helpdemo.hlp"
SendKeys "{F1}"
End Sub

Private Sub mnuhomebiao_Click()
frmRoomStatus.Show
End Sub

Private Sub mnuhomesta_Click()
frmRoomStatus.Show
End Sub

Private Sub mnuItemKF_Click()
strSkin = "Web-II.skn"
Call changeskin(Me, sknmain, strSkin)
End Sub

Private Sub mnuItemSL_Click()
strSkin = "B-Studio.skn"
Call changeskin(Me, sknmain, strSkin)
End Sub

Private Sub mnuItemYH_Click()
strSkin = "galaxy.skn"
Call changeskin(Me, sknmain, strSkin)
End Sub

Private Sub mnuJD_Click()
FrmJDBB.Show
End Sub

Private Sub mnuLD_menu_Click()
frmLeaveHotel.Show
End Sub

Private Sub mnume_Click()
frmAboutthesoftware.Show
End Sub

Private Sub mnuquanxian_Click()
frmQuanxian.Show
End Sub

Private Sub mnureceive_Click()
frmJDGL.Show
End Sub

Private Sub mnuupdatepw_Click()
frmreset.Show
End Sub

Private Sub mnuYD_Click()
frmYDBB.Show
End Sub

Private Sub mnuyuding_Click()
frmYDGL.Show
End Sub

Private Sub mnuZD_menu_Click()
frmJDKD.Show
End Sub

Private Sub mnuZH_query_Click()
frmQuery.Show
End Sub

Private Sub Timer1_Timer()
    i = i + 1
    If i <= 12 Then
       imaga.Picture = LoadPicture(App.Path + "\图片\" + Pic(i))
    Else
       i = 0
    End If
    
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.key
    Case "YDGL"
        frmYDGL.Show
        mdiHotelmain.Enabled = False
    Case "JDGL"
        frmJDGL.Show
    Case "ZJXF"
        frmZJXF.Show
    Case "BKJZ"
        frmBKJZ.Show
    Case "DZTX"
        frmDZTX.Show
    Case "KHGL"
        frmKHGL.Show
    Case "XTGL"
        frmXTGL.Show
    Case "TCXT"
        End
End Select
End Sub

⌨️ 快捷键说明

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