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

📄 wait_krqd.frm

📁 一个简单的酒店管理系统 用VB.net+SQL2000实现
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            m_kr_sr.SetFocus
            m_kr_sr.SelStart = 0
            m_kr_sr.SelLength = Len(Trim(m_kr_sr.Text))
        
        End If
    Else
            m_kr_sr.SetFocus
            m_kr_sr.SelStart = 0
            m_kr_sr.SelLength = Len(Trim(m_kr_sr.Text))
    End If
End Sub

Private Sub m_jddw_mc_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        m_tsfw.SetFocus
    End If
End Sub


Private Sub Cmd3_Click(Index As Integer)
     Select Case Index
        Case 0
            Select Case wait_xg.txk_o
            Case "0", "3"
            '增加
            Set t_rec3 = PUB_data.OpenRecordset("SELECT * FROM YK_WAIT WHERE YDD_H='" & wait_dh.wait_dh & "'", 2, 0, 2)
                 If Not t_rec3.BOF Then
                      t_rec3.MoveLast
                 End If
                         t_rec3.AddNew
                             t_rec3!YDD_H = wait_dh.wait_dh
                             t_rec3!kr_x = IIf(Trim(m_kr_x.Text) = "", "*", UCase(Trim(m_kr_x.Text)))
                             t_rec3!kr_m = IIf(Trim(m_kr_m.Text) = "", "*", UCase(Trim(m_kr_m.Text)))
                             t_rec3!yw_x = IIf(Trim(m_yw_x.Text) = "", "*", UCase(Trim(m_yw_x.Text)))
                             t_rec3!yw_m = IIf(Trim(m_yw_m.Text) = "", "*", UCase(Trim(m_yw_m.Text)))
                             Set rec = PUB_data.OpenRecordset("SELECT YDD_H,RZRQ,LDRQ FROM YD_WAIT WHERE YDD_H='" & wait_dh.wait_dh & "'", 2, 0, 2)
                             
                             If Not rec.BOF Then
                                 rec.MoveLast
                                 t_rec3!rzrq = rec!rzrq
                                 t_rec3!ldrq = rec!ldrq
                             End If
                             rec.Close
                             
                             If xb(0).Value = True Then '判断性别
                                 t_rec3!kr_xbmc = "男"
                                 t_rec3!kr_xbdm = "1"
                             Else
                                 If xb(1).Value = True Then
                                     t_rec3!kr_xbmc = "女"
                                     t_rec3!kr_xbdm = "2"
                                 Else
                                     t_rec3!kr_xbmc = "*"
                                     t_rec3!kr_xbdm = "0"
                                 End If
                             End If
                             If Not m_kr_sr.Text = "    -  -  " Then
                                 t_rec3!kr_sr = CDate(m_kr_sr.Text)
                             End If
                             't_rec3!KR_SR = IIf(Trim(m_kr_sr.Text) = "    -  -  ", Null, CDate(m_kr_sr.Text))
                             t_rec3!gjmc = IIf(Trim(m_gjmc.Text) = "", "*", UCase(Trim(m_gjmc.Text)))
                             t_rec3!gjdm = IIf(Trim(m_gjdm.Text) = "", "*", UCase(Trim(m_gjdm.Text)))
                             t_rec3!zjmc = IIf(Trim(m_zjmc.Text) = "", "*", UCase(Trim(m_zjmc.Text)))
                             t_rec3!kr_zjhm = IIf(Trim(m_zjhm.Text) = "", "*", UCase(Trim(m_zjhm.Text)))
                             t_rec3!qzmc = IIf(Trim(m_qzmc.Text) = "", "*", UCase(Trim(m_qzmc.Text)))
                             If Not m_qzsx.Text = "    -  -  " Then
                                 t_rec3!kr_qz_yxq = CDate(m_qzsx.Text)
                             End If
                             't_rec3!KR_QZ_YXQ = IIf(Trim(m_qzsx.Text) = "    -  -  ", Null, CDate(m_qzsx.Text))
                             t_rec3!dz = IIf(Trim(m_dz.Text) = "", "*", UCase(Trim(m_dz.Text)))
                             t_rec3!BDJDDW_MC = IIf(Trim(m_jddw_mc.Text) = "", "*", UCase(Trim(m_jddw_mc.Text)))
                             t_rec3!jd_bz1 = IIf(Trim(m_bz1.Text) = "", "*", UCase(Trim(m_bz1.Text)))
                             t_rec3!tsfw = IIf(Trim(m_tsfw.Text) = "", "*", UCase(Trim(m_tsfw.Text)))
                             t_rec3!qzdm = IIf(Trim(m_qzdm.Text) = "", "*", UCase(Trim(m_qzdm.Text)))
                             t_rec3!zjdm = IIf(Trim(m_zjdm.Text) = "", "*", UCase(Trim(m_zjdm.Text)))
                             t_rec3!sydm = IIf(Trim(m_sydm.Text) = "", "*", UCase(Trim(m_sydm.Text)))
                             t_rec3!symc = IIf(Trim(m_symc.Text) = "", "*", UCase(Trim(m_symc.Text)))
                             t_rec3!jdy = IIf(Trim(m_jdy.Text) = "", "*", UCase(Trim(m_jdy.Text)))
                         
                             If Mid(wait_dh.wait_dh, 1, 2) = "SK" Then  ''***住客类型
                                 t_rec3!ZKLX = LoadResString(SYS_SKLX)
                             Else
                                 If Mid(wait_dh.wait_dh, 1, 2) = "TD" Then
                                     t_rec3!ZKLX = LoadResString(SYS_TDLX)
                                 Else
                                     If Mid(wait_dh.wait_dh, 1, 2) = "CB" Then
                                         t_rec3!ZKLX = LoadResString(SYS_CBLX)
                                     End If
                                 End If
                             End If
                             
                             t_rec3.CZY = SYS_USER
                             If Not Trim(m_gjdm.Text) = "" Then  ''**取国籍所属洲代码
                                 Set rec = PUB_data.OpenRecordset("SELECT GJDM,GJ_SSZDM FROM DT_KRGJK WHERE GJDM='" & UCase(Trim(m_gjdm.Text)) & "'", 4)
                                 If Not rec.BOF Then
                                     rec.MoveLast
                                     t_rec3!GJ_SSZDM = Trim(rec!GJ_SSZDM)
                                 End If
                                 rec.Close
                             End If
                             t_rec3!lock_no = 0
                     
                             
                             Dim j As Long
                             Dim t_1 As String
                             For j = 1 To 999
                                 t_1 = Right("00" & j, 3)
                                 Set rec = PUB_data.OpenRecordset("select YDD_H,LSH from YK_WAIT where YDD_H='" & wait_dh.wait_dh & "'AND Cstr(LSH)='" & CDec(t_1) & "'", 4)
                                 If Not rec.BOF Then
                                     rec.MoveLast
                                 Else: Exit For
                                 End If
                             Next
                             t_rec3!lsh = CDec(t_1)
                             Set rec = PUB_data.OpenRecordset("SELECT YDD_H,KR_MC,VIP_DJ,DFY_DM FROM YD_WAIT WHERE YDD_H='" & wait_dh.wait_dh & "'", 4)
                             If Not rec.BOF Then
                                 If Not IsNull(rec!KR_MC) Then
                                     t_rec3!TDMC = Trim(rec!KR_MC)
                                 Else
                                     t_rec3!TDMC = "*"
                                 End If
                                 
                                 If Not IsNull(rec!dfy_dm) Then
                                     t_rec3!dfy_dm = Trim(rec!dfy_dm)
                                 Else
                                     t_rec3!dfy_dm = "*"
                                 End If
                                 
                                 If Not IsNull(rec!vip_dj) Then
                                     t_rec3!vip_dj = rec!vip_dj
                                 Else
                                     t_rec3!vip_dj = 0
                                 End If
                             End If
                             rec.Close
                         t_rec3.Update
                     TT = True
                     Unload Me
            Case "1"  '****修改同行客人数据
                    Set t_rec3 = PUB_data.OpenRecordset("SELECT * FROM YK_WAIT WHERE YDD_H='" & wait_dh.wait_dh & "'AND CSTR(TRIM(LSH))='" & wait_xg.m_lsh & "'", 2, 0, 2)
                         If Not t_rec3.BOF Then
                             t_rec3.MoveLast
                                '加锁
                                Do
                                    Select Case Pub_lock("PUBLIC", "YK_WAIT", t_rec3)  '判断加锁结果
                                        Case "1" '锁定
                                            Exit Do
                                        Case "2"  '
                                            Call Pub_UNlock("YK_WAIT", t_rec3)
                                            Exit Sub
                                    End Select
                                Loop
                             t_rec3.Edit
                                t_rec3!kr_x = IIf(Trim(m_kr_x.Text) = "", "*", UCase(Trim(m_kr_x.Text)))
                                t_rec3!kr_m = IIf(Trim(m_kr_m.Text) = "", "*", UCase(Trim(m_kr_m.Text)))
                                t_rec3!yw_x = IIf(Trim(m_yw_x.Text) = "", "*", UCase(Trim(m_yw_x.Text)))
                                t_rec3!yw_m = IIf(Trim(m_yw_m.Text) = "", "*", UCase(Trim(m_yw_m.Text)))
                                If xb(0).Value = True Then '判断性别
                                    t_rec3!kr_xbmc = "男"
                                    t_rec3!kr_xbdm = "1"
                                Else
                                    If xb(1).Value = True Then
                                        t_rec3!kr_xbmc = "女"
                                        t_rec3!kr_xbdm = "2"
                                    Else
                                        t_rec3!kr_xbmc = "*"
                                        t_rec3!kr_xbdm = "0"
                                    End If
                                End If
                                If Not m_kr_sr.Text = "    -  -  " Then
                                    t_rec3!kr_sr = CDate(m_kr_sr.Text)
                                End If
                                't_rec3!KR_SR = IIf(Trim(m_kr_sr.Text) = "    -  -  ", Null, CDate(m_kr_sr.Text))
                                t_rec3!gjmc = IIf(Trim(m_gjmc.Text) = "", "*", UCase(Trim(m_gjmc.Text)))
                                t_rec3!gjdm = IIf(Trim(m_gjdm.Text) = "", "*", UCase(Trim(m_gjdm.Text)))
                                t_rec3!zjmc = IIf(Trim(m_zjmc.Text) = "", "*", UCase(Trim(m_zjmc.Text)))
                                t_rec3!kr_zjhm = IIf(Trim(m_zjhm.Text) = "", "*", UCase(Trim(m_zjhm.Text)))
                                t_rec3!qzmc = IIf(Trim(m_qzmc.Text) = "", "*", UCase(Trim(m_qzmc.Text)))
                                If Not m_qzsx.Text = "    -  -  " Then
                                    t_rec3!kr_qz_yxq = CDate(m_qzsx.Text)
                                End If
                                't_rec3!KR_QZ_YXQ = IIf(Trim(m_qzsx.Text) = "    -  -  ", Null, CDate(m_qzsx.Text))
                                t_rec3!dz = IIf(Trim(m_dz.Text) = "", "*", UCase(Trim(m_dz.Text)))
                                t_rec3!rzrq = dfqk_1.RQ1
                                t_rec3!ldrq = dfqk_1.RQ2
                                t_rec3!BDJDDW_MC = IIf(Trim(m_jddw_mc.Text) = "", "*", UCase(Trim(m_jddw_mc.Text)))
                                t_rec3!jd_bz1 = IIf(Trim(m_bz1.Text) = "", "*", UCase(Trim(m_bz1.Text)))
                                t_rec3!tsfw = IIf(Trim(m_tsfw.Text) = "", "*", UCase(Trim(m_tsfw.Text)))
                                t_rec3!qzdm = IIf(Trim(m_qzdm.Text) = "", "*", UCase(Trim(m_qzdm.Text)))
                                t_rec3!zjdm = IIf(Trim(m_zjdm.Text) = "", "*", UCase(Trim(m_zjdm.Text)))
                                t_rec3!sydm = IIf(Trim(m_sydm.Text) = "", "*", UCase(Trim(m_sydm.Text)))
                                t_rec3!symc = IIf(Trim(m_symc.Text) = "", "*", UCase(Trim(m_symc.Text)))
                                If Not Trim(m_gjdm.Text) = "" Then  ''**取国籍所属洲代码
                                    Set rec = PUB_data.OpenRecordset("SELECT GJDM,GJ_SSZDM FROM DT_KRGJK WHERE GJDM='" & UCase(Trim(m_gjdm.Text)) & "'", 4)
                                    If Not rec.BOF Then
                                        rec.MoveLast
                                        t_rec3!GJ_SSZDM = Trim(rec!GJ_SSZDM)
                                    End If
                                    rec.Close
                                End If
                               t_rec3.Update
                                
                                '解锁
                                Call Pub_UNlock("YK_WAIT", t_rec3)
                                TT = True
                                Unload Me
                                t_rec4.Close
                            
                        End If  '修改结束
                    Case "2"
                            Set t_rec3 = PUB_data.OpenRecordset("SELECT * FROM YK_WAIT WHERE YDD_H='" & wait_dh.wait_dh & "'", 2, 0, 2)
                            If Not t_rec3.BOF Then
                                 t_rec3.MoveLast
                                 '加锁
                                    Do
                                        Select Case Pub_lock("PUBLIC", "YK_WAIT", t_rec3)  '判断加锁结果
                                            Case "1" '锁定
                                                Exit Do
                                            Case "2"  '
                                                Call Pub_UNlock("YK_WAIT", t_rec3)
                                                Exit Sub
                                        End Select
                                    Loop
                                    t_rec3.Delete
                                    Call Pub_UNlock("YK_WAIT", t_rec3)
                            End If
                            t_rec3.Close
                            TT = True
                            Unload Me
                    Case "4"
                            TT = True
                            Unload Me
                    End Select
       Case 1
            TT = False
            Unload Me
    End Select
