bca bsc-it
-
Upload
vardhil-gandhi -
Category
Documents
-
view
158 -
download
2
description
Transcript of bca bsc-it
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY NASIK
A PROJECT REPORTON
“HOTEL MANAGEMENT SYSTEM”
By
NIKHIL KADAMMOHIT TARSARIA
AKASH SHAH
Towards the Partial Fulfillment of the“BACHELOR OF COMPUTER APPLICATION”
L.N. COLLEGE OF MANAGEMENT & TECHNOLOGY,KANDIVALI (WEST), MUMBAI-400 067
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY, NASIK
2011-2012
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY NASIK
A PROJECT REPORTON
“HOTEL MANAGEMENT SYSTEM”
By
NIKHIL KADAMMOHIT TARSARIA
AKASH SHAH
Towards the Partial Fulfillment of the“BACHELOR OF COMPUTER APPLICATION”
L.N. COLLEGE OF MANAGEMENT & TECHNOLOGY,KANDIVALI (WEST), MUMBAI-400 067
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY, NASIK
2011-2012
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY NASIK
CERTIFICATION
This is to certify that the project“ONLINE LEARNING MANAGEMENT SYSTEM”
Has been satisfactorily completed by
NIKHIL KADAMMOHIT TARSARIA
AKASH SHAH
Towards the Partial Fulfillment of the“BACHELOR OF COMPUTER APPLICATION”
For academic year 2011-2012 at
L.N. COLLEGE OF MANAGEMENT & TECHNOLOGY CENTER,MUMBAI
YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY, NASIK
And it is approved
Project Guide Examiner Head of Department(Mrs. Lalan Toraskar) (Dr. Lahu Teli)
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.
NIKHIL KADAM(PRN-2009000597)
SR. NO. TOPICS
1. INTRODUCTION
2. PROPOSED SYSTEM
3. ANALYSIS
4. SYSTEM DESIGN
5. TESTING PROCEDURE
6. OUTPUT SCREEN
7. IMPLEMENTATION PROCEDURE
8. SCOPE FOR FUTURE ENCHANCEMENT
9. CONCLUSION
10. BIBLIOGRAPHY
Visual basic 6.0
It is third generation event –driven programming language It is integrated development environment(IDE) for microsoft It is highly flexible. It enables rapid application development(RAD) of GUI
application It is user friendly and very easy to understand. Programming in VB is a combination of controls on a form. It can create EXE file, ActiveX control, DLL files . It is easy to learn-the syntax is simpler than other programming
language
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
Technical Details:
Hardware and Requirements
PROCESSOR RAM DISK SPACE
Pentium II
64 MBOr
Higher
130 MBOr
Higher Capacity
Pentium III
Pentium IV
Pentium Dual Core/ C2D or Higher
Software and Requirements
Operating System
Win – 98
Win – XP
Win – Vista
Win – 7
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 ContentsChapter 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 Non-Conditioned Deluxe Rooms.
1.2 Existing System.
Existing system involves the primary dealing with the customers. When customer enters the hotel the first task he does is enquiring about the current services provided i.e. primary form checking into check out from the hotel. The customer is given a basic prospectus about the hotel; the basic details in the form are the name of the customer, his occupation, his residential address, his nationality, his gender etc.
The facilities provided by the hotel i.e. if he selects a particular type of room i.e. A/c, Non-A/c, single bed, double bed etc. He is given further charges & facilities given in regards with those rooms. At the end, they `give bill to the customer.
After enquiring the details about customer hotel management feeds the information in their customer register. This register is manually handled.
1.3 Problems in Existing System.
All the operations are done manually by the staff. The records are maintained by the paper work but as the records are increased or searching of document becomes tedious because of scattered information at multiple locations.
It takes lots of time to locate all the records of interactions with individual customer.
They need to introduce new register annually.
As the records increased, searching of documents becomes tedious because of scattered information at multiple locations.
They need to separate storage place for storing this register file which can be unsafe.
There is no provision of security for the data that’s stored. There are chances of misuse of data.
Hence it is important to use software that can save their valuable time and give them correct information when needed
1.4 Needs for Computerization.
The drawback of the existing system is that it is very difficult to retrieve data from case files. It is difficult to handle the whole system manually and it is less accurate and to keep the data in case files for future reference because it may get destroyed. Moreover it is very difficult to retrieve data. Redundancy of data may occur and this may lead to the inconsistency. The manual system is so time-consuming.
The proposed system is very easy to operate. Speed and accuracy are the main advantages of proposed system.
There is no redundancy of data. The data are stored in the computers secondary memories like hard disk, etc. it can be easily receive and used at anytime. The proposed system will easily handle all the data and the work done by the existing systems.
The proposed systems eliminate the drawbacks of the existing system to a great extent and it provides tight security to data.
2.PROPOSED
SYSTEM
2.1 Proposed System.
Proposed System deals with computers. This system helps to maintain all the data and records of the customer in the computer.
This information are reliable, less paper consuming, quick in time and thus a data stored can be retained at any given time.
This system will maintain details of all the customers. This will make it useful for future references.
The system will provide ways of entering the required details needed by the management.
There are provisions of security and so there are less chances of misuse of data.
Less of time is spent in locating the past interaction with clients.
Project takes the required input and provides the exact details thus saving valuable searching time
2.2 Hardware & Software Specifications
System Requirements:- The minimum software requirements for this project are
Operating System:-
Windows XP/98/2000.
Software:-
Visual Basic 6.0.
MS Access .
Hardware Requirements:-
The minimum hardware requirements are:
128MB RAM.
1.5GHz processor speed.
2.3 Feasibility Study.
1. Technical Feasibility :-
Evaluating the technical feasibility is the trickiest part of a feasibility study. This is because at this point in time not too many detailed design of the system, making it difficult to access issues like performance, costs on[on account of the kind of technology to be deployed] etc.
A number of issues have to be considered while doing a technical analysis.
[i] Understand the different technologies involved in the proposed system: - Before commencines the project, we have to be very clear about what are the technologies that are to be required for the development of the new system.
[ii] Find out whether the organization currently possesses the required technologies:-
Is the required technology available with the organization?
If so is the capacity sufficient?
For instance;
“Will the current printer be able to handle the new reports and forms required for the new 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
3.1 Context Level Diagram.
A Context Diagram is a DFD that describes the highest-level view of a system. All external agents and all data flows into and out of the system are in one diagram, with the whole system represented as one process.
The context diagram is useful for showing system boundaries. The system scope is defined by what is represented within the single process and what is represented as external agent. External agents that supply or receive data from the system are outside of the system scope. Everything else is inside the system scope. The data flows come from the event table; they are triggers and responses for all of the events.
The context diagram provides a good overview of the scope of the system, showing the system the in “Context”.
Checkout & request for
Advance booking
Enquiry Room
Report
Detail
Room Detail Provide report
Booking confirmation
Generate Bill
HOTEL
MNAGEMENT
SYSTEM Administrator Customer
3.2 Data Flow Diagram.
This is the Data Flow Diagram. It is a representation or a structured analysis technique which helps the developer to define system needs, what the system needs to store and data requirements along with input & outputs.
A Data Flow Diagram is a graphical model showing the inputs, processes, storage and outputs of asystem produced in structured analysis.
This would hence be a flow of all the events, all the processes, which make the system, work along with their sub processes
Room Checking
Room Enquiry Provide detail
Update Room
Room Detail
AVAILABILITY
OF
ROOM Customer
Room
Room status
Statous
Room Checking
Booking a room Provide Detail
n Room Checking
Reservation confirm
Booking confirm Res. ID
Reservation Customer
Room
Reservation
Room Checking
Request Cancel Reservation
Confirm
Cancel Request
Cancellation confirm
Cancel Room confirm
Request for parking
Request Cancel Service Provided
Laundry Request
Service Provided
Cancel Room confirm
CANCEL
RESERVATION Customer
Room
Room Statous
SERVICE Customer
Parking
Laundry
CHECK IN
&
CHECK OUT
Room Checking
Booking a Room Provide Detail
Request for Check
Check In Confirm
Cancel Room confirm
Request for Daily Status
Customer Feedback
Provide Better Service
Provide Daily Status
Update Bill
CHECK IN
&
CHECK OUT
Customer
Parking
Laundry
REPORT Customer MGNT
Bill
3.3 Entity Relationship Diagram.
The file system structure is the database structure of the system. It represents the storage system structure. An ER-Diagram (Entity Relationship Diagram) is a graphical model of the data needed by the system.
This includes the entities about which information is stored and
relationships among them. It is provided in structured analysis methods.
Many
One One
`
One
Service
Parking Laundry Other Provide
Customer
Generate
Bill
Can be use Room
4.
SYSTEM DESIGN
4.1 Data Element Dictionary.
Table Name: Check-In
This table stores Check-In information
Fields Type Key Description
CustomerId Text Primary Key Stores customer idEmpID Text Primary Key Stores employee idCategory Text Not null Stores categoryCheckInDate Date/Time Not null Stores check in dateCheckInTime Date/Time Not null Stores check in timeAdults Text Not null Stores number of
adultsChildrens Text Not null Stores number of
childrenRoomType Text Not null Stores room typeAirCondition Text Not null Stores type of roomRoomNo Number Not null Stores room numberAdvance Text Not null Stores advance
amountExpectedDays Text Not null Stores expected days
stayRent Number Not null Stores rent amountReserved Text Not null Stores room is
reservedStatus Text Not null Stores room’s status
Table Name: Check-OutThis table stores Check-Out information.
Fields Type Key Description
CustomerId Text Primary Key Stores customer id
EmpID Text Primary Key Stores employee idCheckOutDate Text Not null Stores categoryCheckOutTime Date/Time Not null Stores check in dateCheckInTime Date/Time Not null Stores check in timeCheckInDate Text Not null Stores number of
adultsDuration Text Not null Stores number of
childrenTax Text Not null Stores room typeAmount Text Not null Stores type of roomFacilityAmount Number Not null Stores room numberTotalReceivedAmount Text Not null Stores advance
amount
`
Table Name: CustomerThis table stores Customer information
Fields Type Key DescriptionCustomerId Text Primary Key Stores customer idRegDate Date/Time Not null Stores registration
date
RegTime Date/Time Not null Stores registration time
Name Text Not null Stores customer nameMiddleName Text Not null Stores middle name
Surname Text Not null Stores customer surname
Age Number Not null Stores customer age
Sex Text Not null Stores customer sex
Foreigner Text Not null Stores residential status
Country Text Not null Stores customer country
City Text Not null Stores customer city name
Address Text Not null Stores customer address
Pincode Text Not null Stores pin code number
PhoneCode Text Not null Stores phone Code number
PhoneNo Text Not null Stores phone number
MobileNo Text Not null Stores mobile number
Table Name: LoginThis table stores Login information.
Fields Type Key DescriptionFull_Name Text Not null Stores full nameUsername Text Not null Stores user namePassword Text Not null Stores password
DeptID Text Primary Key Stores Department id
EmpID Text Primary Key Stores Employee id
Added_on Date/Time Not null Stores date of Starting
Added_At Date/Time Not null Stores time of Adding
Status Text Not null Stores Status
Table Name: ReservationThis table stores Reservation information.
Fields Type Key Description ReservationId Text Primary Key Stores Reservation IDEmpId Text Primary Key Stores Employee ID
Category Text Not null Stores reservation Category
Name Text Not null Stores Customer NameMiddleName Text Not null Stores Customer
middle NameSurname Text Not null Stores Customer
SurnameOrganization Text Not null Stores Customer
OrganizationPurpose Text Not null Stores Customer
purposeTotalPersons Number Not null Stores No. of CustomerRoomType Text Not null Stores Room typeTotalRooms Number Not null Stores Total rooms
reservedReservationDate Date/Time Not null Stores Reservation dateReservationTime Date/Time Not null Stores Reservation
TimeCity Text Not null Stores City NameAddress Text Not null Stores AddressPincode Number Not null Stores Pin code numberPhoneCode Number Not null Stores Phone Code
numberPhoneNo Number Not null Stores Phone numberMobileNo Number Not null Stores Mobile numberReservationFrom Date/Time Not null Stores Reservation
Starting DateReservationTo Date/Time Not null Stores Reservation
Ending DateAdvance Number Not null Stores AdvanceStatus Text Not null Stores Hotel Current
Status
Table Name: RoomThis table stores Room information
Fields Type Key DescriptionRoomNo Number Not null Stores Room NoReserved Text Not null Stores ReservedRoomType Text Not null Stores Room Type
Available Text Not null Stores Room
Available
Table Name: CustFacilityThis table stores CustFacility information.
Fields Type Key DescriptionFacilityCode Number Not null Stores Facility Code
BillNo Number Not null stores Bill No
Facility Text Not null Stores FacilityFacilityBill_date Date/Time Not null Stores Facility Bill dateFacilityBill_time Date/Time Not null Stores Facility Bill timePriceperhour Number Not null Stores Price per hourTotalHours Number Not null Stores Total HoursAmount Number Not null Stores Amount
Table Name: CustLaundryThis table stores CustLaundry information.
Fields Type Key DescriptionBillNo Text Primary Key Stores Bill NoLaundryBill_date Date/Time Not null Stores Laundry Bill
dateLaundryBill_time Date/Time Not null Stores Laundry Bill
timeTotalCloths Number Not null Stores Total Cloths
PriceperCloth Number Not null Stores Price per Cloth
Amount Number Not null Stores Amount
Table Name: CustomerbillThis table stores Customerbill information.
Fields Type Key DescriptionBillNo Text Primary Key Stores Bill NoCustomerID Text Primary Key Stores Customer IDName Text Not null Stores NameRoomNo Number Primary Key Stores Room NoBill_Date Date/Time Not null Stores Bill DateBill_Time Date/Time Not null Stores Bill TimeAmount Number Not null Stores AmountPayment Text Not null Stores Payment
Table Name: CustPartyThis table stores CustParty information.
Fields Type Key DescriptionPartyCode Text Not null Stores Party CodeBillNo Text Primary Key Stores Bill NoPartyBill_date Date/Time Not null Stores Party Bill datePartyBill_time Date/Time Not null Stores Party Bill timeTotalPersons Number Not null Stores Total Persons
PriceperHour Number Not null Stores Price per HourTotalHours Date/Time Number Not null Stores Total HoursAmount Number Not null Stores Total Hours
Table Name: DepartmentThis table stores Department information.
Fields Type Key DescriptionDeptID Text Primary Key Stores Department idDepartment Text Not null Stores Department
name
Table Name: EmployeeThis table stores Employee information
Fields Type Key Description
EmpId Text Primary Key Stores employee idName Text Not null Stores nameMiddleName Text Not null Stores middle nameSurName Text Not null Stores SurnameCompany Text Not null Stores name of
companyDOB Date/Time Not null Stores date of birthAge Date/Time Not null Stores ageDOJ Date/Time Not null Stores date of joiningTimeofjoin Date/Time Not null Stores time of joiningSex Text Not null Stores genderCity Text Not null Stores cityAddress Text Not null Stores employee
addressPincode Text Not null Stores pincode
numberPhoneCode Text Not null Stores phoneCode
numberPhoneNo Text Not null Store phone no.MobileNo Text Not null Stores mobile
number
Table Name: EmpQThis table stores EmpQ information.
Fields Type Key DescriptionEmpId Text Primary Key Stores employee idPercentage_of_SSC Text Not null Stores percentage of
SSCOrderTime Board_of_SSC
Text Not null Stores Order time
Twelve Text Not null Stores twelve appeared
Diploma Text Not null Stores diploma appeared
Percentage_of_HSC Text Not null Stores percentage of HSC
Board_of_HSC Text Not null Stores Board of HSC
Diploma_Stream Text Not null Stores diploma stream
Percentage_of_diploma Text Not null Stores percentage of diploma
Graduate Text Not null Stores graduateHotelMgmt Text Not null Stores hotel
managementUniversity_of_Graduation Text Not null Stores percentage of
graduationPercentage_of_Graduation
Text Not null Stores college of hotel management
Collg_of_HM Text Not null Stores percentage of hotel managmen
Percentage_of_HM Text Not null Stores percentage of hotel managmen
Table Name: HotelOrderThis table stores HotelOrder information.
Fields Type Key DescriptionOrderNo Text Primary Key Stores Order NumberEmpId Text Primary Key Stores employee idOrderDate Date/Time Not null Stores Order date
OrderTime Date/Time Not null Stores Order time
Table Name: OrderProductThis table stores OrderProduct information.
Fields Type Key DescriptionOrderNo Text Primary key Stores Order NoOrderType Text Not null Stores Order typeOrderDate Date/Time Not null Stores Order dateOrderTime Date/Time Not null Stores Order timeParticulars Text Not null Stores ParticularsQuantity Number Not null Stores QuantityOrderCost Number Not null Stores Order CostSupplierId Text Not null Stores Supplier ID
Table Name: ReservationRoomsThis table stores ReservationRooms information.
Fields Type Key DescriptionReservationId Text Primary Key Stores Reservation IDRoomNo Text Not null Stores Room number
Table Name: SupplierThis table stores Supplier information
Fields Type Key DescriptionSupplierId Text Primary Key Stores supplier id
SName Text Not null Stores supplier nameCompany Text Not null Stores name of
companySupplierOf Text Not null Stores name of
commodityRegDate Date/Time Not null Stores registration
dateRegTime Date/Time Not null Stores registration
timeStatus Text Not null Stores StatusAddress Text Not null Stores customer
addressPincode Text Not null Stores pincode
numberPhoneCode Text Not null Stores phoneCode
number PhoneNo Text Not null Stores phone numberMobileNo Text Not null l Stores mobile
number
Table Name: BillThis table stores Bill information.
Fields Type Key DescriptionBillNo Text Primary Key Stores Bill number
Table Name: CustomeRoomCategoryThis table stores CustomeRoomCategory information.
Fields Type Key DescriptionRoomNo Text Primary Key Stores Room numberCategory Text Not null Stores Category
Table Name: DeluxeFamilyThis table stores DeluxeFamily information.
Fields Type Key DescriptionEmpId Text Primary key Stores Bill NumberSetDate Date/Time Not null Stores CodeSetTime Date/Time Not null Stores DescriptionRent Text Not null Stores Bill dateROneDay Text Not null Stores Bill timeROneWeek Text Not null Stores Total HoursROneMonth Text Not null Stores Total amount
Table Name: DeluxeIndividualThis table stores DeluxeIndividual information.Fields Type Key DescriptionEmpId Text Primary Key Stores Bill NumberSetDate Date/Time Not null Stores CodeSetTime Date/Time Not null Stores DescriptionRent Text Not null Stores Bill dateROneDay Text Not null Stores Bill timeROneWeek Text Not null Stores Total HoursROneMonth Text Not null Stores Total amount
Table Name: DoubleBedFamilyThis table stores DoubleBedFamily information.
Fields Type Key DescriptionEmpId Text Primary Key Stores Bill NumberSetDate Date/Time Not null Stores CodeSetTime Date/Time Not null Stores DescriptionRent Text Not null Stores Bill dateROneDay Text Not null Stores Bill timeROneWeek Text Not null Stores Total HoursROneMonth Text Not null Stores Total amount
Table Name: DoubleBedIndividualThis table stores DoubleBedIndividual information.
Fields Type Key DescriptionEmpId Text Primary Key Stores Bill NumberSetDate Date/Time Not null Stores CodeSetTime Date/Time Not null Stores DescriptionRent Text Not null Stores Bill dateROneDay Text Not null Stores Bill timeROneWeek Text Not null Stores Total HoursROneMonth Text Not null Stores Total amount
Table Name: EmployeeNoThis table stores EmployeeNo information.
Fields Type Key DescriptionEmpNo Text Primary Key Stores Employee
Number
Table Name: GroupRoomNoThis table stores GroupRoomNo information.Fields Type Key DescriptionCustomerId Text Primary Key Stores Coustomer IDRoomNo Text Primary Key Stores Room number
Table Name: SingleBedThis table stores SingleBed information.
Fields Type Key DescriptionEmpId Text Primary Key Stores Bill NumberSetDate Date/Time Not null Stores CodeSetTime Date/Time Not null Stores DescriptionRent Text Not null Stores Bill dateROneDay Text Not null Stores Bill timeROneWeek Text Not null Stores Total HoursROneMonth Text Not null Stores Total amount
Table Name: TransectionOfCoustomer
This table stores TransectionOfCoustomer information.
Fields Type Key DescriptionBill no Text Primary Key Stores Bill Numbercode Date/Time Not null Stores CodeParticular name Text Not null Stores DescriptionBill date Date/Time Not null Stores Bill dateBill time Date/Time Not null Stores Bill timeTotalHours_Persons_Cloths
Text Not null Stores Total Hours
TotalAmount Text Not null Stores Total amount
Table Name: UserDeleteThis table stores UserDelete information.
Fields Type Key DescriptionFull_Name Text Not null Stores Full nameUsername Text Not null Stores User namePassword Text Not null Stores Password DeptID Text Stores Department IDEmpID Text Stores Employee IDRemove_on Date/Time Not null Stores Date of
removalRemove_At Date/Time Not null Stores Time of
removal
4.2 Input Screen Design.
1. Welcome Screen:-
2. Login Screen:-
3. Main Screen (MDI Form):-
4. Add / Remove User Screen:-
5. Change User Name & Password:-
6. New Customer Check-In:-
7. Old Customer Check-In:-
8. Check-In of Individual Person Form:-
9. Departure of Customer:-
10. Reservation:-
11. Customer Search:-
12. Cancellation of Reservation:-
13. Search Reservation:-
14. Group / Family Check-In:-
15. Reserved Group Check-In:-
16. Check-Out of Group:-
17. Set Room Rent:-
18. Room Status:-
19. Search Room Rent:-
20. Customer Bill:-
21. New Bill:-
22. Update Customer Bill:-
23. New Employee:-
24. Employee Search & Edit:-
25. Add Supplier:-
26. Supplier Search:-
27. Old Details:-
`
28. Today’s Hotel Static:-
29. Front Office Report:-
30. Hotel Collection:-
31. About Us:-
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 testing’s.
The different levels of testing are as follows:
1. Unit Testing: It is used to detect the coding errors.
2. Integration Testing: It is performed to detect design errors, by focusing on theinterconnection between different modules.
3. System Testing: This is performed after the system is put together, to check if all therequirements 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
1. Add /Remove User:-
2. Changing Of User Name & Password:-
3. View All Users:-
4. Check-In of New Customer:-
5. Check-In of Old Customer:-
6. Check-In of Individual Reserved Customer:-
7. Reservation:-
8.Print Bill:-
7.OUTPUT
SCREENING
Implementation is the carrying out, execution, or practice of a plan, a method, or any design for doing something.
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
8.SCOPE FOR
FUTURE ENHANCEMENT
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
1.DATA REPORT
Private Sub DataReport_Terminate()
DataEnvironment1.Connection1.Close
End Sub
2. DataReport2
Private Sub DataReport_Terminate()DataEnvironment2.Connection1.CloseEnd Sub
4. Custmomer Search
Private Sub Form_Load()datSearch.Visible = FalseAdodc1.Visible = FalseEnd 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.RefreshEnd Sub
Private Sub OKButton_Click()frmEmpSearchEdit.Enabled = TruefrmEmpSearchEdit.fraMain.Enabled = TrueUnload MeEnd Sub
6. diaHotelCollection
Option ExplicitPublic objcon As ConnectionPublic objrs As RecordsetPublic check As Boolean
Private Sub CancelButton_Click()MDIForm1.mnuFile.Enabled = TrueMDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuGroup.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueMDIForm1.mnuCustomer.Enabled = TrueMDIForm1.mnuHelp.Enabled = TrueMDIForm1.mnuReportFrontOffice.Enabled = True Dim cntl As Control For Each cntl In diaHotelCollection If TypeOf cntl Is TextBox Then cntl.Text = "" End If Next
Unload MeEnd 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.CustomerId,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 = NothingEnd Sub
Private Sub Command14_Click()check = checksearchdates(txtFrom(3), txtTo(3))
If check = False Then Exit SubEnd 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.CustomerId,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 = NothingEnd Sub
Private Sub Form_Load()txtHCD.Text = DatetxtHCD.Locked = TrueEnd Sub
Private Sub Form_Terminate()CancelButton_ClickEnd Sub
Private Sub Frame11_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
7. diaReSearch
Option ExplicitPrivate Sub Command1_Click()Unload MeEnd Sub
Private Sub Form_Load()datSearch.Visible = FalseAdodc1.Visible = FalseCommand2.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 = TrueEnd IfEnd Sub
8. diaReservationSearch
Option Explicit
Private Sub CancelButton_Click()Unload MeEnd Sub
Private Sub Form_Load()datsearch.Visible = FalseAdodc1.Visible = FalseOKButton.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 = TrueEnd IfEnd Sub
9. diaRoomstatus
Option ExplicitPublic objcon As ConnectionPublic objrs As RecordsetPublic countroom As IntegerDim actualheight As Long
Private Sub CancelButton_Click()Unload MeEnd Sub
Private Sub cboRType_Click()txtRoomAvailable = ""txtReserved = ""txtTotal = ""fraIndividual.Visible = FalsefraFamily.Visible = FalseEnd Sub
Private Sub Form_Load()fraFamily.Visible = FalsefraIndividual.Visible = FalseMe.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 = 5End Sub
Private Sub OKButton_Click()Set objcon = New ConnectionSet objrs = New Recordset
objcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb"
If cboRType.ListIndex = -1 ThenMsgBox "Please select the room type", vbCritical, "Data missing"Exit Sub
End If
getentrygetavailablegetreserved
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 IfEnd Sub
Public Sub getentry()Dim roomtype As String
Dim objrs1 As Recordsetroomtype = cboRType.TextSet objrs1 = New RecordsetSelect 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 RecordsetDim 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 RecordsetDim 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 = NothingEnd SubPublic 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 SubPublic 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 = NothingEnd 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 IfEnd Sub
10. Data Environment
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
16. Bill Date
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
21. Form About
Private Sub Form_Load()Timer1.Enabled = TrueTimer2.Enabled = TrueEnd Sub
Private Sub Image3_Click()MDIForm1.ShowUnload MeEnd Sub
Private Sub Form_Terminate()MDIForm1.mnuFile.Enabled = TrueMDIForm1.mnuCustomer.Enabled = TrueMDIForm1.mnuGroup.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuReport.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueEnd Sub
Private Sub Form_Unload(Cancel As Integer)MDIForm1.mnuFile.Enabled = TrueMDIForm1.mnuCustomer.Enabled = TrueMDIForm1.mnuGroup.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuBills.Enabled = True
MDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuReport.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueEnd Sub
Private Sub mohit_Click()
End Sub
Private Sub Timer1_Timer()Label1.ForeColor = vbBlueLabel8.ForeColor = vbGreenLabel1.ForeColor = vbMagentaEnd Sub
Private Sub Timer2_Timer()Label8.ForeColor = vbGreenLabel1.ForeColor = vbBlueLabel8.ForeColor = vbBlueEnd Sub
22. Form all user
Private Sub Command1_Click()MDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuCustomer.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuGroup.Enabled = True
MDIForm1.mnuFileOption.Enabled = TrueMDIForm1.mnuAddUser.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuReport.Enabled = TrueMDIForm1.mnuHelp.Enabled = TrueMDIForm1.ShowUnload MeEnd Sub
Private Sub Form_Load()Adodc1.Visible = FalseAdodc1.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data source=" & App.Path & "\Hotel.mdb"Adodc1.RecordSource = "Select * from login order by EmpId"Adodc1.RefreshSet DataGrid1.DataSource = Adodc1End Sub
Private Sub Form_Unload(Cancel As Integer)Command1_ClickEnd Sub
23. Check In Form
Option ExplicitDim i As BooleanDim blncheck As BooleanDim objcon As ConnectionDim objrs As RecordsetDim blncity As Boolean
Dim blncountry As BooleanPublic firstrec As BooleanDim blngender As Boolean, blnroomtype As Boolean
Private Sub cboCountry_Change()Dim intIndex As IntegerDim blnfound As Boolean
Do While Not blnfound And intIndex < cboCountry.ListCountIf UCase(Left(cboCountry.List(intIndex), Len(cboCountry.Text))) = _UCase(cboCountry.Text) ThencboCountry.ListIndex = intIndexblnfound = Trueblncountry = TrueElseblncountry = FalseintIndex = intIndex + 1End IfLoopEnd Sub
Private Sub cboRoom_Click()cboRoomNo.Clearoptyes.Value = FalseoptNo.Value = FalsetxtRent = ""End Sub
Private Sub cboRoomNo_GotFocus()If cboRoom.ListIndex <> -1 ThenDim intIndex As IntegerDim 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
LoopElseMsgBox "Select room type", vbInformation, "Room Type"cboRoom.SetFocusEnd If If blnfound = True Then cboRoomNo.Enabled = True Roomvacant End IfEnd Sub
Private Sub chkForeigner_Click()If chkForeigner.Value = Checked ThencboCountry.Enabled = TrueElsecboCountry.Enabled = FalseEnd IfEnd Sub
Private Sub cmdCancel_Click()MDIForm1.mnuFile.Enabled = TrueMDIForm1.mnuCustomerDeparture.Enabled = TrueMDIForm1.mnuCustArrivalOld.Enabled = TrueMDIForm1.mnuCustArrivalNew.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuGroup.Enabled = TrueMDIForm1.mnuCustReservation.Enabled = TrueMDIForm1.mnuCustSearch.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueMDIForm1.mnuReport.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuReservationSearch.Enabled = TrueMDIForm1.mnuCancelReservation.Enabled = TrueMDIForm1.mnuHelp.Enabled = TrueMDIForm1.ShowUnload MeEnd Sub
Private Sub cmdClear_Click()Dim cntl As Control
For Each cntl In MeIf TypeOf cntl Is TextBox Then cntl.Text = "" End If NextchkForeigner.Value = 0cboCountry.ListIndex = -1cboCountry.Enabled = FalsecboRoomNo.ClearcboRoomNo.ListIndex = -1txtArrivalTime = Timeoptyes.Value = FalseoptNo.Value = FalsetxtDate = DatecmdDetails.Enabled = Truei = TruecmdClear.Enabled = FalsecmdAdd.Enabled = FalsecmdCust.Enabled = TruetxtCustomerId.SetFocusEnd Sub
Private Sub cmdCust_Click()diaCustSearch.Show vbModalEnd Sub
Private Sub cmdDetails_Click()If txtCustomerId = "" Then MsgBox "Enter Id", vbCritical, "Data Missing" txtCustomerId.SetFocus Exit Sub End If If MDIForm1.blnOld = True ThenIf i = True ThencmdDetails.Enabled = Falsei = False AddCustomerDetails cmdClear.Visible = True cmdClear.Enabled = TrueEnd IfEnd IfEnd 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 = TruetxtCustomerId.TabIndex = txtName.TabIndexEnd IftxtDate = DatetxtArrivalTime = TimeoptMale.Value = TrueEnd Sub
Private Sub Form_Load()i = TruecboCountry.Enabled = FalsetxtArrivalTime.Text = Time()txtDate.Text = DateIf MDIForm1.blnnew = True Then AssignId cmdCust.Visible = False Else cmdDetails.Visible = True cmdAdd.Enabled = False cmdCust.Visible = True txtCustomerId.TabStop = TruetxtCustomerId.TabIndex = txtName.TabIndexEnd IfoptMale.Value = TruetxtDate = DatetxtArrivalTime = TimeEnd Sub
Private Sub Form_Unload(Cancel As Integer)cmdCancel_ClickMDIForm1.mnuReservationSearch.Enabled = TrueEnd Sub
Private Sub optNo_Click()If cboRoom.ListIndex = -1 ThenMsgBox "Please select the Room type", vbCritical, "Data missing"cboRoom.SetFocusoptNo.Value = FalseExit SubEnd If
getrentEnd Sub
Private Sub optyes_Click()If cboRoom.ListIndex = -1 ThenMsgBox "Please select the Room type", vbCritical, "Data missing"cboRoom.SetFocusoptyes.Value = FalseExit SubEnd If
getrenttxtRent = Val(txtRent) + 500End Sub
Private Sub txtAddress_GotFocus()
If txtCity = "" ThenMsgBox "Please enter the city of customer", vbInformation, "Data missing"txtCity.SetFocusExit SubEnd IfEnd Sub
Private Function AddCustomerDetails()Dim found As BooleanDim objcon As ConnectionSet objcon = New ConnectionDim objrs As RecordsetSet 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 = Truei = TrueExit FunctionEnd If
If MDIForm1.blnOld = True Thenobjcon.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Hotel.mdb"objrs.Open " Select * from Customer where CustomerId='" & LCase(txtCustomerId) & "'", objcon, adOpenDynamic, adLockOptimisticEnd If
If objrs.EOF = True And objrs.BOF = True ThenMsgBox "Customer ID not found kindly enter correct Customer ID", vbCritical, "Invalid Customer"txtCustomerId = ""txtCustomerId.SetFocusobjrs.Closeobjcon.CloseSet objrs = NothingSet objcon = NothingcmdAdd.Enabled = FalsecmdDetails.Enabled = Truei = True
Exit FunctionEnd If
If found = True ThencmdDetails.Enabled = FalsecmdAdd.Enabled = TruetxtName = objrs("Name")txtName.Locked = TruetxtMiddleName = objrs("MiddleName")txtMiddleName.Locked = TruetxtSurname = objrs("Surname")txtSurname.Locked = TruetxtAge = objrs("Age")txtAge.Locked = TruetxtAddress = objrs("Address")txtAddress.Locked = TruetxtMobileNo = objrs("MobileNo")If objrs("Sex") = "male" Then optMale.Value = True Else optFemale.Value = TrueEnd IftxtPincode = objrs("Pincode")txtPincode.Locked = TruetxtCode = objrs("PhoneCode")txtCode.Locked = TruetxtPhoneNo = objrs("PhoneNo")txtPhoneNo.Locked = TruetxtMobileNo = objrs("MobileNo")txtMobileNo.Locked = TruetxtCity.Text = objrs("City")txtCity.Locked = TrueEnd IfcmdCust.Enabled = Falseobjrs.CloseEnd Function
Private Function checkAdults() As BooleanIf txtAdults.Text <> "" Then
Dim a As Stringa = txtAdults.Text
Dim b As Integer, i As Integerb = 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 FunctionEnd If
If cboRoom.ListIndex = -1 Then MsgBox "Please select the room type", vbExclamation, "Room selection" blncheck = False checkAdults = blncheck cboRoom.SetFocus Exit Function End If 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 BooleanIf txtChild.Text <> "" Then
Dim a As Stringa = txtChild.TextDim b As Integer, i As Integerb = 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 FunctionEnd 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 Exit Function End If End If If blncheck = True ThencheckChild = blncheckEnd IfEnd Function
Public Sub Roomvacant()
Dim objroom As RecordsetSet objroom = New RecordsetDim objcon As ConnectionSet 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 Loopobjroom.Closeobjcon.CloseSet objroom = NothingSet objcon = NothingEnd Sub
Private Function advance() As BooleanIf txtAdvance = "" ThenMsgBox "Please enter the advance amount", vbInformation, "Data missing"blncheck = Falseadvance = blnchecktxtAdvance.SetFocusExit FunctionEnd If
If cboRoom.ListIndex = -1 ThenMsgBox "Please select the room type", vbCritical, "Data missing"cboRoom.SetFocusadvance = FalseExit FunctionEnd 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 FunctionEnd If advance = TrueEnd FunctionPrivate Sub cmdAdd_Click()
Dim blnname As Boolean, blnmidname As BooleanDim blnSurname As Boolean, blnage As BooleanDim blnphone As Boolean, blnphonecode As BooleanDim blnpincode As Boolean, blnmobile As BooleanDim blncity As BooleanDim 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 .SelStart = 0 .SelLength = Len(.Text) End With Exit Sub End If
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 'insert the individual category objrs.Open "CustomerRoomCategory", objcon, adOpenDynamic, adLockOptimistic 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 IfEnd Sub
Public Sub Clearfields()If MDIForm1.blnnew = False ThentxtCustomerId = ""txtCustomerId.SetFocusEnd IfoptMale.Value = TruecboCountry.ListIndex = -1cboCountry.Enabled = FalsetxtDate = DatetxtArrivalTime = TimecboRoom.ListIndex = -1 cboRoomNo.ClearcboRoomNo.ListIndex = -1End Sub
Public Sub AssignId()
If MDIForm1.blnnew = True ThenDim 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 Recordsetobjrs.Open "CustIdsort", objcon, adOpenDynamic, adLockOptimistictxtCustomerId.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.MoveLastDim rec As StringDim slen As Integer, i As Integerrec = objrs("CustomerID")slen = Len(rec)i = slen - 2i = CInt(Mid(rec, 3, i))i = i + 1txtCustomerId = "c-" & iobjrs.Closeobjcon.CloseSet objrs = NothingSet objcon = NothingEnd IfEnd 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 LoopNoofdays = True End Function
Public Sub getrent()Set objcon = New ConnectionSet objrs = New Recordsetobjcon.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, adLockOptimisticobjrs.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, adLockOptimisticobjrs.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, adLockOptimisticobjrs.MoveLast txtRent = objrs("Rent") objrs.Close Set objrs = Nothing Exit Sub End If End Sub
24. Check out form
Option ExplicitDim blnfound As BooleanDim blncheck As Boolean, blncredit As BooleanPublic duration As Integer, billno As String, actualtotal As DoublePublic objcon As ConnectionPublic objrs As RecordsetPublic customerhasbill As Boolean
Private Sub cmdCancel_Click()
MDIForm1.mnuFile.Enabled = TrueMDIForm1.mnuBills.Enabled = TrueMDIForm1.mnuAccounts.Enabled = TrueMDIForm1.mnuEmployee.Enabled = TrueMDIForm1.mnuHotelStatus.Enabled = TrueMDIForm1.mnuCustomerArrival.Enabled = TrueMDIForm1.mnuCustReservation.Enabled = TrueMDIForm1.mnuRoomInfo.Enabled = TrueMDIForm1.mnuCustSearch.Enabled = TrueMDIForm1.mnuReport.Enabled = TrueMDIForm1.mnuGroup.Enabled = TrueMDIForm1.mnuReservationSearch.Enabled = TrueMDIForm1.mnuCancelReservation.Enabled = TrueMDIForm1.mnuHelp.Enabled = TrueMDIForm1.ShowUnload MeEnd 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 Set objrs = Nothing objcon.Close Set objcon = Nothing 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 If blnfound = True Then 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 Elsenocustomer: 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 IfElseMsgBox "Enter Room no.", vbInformation, "Data missing" txtRoomno.SetFocusEnd If
ElseDim blnchecktax As Boolean blnchecktax = checktax(txtTax)
If blnchecktax = False Then Exit Sub End If calculateamountEnd IfEnd 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 setdatetimeEnd Sub
Private Sub setdatetime()txtChkoutDate = DatetxtChkOuttime = TimeEnd 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 = TrueEnd Sub
Private Sub Form_Load()txtChkoutDate = DatetxtChkOuttime = Timecmdload.Caption = "Details"cmdNew.Enabled = FalsecmdChkOut.Enabled = FalsecmdBill.Enabled = FalsevisiblityEnd Sub
Private Function checktax(txt As TextBox) As BooleanIf 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 = TrueEnd 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 = FalseEnd Sub
Private Sub calculateamount()Dim total As Double, taxamount As DoubleIf duration = 0 Then
duration = duration + 1End If
total = Val(txtFacilityAmount) + (Val(txtAmount) * duration)taxamount = (Val(txtTax) * total) / 100 + total
If (Val(txtAdvance)) > taxamount Thenblncredit = False total = Val(txtAdvance) - taxamount txtTotal = total & " balance" actualtotal = taxamountElse blncredit = True txtTotal = (taxamount - Val(txtAdvance)) actualtotal = Val(txtTotal)End If txtTotal.Visible = True txtTotal.Locked = True cmdload.Enabled = False cmdChkOut.Enabled = TrueEnd 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 = TrueEnd Sub
Private Sub Form_Unload(Cancel As Integer)cmdCancel_ClickEnd 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, thefront 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.
Site Address:-
1. www.google.com.
2. www.wikipedia.com.
3. www.associatedcontent.com.
4. www.members.tripod.com.