Bca Bsc-It
Bca Bsc-It
Bca Bsc-It
AKASH SHAH Towards the Partial Fulfillment of the BACHELOR OF COMPUTER APPLICATION
2011-2012
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY NASIK A PROJECT REPORT ON HOTEL MANAGEMENT SYSTEM By NIKHIL KADAM MOHIT TARSARIA AKASH SHAH Towards the Partial Fulfillment of the BACHELOR OF COMPUTER APPLICATION
2011-2012
CERTIFICATION
This is to certify that the project ONLINE LEARNING MANAGEMENT SYSTEM Has been satisfactorily completed by
Examiner
ACKNOWLEDGEMENT
With immense please we are presenting HOTEL MANAGEMENT SYSTEM project as a part of the curriculum of BACHELOR OF COMPUTER APPLICATION. We wish to thank all the people who gave us ending support. I/We express my/our profound thanks to our head of department Mr./Mrs. Dr. Lahu Teli, project guide & project incharge Mr./Mrs. Lalan Toraskar & all those who have indirectly guided & helped us in the preparation of this project.
SR. NO.
TOPICS
1.
INTRODUCTION
2.
PROPOSED SYSTEM
3. 4.
5.
TESTING PROCEDURE
6. 7.
8.
9.
CONCLUSION
10.
BIBLIOGRAPHY
MICROSOFT ACCESS
It is databased management system from microsoft It stores data in its own format based on the Access Jet data based engine It can also import data or link directly to data stored in other application and databased. Software developer and data architects can use access to develop application software and power user It is supported by Visual basic for application User can create tables, queries and reports . Access can also have report creation features that can work with any data sorce that access can access
PROJECT SYNOPSIS
64 MB Or Higher
TEAM SIZE: This project done by a 3 Member team, the work was divided equally at every stage of the lifecycle of the project among the team members.
CONTENTS
Table of Contents Chapter 1 Introduction........................................................................................ 1.1 Profile ............................................................................................................ 1.2 Existing System... 1.3 Problem in Existing System .......................................................................
1.4 Needs for Computerization.
Chapter 2 Proposed Systems............................................................................... 2.1 Proposed System .......................................................................................... 2.2 Hardware and Software Specification ....................................................... 2.3 Feasibility Study ........................................................................................... Chapter 3 Analysis ............................................................................................. 3.1 Context level Diagram ................................................................................. 3.2 Data flow Diagram ....................................................................................... 3.3 Entity Relationship Diagram.. Chapter 4 System design ................................................................................... 4.1 Data Element ............................................................................................... 4.2 Input Element ............................................................................................. Chapter 5.Testing Procedure ............................................................................ Chapter 6.Output Screen .................................................................................. Chapter 7.Implementaion Procedure............................................................... Chapter 8. Scope for Future Enchancement ................................................. Chapter 7.Conclusion Chapter 8.Bibliography .....................................................................................
1. INTRODUCTION
INTRODUCTION
1.1
Company Profile.
Karavali Hotels Pvt. Ltd. the choice of thousands of tourists from all over India and abroad. They provide all kinds of three star facilities. Karavali Hotels Pvt. Ltd, combines business with pleasure, style with substance, form with function and hence makes an ideal stay to explorers as well as business travellers. Karavali Hotels Pvt. Ltd. is sure to offer you a memorable stay. The guest list includes number of dignitaries and celebrities which makes Karavali Hotels Pvt. Ltd. all the more famous. Karavali Hotels Pvt. Ltd. welcomes you to Udupi for an enticing experience by offering a unique blend of Indian and Asian Hospitality. It is a place you can relax with your family or entertain your guests in three star comforts, for a fraction of the cost. Situated on touched to National Highway 17 overlooking Udupi City has an ample parking area. The rooms are well maintained and managed by a team of professionals with a decade of experience in the hospitality industry and dedicated to quality service with well furnished rooms comprising of 1 Presidential Suite Room, 2 Deluxe Suite Rooms followed by Air- Conditioned Deluxe Rooms, Air-Conditioned Rooms, Non-Air Conditioned Rooms and NonConditioned Deluxe Rooms.
2. PROPOSED SYSTEM
2. Operational Feasibility: Proposed projects are beneficial only if they can be turned into information systems that will meet the organizations operating requirements. Simply stared, this test of feasibility asks of the system will work when it is developed and installed. Are there major barriers to implementing? Here are questions that will help test the operational feasibility of a project. Is there sufficient support for the project from management from users? If the current system is well liked and used to the extent that persons will not be able to see reasons for change there may be resistance. Are the current business methods acceptable to the user? If they are not, users may welcome a change that will bring about a more operational and useful systems. Have the user been involved in the planning and development of the project? Early involvement reduces the chances of resistance to the system and in general and increases the likelihood of successful project. Since the proposed system was to help reduce the hardships encountered in the existing manual system, the new system was considered to be operational feasible.
3. Economic Feasibility: Economic feasibility attempts 2 weigh the costs of developing and implementing a new system against the benefits that would accrue from having the new system in place. This feasibility study gives the top management the economic justification for the new system. A simple economic analysis which gives the actual comparison of costs and benefits are much more meaningful in this case. In addition this proves to be a useful point of reference to compare actual costs as the project progresses. There could be various types of intangible benefits on account of automation. These could include increased customer satisfaction, improvement in product quality better decision making timeliness of information, expending activities, improved accuracy of operation better documentation and record keeping, faster retrieval of information better employee morale.
3. ANALYSIS
Checkout & request for Advance booking Enquiry Room Report Detail
HOTEL
Customer
MNAGEMENT SYSTEM
Administrator
Provide report
Room Checking
Room Enquiry
AVAILABILITY OF ROOM
Room
Provide detail
Customer
Update Room
Room Detail
Room Checking
Room
Booking a room Provide Detail
Customer n
Reservation
Room Checking
Reservation
Reservation confirm
Room Checking
Room
Request Cancel Reservation
Customer Confirm
CANCEL RESERVATION
Cancel Request
Cancellation confirm
Room Statous
Parking
Service Provided
Customer
SERVICE
Laundry Request
Laundry
Service Provided
CHECK IN
Provide Detail
Parking
Customer
Laundry
Check In Confirm
Customer
Provide Better Service
REPORT
MGNT
Bill
Update Bill
Service
Many
Provide
Parking
Laundry
Other
One
Customer
Can be use
One
Room
Generate
`
One
Bill
4. SYSTEM DESIGN
Fields
CustomerId EmpID Category CheckInDate CheckInTime Adults Childrens RoomType AirCondition RoomNo Advance ExpectedDays Rent Reserved Status
Type
Text Text Text Date/Time Date/Time Text Text Text Text Number Text Text Number Text Text
Key
Primary Key Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores customer id Stores employee id Stores category Stores check in date Stores check in time Stores number of adults Stores number of children Stores room type Stores type of room Stores room number Stores advance amount Stores expected days stay Stores rent amount Stores room is reserved Stores rooms status
Fields
CustomerId EmpID CheckOutDate CheckOutTime CheckInTime CheckInDate Duration Tax Amount FacilityAmount TotalReceivedAmount
Type
Text Text Text Date/Time Date/Time Text Text Text Text Number Text
Key
Primary Key Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores customer id Stores employee id Stores category Stores check in date Stores check in time Stores number of adults Stores number of children Stores room type Stores type of room Stores room number Stores advance amount
Fields
CustomerId RegDate RegTime Name MiddleName Surname Age Sex Foreigner Country City Address Pincode PhoneCode PhoneNo MobileNo
Type
Text Date/Time Date/Time Text Text Text Number Text Text Text Text Text Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores customer id Stores registration date Stores registration time Stores customer name Stores middle name Stores customer surname Stores customer age Stores customer sex Stores residential status Stores customer country Stores customer city name Stores customer address Stores pin code number Stores phone Code number Stores phone number Stores mobile number
Key
Not null Not null Not null Primary Key Primary Key Not null Not null Not null
Text
Description Stores full name Stores user name Stores password Stores Department id Stores Employee id Stores date of Starting Stores time of Adding Stores Status
Fields
ReservationId EmpId Category Name MiddleName Surname Organization Purpose TotalPersons RoomType TotalRooms ReservationDate ReservationTime City Address Pincode PhoneCode PhoneNo MobileNo ReservationFrom ReservationTo Advance Status Text Text Text Text Text Text Text Text
Type
Key
Primary Key Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores Reservation ID Stores Employee ID Stores reservation Category Stores Customer Name Stores Customer middle Name Stores Customer Surname Stores Customer Organization Stores Customer purpose Stores No. of Customer Stores Room type Stores Total rooms reserved Stores Reservation date Stores Reservation Time Stores City Name Stores Address Stores Pin code number Stores Phone Code number Stores Phone number Stores Mobile number Stores Reservation Starting Date Stores Reservation Ending Date Stores Advance Stores Hotel Current Status
Number Text Number Date/Time Date/Time Text Text Number Number Number Number Date/Time Date/Time Number
Text
Key
Not null Not null Not null Not null
Available
Table Name: CustFacility This table stores CustFacility information. Fields FacilityCode BillNo
Facility FacilityBill_date FacilityBill_time Priceperhour TotalHours Amount
Type
Number Number Text Date/Time Date/Time Number Number Number
Key
Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores Facility Code stores Bill No Stores Facility Stores Facility Bill date Stores Facility Bill time Stores Price per hour Stores Total Hours Stores Amount
Fields
BillNo LaundryBill_date LaundryBill_time TotalCloths PriceperCloth Amount
Type
Text Date/Time Date/Time Number Number Number
Key
Primary Key Not null Not null Not null Not null Not null
Description
Stores Bill No Stores Laundry Bill date Stores Laundry Bill time Stores Total Cloths Stores Price per Cloth Stores Amount
Type
Text Text Text Number Date/Time Date/Time Number Text
Key
Primary Key Primary Key Not null Primary Key Not null Not null Not null Not null
Description
Stores Bill No Stores Customer ID Stores Name Stores Room No Stores Bill Date Stores Bill Time Stores Amount Stores Payment
Type
Text Text Date/Time Date/Time
Key
Not null Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Party Code Stores Bill No Stores Party Bill date Stores Party Bill time Stores Total Persons Stores Price per Hour Stores Total Hours Stores Total Hours
Type
Text Text
Key
Primary Key Not null
Description
Stores Department id Stores Department name
Fields
EmpId Name MiddleName SurName Company DOB Age DOJ Timeofjoin Sex City Address Pincode PhoneCode PhoneNo MobileNo
Type
Text Text Text Text Text Date/Time Date/Time Date/Time Date/Time Text Text Text Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores employee id Stores name Stores middle name Stores Surname Stores name of company Stores date of birth Stores age Stores date of joining Stores time of joining Stores gender Stores city Stores employee address Stores pincode number Stores phoneCode number
Fields
EmpId Percentage_of_SSC OrderTime Board_of_SSC Twelve Diploma Percentage_of_HSC Board_of_HSC Diploma_Stream Percentage_of_diploma Graduate HotelMgmt University_of_Graduation
Type
Text Text Text Text Text Text Text Text Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores employee id Stores percentage of SSC Stores Order time Stores twelve appeared Stores diploma appeared Stores percentage of HSC Stores Board of HSC Stores diploma stream Stores percentage of diploma Stores graduate Stores hotel management Stores percentage of graduation Stores college of hotel management Stores percentage of hotel managmen Stores percentage of hotel managmen
Type
Text Text Date/Time Date/Time
Key
Primary Key Primary Key Not null Not null
Description
Stores Order Number Stores employee id Stores Order date Stores Order time
Type
Text Text Date/Time Date/Time Text Number Number Text
Key
Primary key Not null Not null Not null Not null Not null Not null Not null
Description
Stores Order No Stores Order type Stores Order date Stores Order time Stores Particulars Stores Quantity Stores Order Cost Stores Supplier ID
Type
Text Text
Key
Primary Key Not null
Description
Stores Reservation ID Stores Room number
Type
Text Text Text Text Date/Time Date/Time Text Text Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null Not null
Description
Stores supplier id Stores supplier name Stores name of company Stores name of commodity Stores registration date Stores registration time Stores Status Stores customer address Stores pincode number Stores phoneCode number Stores phone number l Stores mobile number
Type
Text
Key
Primary Key
Description
Stores Bill number
Type
Text Text
Key
Primary Key Not null
Description
Stores Room number Stores Category
Type
Text Date/Time Date/Time Text Text Text Text
Key
Primary key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Table Name: DeluxeIndividual This table stores DeluxeIndividual information. Fields Type Key
EmpId SetDate SetTime Rent ROneDay ROneWeek ROneMonth Text Date/Time Date/Time Text Text Text Text Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Type
Text Date/Time Date/Time Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Type
Text Date/Time Date/Time Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Type
Text
Key
Primary Key
Description
Stores Employee Number
Table Name: GroupRoomNo This table stores GroupRoomNo information. Fields Type Key
CustomerId RoomNo Text Text Primary Key Primary Key
Description
Stores Coustomer ID Stores Room number
Type
Text Date/Time Date/Time Text Text Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Type
Text Date/Time Text Date/Time Date/Time Text Text
Key
Primary Key Not null Not null Not null Not null Not null Not null
Description
Stores Bill Number Stores Code Stores Description Stores Bill date Stores Bill time Stores Total Hours Stores Total amount
Type
Text Text Text Text Text Date/Time Date/Time
Key
Not null Not null Not null
Description
Stores Full name Stores User name Stores Password Stores Department ID Stores Employee ID Stores Date of removal Stores Time of removal
2. Login Screen:-
9. Departure of Customer:-
10. Reservation:-
5. TESTING PROCEDURE
Testing is the major quality control measure used during software development. Its basic function is to detect errors in the software. During the requirement analysis and design phase, the software is usually textual and non executable. Only after the coding phase the software can be executed, and then during testing errors come up, which also have a possibility of being developed in the design or requirement analysis phase, other than in the coding phase. Since, we are not focusing on the coding part; we would not include all the coding related testings.
1. Unit Testing: It is used to detect the coding errors. 2. Integration Testing: It is performed to detect design errors, by focusing on the interconnection between different modules. 3. System Testing: This is performed after the system is put together, to check if all the requirements are met, and if the system performs as per the requirements. 4.Acceptance Testing: It is performed to demonstrate the system to the client.
Testing is a very critical and time-consuming process. It requires proper planning of the overall testing process i.e. the Test Plan. The output of the testing phase is the Test Report and the Error Report. The test report consists of the test cases and the result of the executing code; while the error report consists of the errors encountered and the action taken to remove these errors.
6. OUTPUT SCREENING
7. Reservation:-
8.Print Bill:-
7. OUTPUT SCREENING
As such, implementation is the action that must follow any preliminary thinking in
order for something to actually happen. In an information technology context, implementation encompasses all the processes involved in getting new software or hardware operating properly in its environment, including installation, configuration, running, testing, and making necessary changes. The word deployment is sometimes used to mean the same thing
The proposed system is Hotel Management System. We can enhance this system by including more facilities like online booking, advance booking, regular customer record, member facility, Restaurant facility etc. Providing such features enable the users to include more comments into the system
9. CODING
4. Custmomer Search
Private Sub Form_Load() datSearch.Visible = False Adodc1.Visible = False End Sub Private Sub OKButton_Click() If OKButton.Caption = "Search" Then OKButton.Caption = "&New Search" OKButton.Default = False If txtSurname = "" Then MsgBox "Please insert Surname", vbInformation, "Data missing" txtSurname.SetFocus OKButton.Caption = "Search" OKButton.Default = True Exit Sub End If Adodc1.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; data source=" & App.Path & "\Hotel.mdb" Adodc1.RecordSource = "Select * from customer where Surname like '" & Replace(txtSurname.Text, "'", "_") & "'" Adodc1.Refresh Set datSearch.DataSource = Adodc1 If Adodc1.Recordset.RecordCount = 0 Then MsgBox "Sorry no match found", vbInformation, "Customer Search" txtSurname.SetFocus OKButton.Caption = "Search" OKButton.Default = True Exit Sub Else datSearch.Visible = True txtSurname.Locked = True End If
Else txtSurname = "" Set datSearch.DataSource = Nothing datSearch.Visible = False txtSurname.Locked = False txtSurname.SetFocus OKButton.Caption = "Search" OKButton.Default = True End If End Sub
5. Dep ID
Private Sub Form_Load() Adodc1.ConnectionString = "Provider=Microsoft.jet.oledb.4.0; data source=" & App.Path & "\Hotel.mdb" Adodc1.RecordSource = "Department" Adodc1.Refresh End Sub Private Sub OKButton_Click() frmEmpSearchEdit.Enabled = True frmEmpSearchEdit.fraMain.Enabled = True Unload Me End Sub
6. diaHotelCollection Option Explicit Public objcon As Connection Public objrs As Recordset Public check As Boolean Private Sub CancelButton_Click() MDIForm1.mnuFile.Enabled = True MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True MDIForm1.mnuCustomer.Enabled = True MDIForm1.mnuHelp.Enabled = True MDIForm1.mnuReportFrontOffice.Enabled = True Dim cntl As Control For Each cntl In diaHotelCollection If TypeOf cntl Is TextBox Then cntl.Text = "" End If Next
Unload Me End Sub Private Sub Command11_Click() Set objcon = New Connection Set objrs = New Recordset Dim a As String Dim i As Integer objcon.Open "Provider=Microsoft.jet.oledb.4.0; data source=" & App.Path & "\Hotel.mdb" objrs.Open "Select Customer.Name,Customer.MiddleName,Customer.Surname,CheckOut.Custom erId,CheckOut.TotalReceivedAmount,CheckIn.RoomNo,CheckOutTime from
CheckOut,CheckIn,Customer where CheckIn.CustomerID=Customer.CustomerId and Customer.CustomerId=CheckOut.CustomerId and Checkout.CheckInTime=CheckIn.CheckInTime and checkout.CheckInDate=CheckIn.CheckInDate and CheckOutDate=#" & Date & "#", objcon, adOpenDynamic, adLockOptimistic With rptDailyHotelCollection Set .DataSource = objrs With .Sections("Section2").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptLabel Then If .Item(i).Name = "lblDate1" Then .Item(i).Caption = "Date :-- " & txtHCD End If End If Next i End With .Refresh .Show vbModal End With objcon.Close Set objcon = Nothing End Sub Private Sub Command14_Click() check = checksearchdates(txtFrom(3), txtTo(3)) If check = False Then Exit Sub End If Set objcon = New Connection Dim objrs1 As Recordset Set objrs1 = New Recordset Dim a As String Dim i As Integer objcon.Open "Provider=Microsoft.jet.oledb.4.0; data source=" & App.Path & "\Hotel.mdb" objrs1.Open "Select Customer.Name,Customer.MiddleName,Customer.Surname,CheckOut.Custom
erId,CheckOut.TotalReceivedAmount,CheckIn.RoomNo,CheckOutTime from CheckOut,CheckIn,Customer where CheckIn.CustomerID=Customer.CustomerId and Customer.CustomerId=CheckOut.CustomerId and Checkout.CheckInTime=CheckIn.CheckInTime and checkout.CheckInDate=CheckIn.CheckInDate and CheckOutDate BETWEEN #" & CDate(txtFrom(3)) & "# and #" & CDate(txtTo(3)) & "#", objcon, adOpenDynamic, adLockOptimistic With rptHotelCollection Set .DataSource = objrs1 With .Sections("Section2").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptLabel Then If .Item(i).Name = "lblDate1" Then .Item(i).Caption = "Date From :-- " & txtFrom(3) End If If .Item(i).Name = "lblDate2" Then .Item(i).Caption = "Date To :-- " & txtTo(3) End If End If Next i End With
.Refresh .Show vbModal End With objcon.Close Set objcon = Nothing End Sub Private Sub Form_Load() txtHCD.Text = Date txtHCD.Locked = True End Sub Private Sub Form_Terminate() CancelButton_Click End Sub
7. diaReSearch
Option Explicit Private Sub Command1_Click() Unload Me End Sub Private Sub Form_Load() datSearch.Visible = False Adodc1.Visible = False Command2.Caption = "Search" End Sub Private Sub Command2_Click() If Command2.Caption = "Search" Then Command2.Caption = "&New Search" Command2.Default = False If txtSurname = "" Then MsgBox "Please enter the Name of organization", vbCritical, "Data missing" Command2.Caption = "Search" Command2.Default = True txtSurname.SetFocus Exit Sub End If Adodc1.ConnectionString = "Provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\Hotel.mdb" Adodc1.RecordSource = "Select * from Reservation where Surname like '" & Replace(txtSurname.Text, "'", "_") & "' and Status='" & "On" & "'" Adodc1.Refresh Set datSearch.DataSource = Adodc1 If Adodc1.Recordset.RecordCount = 0 Then MsgBox "Sorry no match found", vbInformation, "Customer Search" With txtSurname .SetFocus .SelStart = 0 .SelLength = Len(.Text)
Command2.Caption = "Search" Command2.Default = True End With Exit Sub Else datSearch.Visible = True txtSurname.Locked = True End If Else Set datSearch.DataSource = Nothing datSearch.Visible = False txtSurname = "" txtSurname.SetFocus txtSurname.Locked = False Command2.Caption = "Search" Command2.Default = True End If End Sub
8. diaReservationSearch
Option Explicit Private Sub CancelButton_Click() Unload Me End Sub Private Sub Form_Load() datsearch.Visible = False Adodc1.Visible = False OKButton.Caption = "Search" End Sub Private Sub OKButton_Click() If OKButton.Caption = "Search" Then OKButton.Caption = "&New Search" OKButton.Default = False If txtName = "" Then MsgBox "Please enter the Name of organization", vbCritical, "Data missing" OKButton.Caption = "Search" OKButton.Default = True txtName.SetFocus Exit Sub End If Adodc1.ConnectionString = "Provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\Hotel.mdb" Adodc1.RecordSource = "Select * from Reservation where Organization like '" & Replace(txtName.Text, "'", "_") & "' and Status='" & "On" & "'" Adodc1.Refresh Set datsearch.DataSource = Adodc1 If Adodc1.Recordset.RecordCount = 0 Then MsgBox "Sorry no match found", vbInformation, "Customer Search" With txtName
.SetFocus .SelStart = 0 .SelLength = Len(.Text) OKButton.Caption = "Search" OKButton.Default = True End With Exit Sub Else datsearch.Visible = True txtName.Locked = True End If Else Set datsearch.DataSource = Nothing datsearch.Visible = False txtName = "" txtName.SetFocus txtName.Locked = False OKButton.Caption = "Search" OKButton.Default = True End If End Sub
9. diaRoomstatus
Option Explicit Public objcon As Connection Public objrs As Recordset Public countroom As Integer Dim actualheight As Long Private Sub CancelButton_Click() Unload Me End Sub Private Sub cboRType_Click() txtRoomAvailable = "" txtReserved = "" txtTotal = "" fraIndividual.Visible = False fraFamily.Visible = False End Sub Private Sub Form_Load() fraFamily.Visible = False fraIndividual.Visible = False Me.Move (Screen.Width - Me.Width) / 2, _ (Screen.Height - Me.Height) / 2
diaRoomstatus.Height = 510 'initial height of form in the 'BordorStyle=2-sizable window actualheight = 7000 Timer1.Enabled = True Timer1.Interval = 5 End Sub Private Sub OKButton_Click() Set objcon = New Connection Set objrs = New Recordset objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb"
If cboRType.ListIndex = -1 Then MsgBox "Please select the room type", vbCritical, "Data missing" Exit Sub End If getentry getavailable getreserved If cboRType.Text = "SingleBed" Then checkSingleBed fraIndividual.Visible = True fraFamily.Visible = False fraIndividual.Move (Screen.Width - fraIndividual.Width) / 2 Exit Sub End If If cboRType.Text = "DoubleBed" Then checkDoubleBedIndividual fraIndividual.Visible = True fraFamily.Visible = True fraIndividual.Move (Screen.Width - fraIndividual.Width) / 24 Exit Sub End If If cboRType.Text = "Deluxe" Then checkDeluxeIndividual fraIndividual.Visible = True fraFamily.Visible = True fraIndividual.Move (Screen.Width - fraIndividual.Width) / 24 Exit Sub End If End Sub Public Sub getentry() Dim roomtype As String Dim objrs1 As Recordset roomtype = cboRType.Text Set objrs1 = New Recordset Select Case roomtype Case "SingleBed"
objrs1.Open "Select count(roomno) as singlebed from room where roomtype='" & "SingleBed'", objcon, adOpenDynamic, adLockOptimistic If objrs1.EOF = True And objrs1.BOF = True Then GoTo Norecords Exit Sub End If objrs1.MoveFirst countroom = objrs1("singlebed") txtTotal = countroom objrs1.Close Set objrs1 = Nothing Exit Sub
Case "DoubleBed" objrs1.Open "Select count(roomno) as doublebed from room where roomtype='" & "DoubleBed'", objcon, adOpenDynamic, adLockOptimistic If objrs1.EOF = True And objrs1.BOF = True Then GoTo Norecords Exit Sub End If objrs1.MoveFirst countroom = objrs1("doublebed") txtTotal = countroom objrs1.Close Set objrs1 = Nothing Exit Sub
Case "Deluxe" objrs1.Open "Select count(roomno) as deluxe from room where roomtype='" & "Deluxe'", objcon, adOpenDynamic, adLockOptimistic If objrs1.EOF = True And objrs1.BOF = True Then GoTo Norecords Exit Sub End If objrs1.MoveFirst countroom = objrs1("deluxe")
txtTotal = countroom objrs1.Close Set objrs1 = Nothing Exit Sub End Select Norecords: countroom = 0 objrs1.Close Set objrs1 = Nothing End Sub Public Sub getavailable() Set objrs = New Recordset Dim i As Integer Dim roomtype As String roomtype = cboRType.Text Select Case roomtype Case "SingleBed" objrs.Open "Select count(roomno) as singlebed from room where roomtype='" & "SingleBed" & "'and Available='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("singlebed") txtRoomAvailable = countroom objrs.Close Set objrs = Nothing Exit Sub Case "DoubleBed"
objrs.Open "Select count(roomno) as doublebed from room where roomtype='" & "DoubleBed" & "'and Available='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("doublebed") txtRoomAvailable = countroom objrs.Close Set objrs = Nothing Exit Sub
Case "Deluxe" objrs.Open "Select count(roomno) as deluxe from room where roomtype='" & "Deluxe" & "'and Available='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("deluxe") txtRoomAvailable = countroom objrs.Close Set objrs = Nothing Exit Sub End Select Norecords: countroom = 0 objrs.Close Set objrs = Nothing End Sub
Public Sub getreserved() Set objrs = New Recordset Dim i As Integer Dim roomtype As String roomtype = cboRType.Text Select Case roomtype Case "SingleBed" objrs.Open "Select count(roomno) as singlebed from room where roomtype='" & "SingleBed" & "'and reserved='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("singlebed") txtReserved = countroom objrs.Close Set objrs = Nothing Exit Sub Case "DoubleBed" objrs.Open "Select count(roomno) as doublebed from room where roomtype='" & "DoubleBed" & "'and reserved='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("doublebed") txtReserved = countroom objrs.Close Set objrs = Nothing Exit Sub
Case "Deluxe" objrs.Open "Select count(roomno) as deluxe from room where roomtype='" & "Deluxe" & "'and reserved='" & "Yes" & "'", objcon, adOpenDynamic If objrs.EOF = True And objrs.BOF = True Then GoTo Norecords Exit Sub End If objrs.MoveFirst countroom = objrs("deluxe") txtReserved = countroom objrs.Close Set objrs = Nothing Exit Sub End Select Norecords: countroom = 0 objrs.Close Set objrs = Nothing End Sub Public Sub checkSingleBed() Set objcon = New Connection objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=Hotel.mdb" Set objrs = New Recordset objrs.Open "select * from SingleBed order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtPresent(0) = objrs("Rent") txtR1Day(0) = objrs("ROneDay") txtR1Week(0) = objrs("ROneWeek") txtR1Month(0) = objrs("ROneMonth") txtRoomDate0 = objrs("SetDate") objrs.Close Set objrs = Nothing objcon.Close Set objcon = Nothing End Sub
Public Sub checkDoubleBedIndividual() Set objcon = New Connection objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=Hotel.mdb" Set objrs = New Recordset objrs.Open "select * from DoubleBedIndividual order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtPresent(0) = objrs("Rent") txtR1Day(0) = objrs("ROneDay") txtR1Week(0) = objrs("ROneWeek") txtR1Month(0) = objrs("ROneMonth") txtRoomDate0 = objrs("SetDate") objrs.Close Set objrs = Nothing
Set objrs = New Recordset objrs.Open "select * from DoubleBedFamily order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtPresent(1) = objrs("Rent") txtR1Day(1) = objrs("ROneDay") txtR1Week(1) = objrs("ROneWeek") txtR1Month(1) = objrs("ROneMonth") txtRoomDate1 = objrs("SetDate") objrs.Close Set objrs = Nothing objcon.Close Set objcon = Nothing End Sub Public Sub checkDeluxeIndividual() Set objcon = New Connection objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=Hotel.mdb" Set objrs = New Recordset objrs.Open "select * from DeluxeIndividual order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast
txtPresent(0) = objrs("Rent") txtR1Day(0) = objrs("ROneDay") txtR1Week(0) = objrs("ROneWeek") txtR1Month(0) = objrs("ROneMonth") txtRoomDate0 = objrs("SetDate") objrs.Close Set objrs = Nothing Set objrs = New Recordset objrs.Open "select * from DeluxeFamily order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtPresent(1) = objrs("Rent") txtR1Day(1) = objrs("ROneDay") txtR1Week(1) = objrs("ROneWeek") txtR1Month(1) = objrs("ROneMonth") txtRoomDate1 = objrs("SetDate") objrs.Close Set objrs = Nothing objcon.Close Set objcon = Nothing End Sub Private Sub Timer1_Timer() Dim step As Integer step = 50 ' must be factor of actualheight Me.Height = Me.Height + step If Me.Height > actualheight Then Timer1.Enabled = False End If End Sub
Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
11. Command 1
Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
12.Bill No.
Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
13. Customer Id Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
14.Custome Name Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
15. Room No. Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
17. Bill time Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
18. Amount Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
19. Payment Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
20. Command 2 Private Sub Connection1_InfoMessage(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pConnection As ADODB.Connection) End Sub Private Sub DataEnvironment_Initialize() End Sub Private Sub rsCommand1_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub Private Sub rsCommand2_WillChangeField(ByVal cFields As Long, ByVal Fields As Variant, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) End Sub
Private Sub Form_Load() Timer1.Enabled = True Timer2.Enabled = True End Sub Private Sub Image3_Click() MDIForm1.Show Unload Me End Sub Private Sub Form_Terminate()
MDIForm1.mnuFile.Enabled = True MDIForm1.mnuCustomer.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuReport.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True End Sub Private Sub Form_Unload(Cancel As Integer) MDIForm1.mnuFile.Enabled = True MDIForm1.mnuCustomer.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuBills.Enabled = True
MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuReport.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True End Sub Private Sub mohit_Click() End Sub Private Sub Timer1_Timer() Label1.ForeColor = vbBlue Label8.ForeColor = vbGreen Label1.ForeColor = vbMagenta End Sub Private Sub Timer2_Timer() Label8.ForeColor = vbGreen Label1.ForeColor = vbBlue Label8.ForeColor = vbBlue End Sub
Private Sub Command1_Click() MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuCustomer.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuFileOption.Enabled = True MDIForm1.mnuAddUser.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuReport.Enabled = True MDIForm1.mnuHelp.Enabled = True MDIForm1.Show Unload Me End Sub Private Sub Form_Load() Adodc1.Visible = False Adodc1.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data source=" & App.Path & "\Hotel.mdb" Adodc1.RecordSource = "Select * from login order by EmpId" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 End Sub Private Sub Form_Unload(Cancel As Integer) Command1_Click End Sub
Option Explicit Dim i As Boolean Dim blncheck As Boolean Dim objcon As Connection Dim objrs As Recordset Dim blncity As Boolean Dim blncountry As Boolean Public firstrec As Boolean Dim blngender As Boolean, blnroomtype As Boolean Private Sub cboCountry_Change() Dim intIndex As Integer Dim blnfound As Boolean Do While Not blnfound And intIndex < cboCountry.ListCount If UCase(Left(cboCountry.List(intIndex), Len(cboCountry.Text))) = _ UCase(cboCountry.Text) Then cboCountry.ListIndex = intIndex blnfound = True blncountry = True Else blncountry = False intIndex = intIndex + 1 End If Loop End Sub Private Sub cboRoom_Click() cboRoomNo.Clear optyes.Value = False optNo.Value = False txtRent = "" End Sub Private Sub cboRoomNo_GotFocus() If cboRoom.ListIndex <> -1 Then Dim intIndex As Integer Dim blnfound As Boolean
Do While Not blnfound And intIndex < cboRoom.ListCount If UCase(Left(cboRoom.List(intIndex), Len(cboRoom.Text))) = _ UCase(cboRoom.Text) Then cboRoom.ListIndex = intIndex blnfound = True blnroomtype = True Else blnroomtype = False intIndex = intIndex + 1 End If Loop Else MsgBox "Select room type", vbInformation, "Room Type" cboRoom.SetFocus End If If blnfound = True Then cboRoomNo.Enabled = True Roomvacant End If End Sub Private Sub chkForeigner_Click() If chkForeigner.Value = Checked Then cboCountry.Enabled = True Else cboCountry.Enabled = False End If End Sub Private Sub cmdCancel_Click() MDIForm1.mnuFile.Enabled = True MDIForm1.mnuCustomerDeparture.Enabled = True MDIForm1.mnuCustArrivalOld.Enabled = True MDIForm1.mnuCustArrivalNew.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuCustReservation.Enabled = True MDIForm1.mnuCustSearch.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True
MDIForm1.mnuReport.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuReservationSearch.Enabled = True MDIForm1.mnuCancelReservation.Enabled = True MDIForm1.mnuHelp.Enabled = True MDIForm1.Show Unload Me End Sub Private Sub cmdClear_Click() Dim cntl As Control For Each cntl In Me If TypeOf cntl Is TextBox Then cntl.Text = "" End If Next chkForeigner.Value = 0 cboCountry.ListIndex = -1 cboCountry.Enabled = False cboRoomNo.Clear cboRoomNo.ListIndex = -1 txtArrivalTime = Time optyes.Value = False optNo.Value = False txtDate = Date cmdDetails.Enabled = True i = True cmdClear.Enabled = False cmdAdd.Enabled = False cmdCust.Enabled = True txtCustomerId.SetFocus End Sub Private Sub cmdCust_Click() diaCustSearch.Show vbModal End Sub Private Sub cmdDetails_Click() If txtCustomerId = "" Then MsgBox "Enter Id", vbCritical, "Data Missing" txtCustomerId.SetFocus Exit Sub End If
If MDIForm1.blnOld = True Then If i = True Then cmdDetails.Enabled = False i = False AddCustomerDetails cmdClear.Visible = True cmdClear.Enabled = True End If End If End Sub Private Sub Form_Activate() If MDIForm1.blnnew = True Then AssignId cmdCust.Visible = False Else i = True cmdCust.Visible = True cmdDetails.Enabled = True txtCustomerId.TabStop = True txtCustomerId.TabIndex = txtName.TabIndex End If txtDate = Date txtArrivalTime = Time optMale.Value = True End Sub Private Sub Form_Load() i = True cboCountry.Enabled = False txtArrivalTime.Text = Time() txtDate.Text = Date If MDIForm1.blnnew = True Then AssignId cmdCust.Visible = False Else cmdDetails.Visible = True cmdAdd.Enabled = False cmdCust.Visible = True txtCustomerId.TabStop = True txtCustomerId.TabIndex = txtName.TabIndex End If
optMale.Value = True txtDate = Date txtArrivalTime = Time End Sub Private Sub Form_Unload(Cancel As Integer) cmdCancel_Click MDIForm1.mnuReservationSearch.Enabled = True End Sub
Private Sub optNo_Click() If cboRoom.ListIndex = -1 Then MsgBox "Please select the Room type", vbCritical, "Data missing" cboRoom.SetFocus optNo.Value = False Exit Sub End If getrent End Sub Private Sub optyes_Click() If cboRoom.ListIndex = -1 Then MsgBox "Please select the Room type", vbCritical, "Data missing" cboRoom.SetFocus optyes.Value = False Exit Sub End If getrent txtRent = Val(txtRent) + 500 End Sub Private Sub txtAddress_GotFocus() If txtCity = "" Then MsgBox "Please enter the city of customer", vbInformation, "Data missing" txtCity.SetFocus Exit Sub End If End Sub
Private Function AddCustomerDetails() Dim found As Boolean Dim objcon As Connection Set objcon = New Connection Dim objrs As Recordset Set objrs = New Recordset objcon.Open "Provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\Hotel.mdb" objrs.Open "Select * from CheckIn where CustomerId='" & LCase(txtCustomerId) & "' and Status='" & "On" & "'", objcon, adOpenDynamic, adLockOptimistic If objrs.EOF = True And objrs.BOF = True Then found = True objcon.Close Else found = False MsgBox "Customer is already CheckIn, so a new entry cannot be made", vbExclamation, "Customer already check-in" With txtCustomerId .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With cmdAdd.Enabled = False cmdClear.Enabled = False cmdDetails.Enabled = True i = True Exit Function End If
If MDIForm1.blnOld = True Then objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb" objrs.Open " Select * from Customer where CustomerId='" & LCase(txtCustomerId) & "'", objcon, adOpenDynamic, adLockOptimistic End If If objrs.EOF = True And objrs.BOF = True Then MsgBox "Customer ID not found kindly enter correct Customer ID", vbCritical, "Invalid Customer"
txtCustomerId = "" txtCustomerId.SetFocus objrs.Close objcon.Close Set objrs = Nothing Set objcon = Nothing cmdAdd.Enabled = False cmdDetails.Enabled = True i = True Exit Function End If If found = True Then cmdDetails.Enabled = False cmdAdd.Enabled = True txtName = objrs("Name") txtName.Locked = True txtMiddleName = objrs("MiddleName") txtMiddleName.Locked = True txtSurname = objrs("Surname") txtSurname.Locked = True txtAge = objrs("Age") txtAge.Locked = True txtAddress = objrs("Address") txtAddress.Locked = True txtMobileNo = objrs("MobileNo") If objrs("Sex") = "male" Then optMale.Value = True Else optFemale.Value = True End If txtPincode = objrs("Pincode") txtPincode.Locked = True txtCode = objrs("PhoneCode") txtCode.Locked = True txtPhoneNo = objrs("PhoneNo") txtPhoneNo.Locked = True txtMobileNo = objrs("MobileNo") txtMobileNo.Locked = True txtCity.Text = objrs("City") txtCity.Locked = True End If cmdCust.Enabled = False
Private Function checkAdults() As Boolean If txtAdults.Text <> "" Then Dim a As String a = txtAdults.Text Dim b As Integer, i As Integer b = Len(a) i=1 Do While i <= b If Asc(Mid(a, i, 1)) > 47 And Asc(Mid(a, i, 1)) < 58 Then blncheck = True i=i+1 Else blncheck = False MsgBox "Enter only Numbers", vbCritical, "Data Entry Error" With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With checkAdults = blncheck Exit Function Exit Do End If Loop Else MsgBox "Enter no. of Adults", vbCritical, "Data Missing" blncheck = False txtAdults.SetFocus checkAdults = blncheck Exit Function End If If cboRoom.ListIndex = -1 Then MsgBox "Please select the room type", vbExclamation, "Room selection" blncheck = False checkAdults = blncheck cboRoom.SetFocus
If txtAdults <= 0 Then MsgBox "No. of Adults cannot be less than 1", vbExclamation, "Data entry error" checkAdults = False With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If If cboRoom.Text = "SingleBed" Then If txtAdults.Text > 1 Then MsgBox "Kindly select DoubleBed option as number of adults is greater than 1", vbExclamation, "Data entry error" checkAdults = False With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If End If If cboRoom.Text = "DoubleBed" Then If txtAdults.Text > 2 Then MsgBox "Kindly accommodate the customer using Group allottment", vbInformation, "Invalid entry" checkAdults = False With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If End If
If cboRoom.Text = "Deluxe" Then If txtAdults.Text > 2 Then MsgBox "Kindly accommodate the customer using Group allottment", vbInformation, "Invalid entry" checkAdults = False With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If End If
checkAdults = True End Function Private Function checkChild() As Boolean If txtChild.Text <> "" Then Dim a As String a = txtChild.Text Dim b As Integer, i As Integer b = Len(a) i=1 Do While i <= b If Asc(Mid(a, i, 1)) > 47 And Asc(Mid(a, i, 1)) < 58 Then blncheck = True i=i+1 Else blncheck = False MsgBox "Enter only Numbers", vbCritical, "Data Entry Error" txtChild.Text = "" txtChild.SetFocus checkChild = blncheck Exit Function Exit Do End If Loop
Else MsgBox "Enter no. of Childrens", vbCritical, "Data Missing" blncheck = False txtChild.SetFocus checkChild = blncheck Exit Function End If If cboRoom.Text = "SingleBed" Then If txtAdults = 1 Then If txtChild > 1 Then MsgBox "For 1 Adult and more than 1 children please select DoubleBed room", vbExclamation, "Invalid data" cboRoom.SetFocus checkChild = False Exit Function End If End If End If If txtAdults < 0 Then MsgBox "Cannot allot rooms to children without adults", vbExclamation, "Not allowed" checkChild = False Exit Function End If If txtChild > 3 Then MsgBox "Kindly allot the member with " & txtChild & " childs using Group category", vbExclamation, "Not allowed" checkChild = False Exit Function End If If blncheck = True Then If txtChild.Text > 140 Then MsgBox "Cannot accomodate that number of persons", vbInformation, "Limit violation" blncheck = False checkChild = blncheck txtChild = "" txtChild.SetFocus
If blncheck = True Then checkChild = blncheck End If End Function Public Sub Roomvacant() Dim objroom As Recordset Set objroom = New Recordset Dim objcon As Connection Set objcon = New Connection objcon.Open "Provider=Microsoft.Jet.Oledb.4.0;Data source=" & App.Path & "\Hotel.mdb" objroom.Open "Room", objcon, adOpenDynamic, adLockOptimistic objroom.MoveFirst Do While Not objroom.EOF If objroom("RoomType") = cboRoom.Text And objroom("Available") = "Yes" Then If objroom("Reserved") = "Yes" Then cboRoomNo.AddItem objroom("RoomNo") & "*" Else cboRoomNo.AddItem objroom("RoomNo") End If End If objroom.MoveNext Loop objroom.Close objcon.Close Set objroom = Nothing Set objcon = Nothing End Sub Private Function advance() As Boolean If txtAdvance = "" Then MsgBox "Please enter the advance amount", vbInformation, "Data missing" blncheck = False
advance = blncheck txtAdvance.SetFocus Exit Function End If If cboRoom.ListIndex = -1 Then MsgBox "Please select the room type", vbCritical, "Data missing" cboRoom.SetFocus advance = False Exit Function End If If IsNumeric(txtAdvance) Then If txtAdvance <= 0 Then MsgBox "Invalid advance amount", vbCritical, "Data entry error" blncheck = False advance = blncheck txtAdvance.SetFocus With txtAdvance .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If Dim advannce As Currency advannce = Val(txtRent) * 0.4 If txtAdvance < advannce Then MsgBox "Advance amount should be greater than 40 percent of rent which is currently " & advannce, vbInformation, "Advance" advance = False With txtAdvance .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If
Else MsgBox "Please enter only numbers in Advance", vbCritical, "Data entry error"
blncheck = False advance = blncheck With txtAdvance .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If advance = True End Function Private Sub cmdAdd_Click() Dim blnname As Boolean, blnmidname As Boolean Dim blnSurname As Boolean, blnage As Boolean Dim blnphone As Boolean, blnphonecode As Boolean Dim blnpincode As Boolean, blnmobile As Boolean Dim blncity As Boolean Dim blnAdult As Boolean, blnChild As Boolean blnname = checkName(txtName, Label2) If blnname = False Then With txtName .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnmidname = checkName(txtMiddleName, Label3) If blnmidname = False Then With txtMiddleName .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnSurname = checkSurName(txtSurname, Label4) If blnSurname = False Then With txtSurname .SetFocus
blnage = checkAge(txtAge, Label5) If blnage = False Then With txtAge .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blncity = checkCity(txtCity, Label8) If blncity = False Then Exit Sub End If blnpincode = checkPincode(txtPincode) If blnpincode = False Then With txtPincode .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnphonecode = checkPhoneCode(txtCode) If blnphonecode = False Then With txtCode .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnphone = checkPhone(txtPhoneNo)
If blnphone = False Then With txtPhoneNo .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If
blnmobile = checkMobile(txtMobileNo) If blnmobile = False Then With txtMobileNo .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnAdult = checkAdults() If blnAdult = False Then With txtAdults .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If blnChild = checkChild() If blnChild = False Then txtChild.SetFocus txtChild.SelStart = 0 txtChild.SelLength = Len(txtChild.Text) Exit Sub End If If optyes.Value = False And optNo.Value = False Then MsgBox "Please select yes/no option of Ac", vbExclamation, "Data entry error" optyes.SetFocus Exit Sub
End If blnname = Noofdays() If blnname = False Then Exit Sub End If blnname = advance() If blnname = False Then Exit Sub End If Dim a As Integer a = MsgBox("Checkin of Customer in room no. " & cboRoomNo.Text & " with rent of Rs. " & txtRent, vbYesNo, "Customer Checkin") If a = vbNo Then optyes.SetFocus Exit Sub End If Dim objconn As Connection Set objconn = New Connection objconn.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=Hotel.mdb" Dim objrs As Recordset Set objrs = New Recordset objrs.Open "CheckIn", objconn, adOpenDynamic, adLockOptimistic If blncheck = True Then If MDIForm1.blnnew = True Then 'a new customer has arrived add him in customer and chkinchkout Dim objrs1 As Recordset Set objrs1 = New Recordset objrs1.Open "Customer", objconn, adOpenDynamic, adLockOptimistic objrs1.AddNew objrs1("CustomerID") = txtCustomerId.Text objrs1("RegDate") = Date objrs1("RegTime") = Time objrs1("Name") = txtName.Text objrs1("MiddleName") = txtMiddleName.Text objrs1("Surname") = txtSurname.Text
objrs1("Age") = txtAge.Text If optMale.Value = True Then objrs1("Sex") = "male" Else objrs1("Sex") = "female" End If
If chkForeigner.Value = Unchecked Then objrs1("Country") = "India" objrs1("Foreigner") = "No" Else objrs1("Country") = cboCountry.Text objrs1("Foreigner") = "Yes" End If
If Len(Trim(txtAddress.Text)) > 255 Then MsgBox "Cannot enter the address of length greater than 255", vbInformation, "Limit violation" txtAddress.SetFocus Exit Sub End If objrs1("City") = txtCity.Text objrs1("Address") = Trim(LCase(txtAddress.Text)) objrs1("Pincode") = txtPincode.Text objrs1("PhoneCode") = txtCode.Text objrs1("PhoneNo") = txtPhoneNo.Text objrs1("MobileNo") = txtMobileNo.Text objrs1.Update objrs1.Close Set objrs1 = Nothing End If objrs.AddNew objrs("CustomerId") = LCase(txtCustomerId.Text) objrs("EmpID") = userempid objrs("Category") = "Individual" objrs("CheckInDate") = Date objrs("CheckInTime") = Time()
objrs("Adults") = txtAdults.Text objrs("Childrens") = txtChild.Text objrs("RoomType") = cboRoom.Text If optyes.Value = True Then objrs("AirCondition") = "yes" Else objrs("AirCondition") = "no" End If
If cboRoomNo.ListIndex <> -1 Then objrs("RoomNo") = cboRoomNo.Text Else MsgBox "Please select the room no.", vbInformation, "Data missing" cboRoomNo.SetFocus Exit Sub End If
Dim objroomvac As Recordset Set objroomvac = New Recordset objroomvac.Open "select * from Room where RoomNo=" & Val(cboRoomNo.Text), objconn, adOpenDynamic, adLockOptimistic objroomvac("Available") = "No" objroomvac.Update objroomvac.Close Set objroomvac = Nothing
objrs("ExpectedDays") = txtNOD.Text objrs("Rent") = txtRent objrs("Advance") = txtAdvance objrs("Reserved") = "No" objrs("Status") = "On" objrs.Update objrs.Close
objrs.AddNew objrs("RoomNo") = cboRoomNo.Text objrs("Category") = "Individual" objrs.Update objrs.Close ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' MsgBox "Successful updation", vbInformation, "Welcome"
Set objrs = Nothing objconn.Close Set objconn = Nothing Clearfields Clearall frmCheckIn txtDate = Date txtArrivalTime = Time If MDIForm1.blnnew = True Then AssignId txtName.SetFocus Else txtCustomerId.SetFocus cmdClear.Enabled = False cmdDetails.Enabled = True cmdCust.Enabled = True cmdAdd.Enabled = False End If Else MsgBox "Can't Update due to error in given information", vbCritical, "Invalid Data" objrs.Close Set objrs = Nothing objconn.Close Set objconn = Nothing End If End Sub
End If optMale.Value = True cboCountry.ListIndex = -1 cboCountry.Enabled = False txtDate = Date txtArrivalTime = Time cboRoom.ListIndex = -1 cboRoomNo.Clear cboRoomNo.ListIndex = -1 End Sub Public Sub AssignId() If MDIForm1.blnnew = True Then Dim objcon As Connection Dim objrs As Recordset Set objcon = New Connection objcon.Open "Provider=Microsoft.Jet.Oledb.4.0;Data source=" & App.Path & "\Hotel.mdb" Set objrs = New Recordset objrs.Open "CustIdsort", objcon, adOpenDynamic, adLockOptimistic txtCustomerId.Locked = True txtCustomerId.TabStop = False If objrs.EOF = True And objrs.BOF = True Then firstrec = True txtCustomerId = "c-1" objrs.Close objcon.Close Set objrs = Nothing Set objcon = Nothing Exit Sub End If objrs.MoveLast Dim rec As String Dim slen As Integer, i As Integer rec = objrs("CustomerID") slen = Len(rec) i = slen - 2 i = CInt(Mid(rec, 3, i)) i=i+1
txtCustomerId = "c-" & i objrs.Close objcon.Close Set objrs = Nothing Set objcon = Nothing End If End Sub
Private Function Noofdays() As Boolean If txtNOD = "" Then MsgBox "Please enter the number of days the customer will stay", vbCritical, "Data missing" txtNOD.SetFocus Noofdays = False Exit Function End If If IsNumeric(txtNOD) Then If CInt(txtNOD) <= 0 Then MsgBox "No. of days should be either equal to or greater than 1", vbExclamation, "Data entry error" Noofdays = False With txtNOD .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If If CInt(txtNOD) > 150 Then MsgBox "Customer cannot stay more than 3 months without reservation", vbExclamation, "Not allowed" Noofdays = False With txtNOD .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If Else
MsgBox "Please enter only numbers", vbInformation, "Data entry error" Noofdays = False With txtNOD .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Exit Function End If
Dim i As Integer i=1 Do While i <= Len(txtNOD) If (Asc(Mid(txtNOD, i, 1)) < 47) Or (Asc(Mid(txtNOD, i, 1)) > 59) Then MsgBox "Please enter only numbers with no decimal positions", vbExclamation, "Not allowed" With txtNOD .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With Noofdays = False Exit Function Exit Do Else i=i+1 End If Loop Noofdays = True End Function Public Sub getrent() Set objcon = New Connection Set objrs = New Recordset objcon.Open "Provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\Hotel.mdb" If cboRoom.Text = "SingleBed" Then objrs.Open "Select * from SingleBed order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic
objrs.MoveLast txtRent = objrs("Rent") objrs.Close Set objrs = Nothing Exit Sub End If If cboRoom.Text = "Deluxe" Then objrs.Open "Select * from DeluxeIndividual order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtRent = objrs("Rent") objrs.Close Set objrs = Nothing Exit Sub End If If cboRoom.Text = "DoubleBed" Then objrs.Open "Select * from DoubleBedIndividual order by SetDate,SetTime", objcon, adOpenDynamic, adLockOptimistic objrs.MoveLast txtRent = objrs("Rent") objrs.Close Set objrs = Nothing Exit Sub End If
End Sub
Option Explicit Dim blnfound As Boolean Dim blncheck As Boolean, blncredit As Boolean Public duration As Integer, billno As String, actualtotal As Double Public objcon As Connection Public objrs As Recordset Public customerhasbill As Boolean Private Sub cmdCancel_Click() MDIForm1.mnuFile.Enabled = True MDIForm1.mnuBills.Enabled = True MDIForm1.mnuAccounts.Enabled = True MDIForm1.mnuEmployee.Enabled = True MDIForm1.mnuHotelStatus.Enabled = True MDIForm1.mnuCustomerArrival.Enabled = True MDIForm1.mnuCustReservation.Enabled = True MDIForm1.mnuRoomInfo.Enabled = True MDIForm1.mnuCustSearch.Enabled = True MDIForm1.mnuReport.Enabled = True MDIForm1.mnuGroup.Enabled = True MDIForm1.mnuReservationSearch.Enabled = True MDIForm1.mnuCancelReservation.Enabled = True MDIForm1.mnuHelp.Enabled = True MDIForm1.Show Unload Me End Sub Private Sub cmdChkOut_Click() Dim a As Integer a = MsgBox("Are you sure about the checkout?", vbYesNo, "CheckOut") If a = vbNo Then Exit Sub End If Set objcon = New Connection Set objrs = New Recordset
deactivatebill objcon.Open "provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\Hotel.mdb" objrs.Open "Select * from Room where RoomNo=" & Val(txtRoomno), objcon, adOpenDynamic, adLockOptimistic objrs("Available") = "Yes" objrs.Update objrs.Close objrs.Open "Select * from CustomerRoomCategory where RoomNo='" & txtRoomno & "' and Category='" & "Individual" & "'", objcon, adOpenDynamic, adLockOptimistic objrs.Delete objrs.Close objrs.Open "CheckOut", objcon, adOpenDynamic, adLockOptimistic objrs.AddNew objrs("CustomerId") = lblCustID objrs("EmployeeId") = userempid objrs("CheckOutDate") = Date objrs("CheckOutTime") = Time objrs("CheckInDate") = txtCheckInDate objrs("CheckInTime") = txtCheckInTime objrs("Duration") = duration objrs("Tax") = txtTax objrs("FacilityAmount") = txtFacilityAmount objrs("Amount") = txtAmount objrs("TotalReceivedAmount") = actualtotal objrs.Update objrs.Close objrs.Open "Select * from CheckIn where CustomerId='" & lblCustID & "' and CheckInDate=#" & CDate(txtCheckInDate) & "# and Status='" & "On" & "'", objcon, adOpenDynamic, adLockOptimistic objrs("Status") = "Off" objrs.Update objrs.Close
MsgBox "Successful checkout with Total amount= Rs " & actualtotal & " /-", vbInformation, "CheckOut" cmdBill.Enabled = True cmdChkOut.Enabled = False 'cmdNew_Click End Sub Private Sub cmdload_Click() If cmdload.Caption = "Details" Then If txtRoomno <> "" Then cmdload.Caption = "Calculate" cmdNew.Enabled = True Dim objcon As Connection Set objcon = New Connection Dim objrs As Recordset Set objrs = New Recordset Dim strsql As String objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb" objrs.Open "Select RoomNo from Room where RoomNo=" & Val(txtRoomno), objcon, adOpenDynamic, adLockOptimistic If objrs.EOF = True And objrs.BOF = True Then MsgBox "Invalid Room no.", vbCritical, "Data entry error" With txtRoomno .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With objrs.Close objcon.Close Set objrs = Nothing Set objcon = Nothing cmdload.Caption = "Details" cmdNew.Enabled = False Exit Sub Else objrs.Close End If
objrs.Open "Select * from CheckIn where Status='" & "On" & "' and RoomNo=" & Val(txtRoomno) & " ", objcon, adOpenDynamic, adLockOptimistic If objrs.EOF = True And objrs.BOF = True Then GoTo nocustomer objrs.Close objcon.Close Set objrs = Nothing Set objcon = Nothing cmdload.Caption = "Details" cmdNew.Enabled = False Exit Sub End If Dim objrs1 As Recordset Set objrs1 = New Recordset objrs1.Open "Select RoomNo from CustomerRoomCategory where Category='" & "Individual" & "' and RoomNo='" & txtRoomno & "'", objcon, adOpenDynamic, adLockOptimistic If objrs1.EOF = True And objrs1.BOF = True Then MsgBox " Sorry the specified room no does not belong to individual category", vbExclamation, "Not belonging to Individual category" With txtRoomno .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With objrs1.Close objcon.Close Set objrs1 = Nothing Set objcon = Nothing cmdload.Caption = "Details" cmdNew.Enabled = False Exit Sub Else blnfound = True objrs1.Close Set objrs1 = Nothing End If
lblCustID = objrs("CustomerId") objrs.Close objrs.Open "Select * from Customer where CustomerID='" & lblCustID & "'", objcon, adOpenDynamic, adLockOptimistic txtName = objrs("Surname") & " " & objrs("Name") & " " & objrs("MiddleName") txtCountry = objrs("Country") txtCity = objrs("City") objrs.Close objrs.Open "Select * from CheckIn where Status='" & "On" & "' and RoomNo=" & Val(txtRoomno) & " ", objcon, adOpenDynamic, adLockOptimistic txtCheckInDate = objrs("checkindate") duration = DateDiff("d", txtCheckInDate, Date) txtCheckInTime = objrs("checkintime") txtAdults = objrs("Adults") txtChildrens = objrs("Childrens") txtRoomType = objrs("Roomtype") txtAC = objrs("Aircondition") txtAdvance = objrs("Advance") txtAmount = objrs("Rent") objrs.Close objrs.Open "Select BillNo,Amount from CustomerBill where CustomerId='" & lblCustID & "'and Payment='" & "No" & "'", objcon, adOpenDynamic, adLockOptimistic If objrs.EOF = True And objrs.BOF = True Then txtFacilityAmount = 0 objrs.Close Set objrs = Nothing objcon.Close Set objcon = Nothing Else txtFacilityAmount = objrs("Amount") billno = objrs("BillNo") objrs.Close Set objrs = Nothing objcon.Close Set objcon = Nothing End If Label1.Visible = True
Label2.Visible = True Label3.Visible = True lblCustID.Visible = True Label5.Visible = True Label6.Visible = True Label8.Visible = True Label9.Visible = True Label13.Visible = True Label14.Visible = True Label15.Visible = True Label16.Visible = True Label17.Visible = True Label18.Visible = True Label19.Visible = True LabeL20.Visible = True Label22.Visible = True Label23.Visible = True Label24.Visible = True Label33.Visible = True txtAC.Visible = True txtAdults.Visible = True txtAmount.Visible = True lblCustID.Visible = True txtName.Visible = True txtCountry.Visible = True txtCity.Visible = True txtCheckInDate.Visible = True txtCheckInTime.Visible = True txtChildrens.Visible = True txtRoomType.Visible = True txtAdvance.Visible = True txtFacilityAmount.Visible = True With txtDuration .Visible = True .Text = duration & " days" End With txtTax.Visible = True Else nocustomer: MsgBox "Sorry no customer found in " & txtRoomno, vbInformation, "NO customer" cmdload.Caption = "Details"
cmdNew.Enabled = False cmdChkOut.Default = False cmdChkOut.Enabled = False With txtRoomno .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With End If Else MsgBox "Enter Room no.", vbInformation, "Data missing" txtRoomno.SetFocus End If Else Dim blnchecktax As Boolean blnchecktax = checktax(txtTax) If blnchecktax = False Then Exit Sub End If calculateamount End If End Sub Private Sub cmdNew_Click() txtRoomno.Text = "" visiblity cmdChkOut.Enabled = False txtRoomno.SetFocus cmdload.Caption = "Details" cmdChkOut.Enabled = False cmdload.Default = True cmdBill.Enabled = False cmdload.Enabled = True txtRoomno.Locked = False cmdNew.Enabled = False setdatetime End Sub Private Sub setdatetime() txtChkoutDate = Date
txtChkOuttime = Time End Sub Private Sub cmdBill_Click() If customerhasbill = True Then DataEnvironment1.Connection1.Open DataEnvironment1.Command2 billno With DataReport2 Dim i As Integer With .Sections("Section4").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptLabel Then If .Item(i).Name = "lblDate" Then .Item(i).Caption = "Date :-- " & txtChkoutDate End If If .Item(i).Name = "lblBill" Then .Item(i).Caption = "Billno :-- " & billno End If If .Item(i).Name = "lblName" Then .Item(i).Caption = "Name :-- " & txtName End If If .Item(i).Name = "lblCheckinDate" Then .Item(i).Caption = "CheckInDate :-- " & txtCheckInDate End If If .Item(i).Name = "lblRoomRent" Then .Item(i).Caption = " Room Rent:-- " & txtAmount End If If .Item(i).Name = "lblAdvance" Then .Item(i).Caption = txtAdvance End If If .Item(i).Name = "lblTaxamount" Then .Item(i).Caption = txtTax End If
If .Item(i).Name = "lblTotal" Then .Item(i).Caption = txtTotal End If End If Next i End With .Refresh .Show vbModal End With Else DataEnvironment1.Connection1.Open DataEnvironment1.Command1 billno With DataReport1 With .Sections("Section4").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptLabel Then If .Item(i).Name = "lblDate" Then .Item(i).Caption = "Date :-- " & txtChkoutDate End If If .Item(i).Name = "lblBill" Then .Item(i).Caption = "Billno :-- " & billno End If If .Item(i).Name = "lblName" Then .Item(i).Caption = "Name :-- " & txtName End If If .Item(i).Name = "lblCheckinDate" Then .Item(i).Caption = "CheckInDate :-- " & txtCheckInDate End If If .Item(i).Name = "lblRoomRent" Then .Item(i).Caption = " Room Rent:-- " & txtAmount End If If .Item(i).Name = "lblAdvance" Then
.Item(i).Caption = txtAdvance End If If .Item(i).Name = "lblTaxamount" Then .Item(i).Caption = txtTax End If If .Item(i).Name = "lblTotal" Then .Item(i).Caption = txtTotal End If End If Next i End With .Refresh .Show vbModal End With End If txtTax.Locked = True txtRoomno.Locked = True End Sub Private Sub Form_Load() txtChkoutDate = Date txtChkOuttime = Time cmdload.Caption = "Details" cmdNew.Enabled = False cmdChkOut.Enabled = False cmdBill.Enabled = False visiblity End Sub
Private Function checktax(txt As TextBox) As Boolean If txt.Text = "" Then MsgBox "Please enter the percentage of tax", vbInformation, "Tax missing" txtTax.SetFocus checktax = False Exit Function End If If Not IsNumeric(txt) Then MsgBox "Enter only Numbers", vbCritical, "Data Entry Error"
With txt .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With checktax = False Exit Function End If If Val(txt.Text) < 8 Or Val(txt.Text) > 20 Then MsgBox "Entered tax percentage is not correct", vbCritical, "Data Entry Error" With txt .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With checktax = False Exit Function End If checktax = True End Function
Private Sub visiblity() Label1.Visible = False Label2.Visible = False Label3.Visible = False lblCustID.Visible = False Label5.Visible = False Label6.Visible = False Label8.Visible = False Label9.Visible = False Label13.Visible = False Label15.Visible = False Label16.Visible = False Label17.Visible = False Label18.Visible = False Label19.Visible = False Label23.Visible = False Label24.Visible = False Label33.Visible = False
txtAC.Visible = False txtAdults.Visible = False txtAmount.Visible = False lblCustID.Visible = False txtName.Visible = False txtCountry.Visible = False txtCity.Visible = False txtCheckInDate.Visible = False txtCheckInTime.Visible = False txtChildrens.Visible = False txtRoomType.Visible = False txtDuration.Visible = False txtTax.Visible = False txtAdvance.Visible = False txtFacilityAmount.Visible = False txtTotal.Visible = False End Sub Private Sub calculateamount() Dim total As Double, taxamount As Double If duration = 0 Then duration = duration + 1 End If
total = Val(txtFacilityAmount) + (Val(txtAmount) * duration) taxamount = (Val(txtTax) * total) / 100 + total If (Val(txtAdvance)) > taxamount Then blncredit = False total = Val(txtAdvance) - taxamount txtTotal = total & " balance" actualtotal = taxamount Else blncredit = True txtTotal = (taxamount - Val(txtAdvance)) actualtotal = Val(txtTotal) End If txtTotal.Visible = True txtTotal.Locked = True cmdload.Enabled = False cmdChkOut.Enabled = True
End Sub Public Sub deactivatebill() objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb" objrs.Open "Select * from CustomerBill where CustomerId='" & lblCustID & "' and BillNo='" & billno & "'", objcon, adOpenDynamic, adLockOptimistic If objrs.EOF = True And objrs.BOF = True Then customerhasbill = False objrs.Close Dim i As String Dim z As Integer objrs.Open "Bill", objcon, adOpenDynamic, adLockOptimistic i = objrs("BillNo") z = Val(i) + 1 objrs("BillNo") = Str(z) objrs.Update billno = "B-" & z objrs.Close objrs.Open "CustomerBill", objcon, adOpenDynamic, adLockOptimistic objrs.AddNew objrs("BillNo") = billno objrs("CustomerId") = lblCustID.Caption objrs("Name") = txtName objrs("RoomNo") = txtRoomno objrs("Bill_Date") = Date objrs("Bill_Time") = Time objrs("Payment") = "Yes" objrs("Amount") = CCur(txtAmount) objrs.Update objrs.Close objcon.Close Exit Sub End If objrs("Payment") = "Yes" objrs.Update objrs.Close objcon.Close customerhasbill = True End Sub
10. CONCLUSION
The HOTEL MANAGEMENT SYSTEM is a great improvement over the manual system using case fields and paper.
The computerization of the system has sped up the process. In the current system, the front office managing is very slow. The hotel managing system was thoroughly checked and tested with dummy data and thus is found to be very reliable.
11. BIBLIOGRAPHY
Books:1. Advanced Programming Using Visual Basic: Version 6.0 - Julia Case Bradley. 2. Access2003 Power Programming with VBA - Allen G Taylor. 3. Advanced MS Visual Basic - Peter Morris.