End Sub

Private Sub m_jdy_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        m_jddw_mc.SetFocus
        m_jddw_mc.SelStart = 0
        m_jddw_mc.SelLength = Len(Trim(m_jddw_mc.Text))
    End If
End Sub

Private Sub m_kr_m_Change()
    m_kr_m.Text = UCase(Trim(m_kr_m.Text))
End Sub

Private Sub m_kr_m_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        m_yw_x.SetFocus
        m_yw_x.SelStart = 0
        m_yw_x.SelLength = Len(Trim(m_yw_x.Text))
    End If
End Sub

Private Sub m_kr_sr_Change()
    MSG.Caption = ""
End Sub

Private Sub m_kr_sr_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        Call m_kr_sr_LostFocus
    End If
End Sub

Private Sub m_kr_sr_LostFocus()
    If Not m_kr_sr.Text = "    -  -  " Then
        t_rq = date_cl(Trim(m_kr_sr.Text))
            If t_rq <> "F" Then
                m_kr_sr = t_rq
            End If
            If IsDate(Trim(m_kr_sr.Text)) Then
                If CDate(m_kr_sr.Text) < Date Then
                      xb(0).SetFocus
                Else
                    MSG.Caption = "无效日期!"
                    m_kr_sr.SetFocus
                    m_kr_sr.SelStart = 0
                    m_kr_sr.SelLength = Len(Trim(m_kr_sr.Text))
                    Exit Sub
                End If
            Else
                    MSG.Caption = "无效日期!"
                    m_kr_sr.SetFocus
                    m_kr_sr.SelStart = 0
                    m_kr_sr.SelLength = Len(Trim(m_kr_sr.Text))
                    Exit Sub
            End If
    Else
        xb(0).SetFocus
    End If
