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

📄 feditbooking.vb

📁 This is a sample of login file in asp pages format
💻 VB
字号:
Imports System.Data.OleDb
Public Class fEditBooking

    Private Sub fEditBooking_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'OpenConnect()
        LoadRoomType(cboRType)
    End Sub

    Private Sub cboRType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboRType.SelectedIndexChanged
        LoadRoomNum(cboRNum, cboRType, txtAmount, txtFloor, txtStaying, txtTotal)
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub txtStaying_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtStaying.TextChanged
        txtTotal.Text = Val(txtStaying.Text) * Format(txtAmount.Text, "currency")
        txtTotal.Text = Format(txtTotal.Text, "Currency")
    End Sub

    Private Sub txtPrepaid_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPrepaid.LostFocus
        PrepaidLostFocus(txtPrepaid, txtTotal)
    End Sub

    Private Sub txtPrepaid_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPrepaid.TextChanged
        If txtPrepaid.Text <> "" Then
            txtRemain.Text = Format(txtTotal.Text, "Currency") - Format(txtPrepaid.Text, "Currency")
            txtRemain.Text = Format(txtRemain.Text, "Currency")
        End If
    End Sub

    Private Sub btnSCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSCustomer.Click
        SCustomer(cboCusName, txtCusID, txtGender, txtAddress, txtPassNo, txtCardNo)
    End Sub

    Private Sub cboRNum_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboRNum.SelectedIndexChanged
        LoadFloor(cboRNum, txtFloor)
    End Sub

    Private Sub cboCusName_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cboCusName.KeyPress
        If Asc(e.KeyChar) = 13 Then
            btnSCustomer_Click(sender, e)
        End If
    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        If cboCusName.Text = "" Then
            Message("Choose one Customer to Booking.")
            cboCusName.Focus()
        ElseIf txtStaying.Text = "" Then
            Message("Complete Number of Staying.")
            txtStaying.Focus()
        ElseIf cboRNum.Text = "" Then
            Message("Choose One Room Number.")
            cboRNum.Focus()
        ElseIf txtPrepaid.Text = "" Then
            Message("Complete Prepaid.")
            txtPrepaid.Focus()
        Else
            Com.CommandText = "Update TblBooking set BookingDate=?,Staying=?,CheckInDate=?,CusID=?," & _
            "RoomNo=?,Prepaid=? where ID=?"
            With Com.Parameters
                .Add("@DIn", OleDbType.Date).Value = DTBooking.Text
                .Add("@Staying", OleDbType.Integer).Value = txtStaying.Text
                .Add("@DOut", OleDbType.Date).Value = DTCheckIn.Text
                .Add("@CID", OleDbType.VarChar).Value = txtCusID.Text
                .Add("@RNo", OleDbType.Integer).Value = cboRNum.Text
                .Add("@Prepaid", OleDbType.Currency).Value = txtPrepaid.Text
                .Add("@ID", OleDbType.Integer).Value = BID
            End With
            Com.ExecuteNonQuery()
            Com.Parameters.Clear()
            Message("Success.")
            Clearcus()
            txtStaying.Clear()
            txtAmount.Clear()
            txtTotal.Clear()
            txtPrepaid.Clear()
            txtRemain.Clear()
            cboCusName.Focus()
        End If
    End Sub

    Sub Clearcus()
        cboCusName.Text = ""
        txtCusID.Clear()
        txtGender.Clear()
        txtAddress.Clear()
        txtPassNo.Clear()
        txtCardNo.Clear()
    End Sub

    Private Sub cboCusName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboCusName.TextChanged
        If cboCusName.Text = "" Then
            Clearcus()
        End If
    End Sub
End Class

⌨️ 快捷键说明

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