Public Class frmRooms

    Private Sub cboroomType_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cboroomType.KeyPress
        e.Handled = True
    End Sub
    Private Sub txtRoomNum_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRoomNum.KeyPress, txtPerson.KeyPress
        Numbers_Only(e)
    End Sub

    Private Sub txtRoomPrice_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRoomPrice.KeyPress
        CURENCY_ONLY(e, txtRoomPrice)
    End Sub
    Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
        Save_OR_Update_Rooms(txtRoomid.Text)
    End Sub

    Private Sub frmRooms_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        cleartext(Me)
        txtRoomid.Text = loadautonumberWithKey("ROOMID")
        fillcbo("SELECT * FROM `tblroomtype`  ", cboroomType, "ROOMTYPE", "ROOMTYPEID", "Select")

        Availability_Room()
    End Sub

    Private Sub btnnew_Click(sender As Object, e As EventArgs) Handles btnnew.Click
        cleartext(Me)
        txtRoomid.Text = loadautonumberWithKey("ROOMID")
        fillcbo("SELECT * FROM `tblroomtype`  ", cboroomType, "ROOMTYPE", "ROOMTYPEID", "Select")

        Availability_Room()
    End Sub

    Private Sub dtgList_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dtgList.CellClick
        edit_Rooms(dtgList.CurrentRow.Cells(0).Value)
    End Sub

    Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
        delete_Rooms(dtgList.CurrentRow.Cells(0).Value)

        cleartext(Me)
        txtRoomid.Text = loadautonumberWithKey("ROOMID")
        fillcbo("SELECT * FROM `tblroomtype`  ", cboroomType, "ROOMTYPE", "ROOMTYPEID", "Select")

        Availability_Room()

    End Sub
End Class