End Sub

Private Sub m_kr_x_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        m_kr_m.SetFocus
        m_kr_m.SelStart = 0
        m_kr_m.SelLength = Len(Trim(m_kr_m.Text))
    End If
End Sub

Private Sub m_kr_x_LostFocus()
    m_kr_x.Text = UCase(Trim(m_kr_x.Text))
End Sub

Private Sub m_qzdm_Change()
    MSG.Caption = ""
End Sub

Private Sub m_qzdm_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        Call m_qzdm_LostFocus
    End If
End Sub

Private Sub m_qzdm_LostFocus()
    If Not Trim(m_qzdm.Text) = "" Then
        Set rec = PUB_data.OpenRecordset("SELECT QZDM,QZMC FROM DT_QZLX WHERE QZDM='" & Trim(UCase(m_qzdm.Text)) & "'", 4)
        If Not rec.BOF Then
            rec.MoveLast
            m_qzmc.Text = UCase(Trim(rec!qzmc))
            m_qzsx.SetFocus
            m_qzsx.SelStart = 0
            m_qzsx.SelLength = Len(Trim(m_qzsx.Text))
        Else
            MSG.Caption = "无效签证代码"
            m_qzdm.SetFocus
            m_qzdm.SelStart = 0
            m_qzdm.SelLength = Len(Trim(m_qzdm.Text))
        End If
        rec.Close
    Else
        If m_qzmc.Enabled = False Then
            m_qzmc.Enabled = True
            m_qzmc.SetFocus
        Else
            m_qzmc.SetFocus
        End If
    End If
End Sub
Private Sub m_qzmc_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        Call m_qzmc_LostFocus
    End If
End Sub

Private Sub m_qzmc_LostFocus()
    If Not Trim(m_qzmc.Text) = "" Then
        Set rec = PUB_data.OpenRecordset("SELECT QZDM,QZMC FROM DT_QZLX WHERE QZMC='" & UCase(Trim(m_qzmc.Text)) & "'", 4)
        If Not rec.BOF Then
            rec.MoveLast
            m_qzdm.Text = UCase(Trim(rec!qzdm))
            m_qzsx.SetFocus
            m_qzsx.SelStart = 0
            m_qzsx.SelLength = Len(Trim(m_qzsx.Text))
        End If
        rec.Close
    Else
        m_qzsx.SetFocus
        m_qzsx.SelStart = 0
        m_qzsx.SelLength = Len(Trim(m_qzsx.Text))
    End If
End Sub

Private Sub m_qzsx_Change()
    MSG.Caption = ""
End Sub

Private Sub m_qzsx_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        Call m_qzsx_LostFocus
    End If
End Sub

Private Sub m_qzsx_LostFocus()
    If Not m_qzsx.Text = "    -  -  " Then
        t_rq = date_cl(Trim(m_qzsx.Text))
        If t_rq <> "F" Then
            m_qzsx = t_rq
        End If
        If IsDate(Trim(m_qzsx.Text)) Then
            If CDate(m_qzsx.Text) >= Date Then
                  m_dz.SetFocus
            Else
                MSG.Caption = "无效日期!"
                m_qzsx.SetFocus
                m_qzsx.SelStart = 0
                m_qzsx.SelLength = Len(Trim(m_qzsx.Text))
                Exit Sub
            End If
        Else
            MSG.Caption = "无效日期!"
            m_qzsx.SetFocus
            m_qzsx.SelStart = 0
            m_qzsx.SelLength = Len(Trim(m_qzsx.Text))
            Exit Sub
        End If
    Else
        m_dz.SetFocus
    End If
End Sub
Private Sub m_sydm_Change()
    MSG.Caption = ""
End Sub

Private Sub m_sydm_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        Call m_sydm_LostFocus
    End If
End Sub

Private Sub m_sydm_LostFocus()
    If Not Trim(m_sydm.Text) = "" Then
        Set rec = PUB_data.OpenRecordset("SELECT SYDM,SYMC FROM DT_LLSY WHERE SYDM='" & UCase(Trim(m_sydm.Text)) & "'", 4)
        If Not rec.BOF Then
            rec.MoveLast
            m_symc.Text = UCase(Trim(rec!symc))
            m_jddw_mc.SetFocus
            m_jddw_mc.SelStart = 0
            m_jddw_mc.SelLength = Len(Trim(m_jddw_mc.Text))
        Else
            MSG.Caption = "无效事由代码"
            m_sydm.SetFocus
            m_sydm.SelStart = 0
            m_sydm.SelLength = Len(Trim(m_sydm.Text))
        End If
            rec.Close
    Else
        If m_symc.Enabled = False Then
            m_symc.Enabled = True
            m_symc.SetFocus
        Else
            m_symc.SetFocus
        End If

⌨️ 快捷键说明

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