1
CHAPTER ONE
INTRODUCTION
1.1 BACKGROUND TO THE STUDYSince the emergence of electronic computer, decision making and processing of information has been very easy. Data can now be stored on computer in a considerable low space and retrieved within a short period of time compared with the manual method which is tedious and time consuming as the size of the file increases (kennedy, k, 1999). Though, the ability of computer to store, retrieve and process data can also be done by human but the major difference is that computer can reliably execute millions of instructions within a nanosecond and store the result while it takes a longer period of time for human being to execute.
Hotel Management System is a software system where the management of entire hotel is computerized (KuljitKaur, Pooja1982). The application stores customer record and daily activities performed in the hotel such as customer details, reservation details, creating a new room, vacating the rooms, etc. all are computerized and the management is done without any difficulty. It also generate report for authorized user on a daily basis and weekly report, thereby reducing the time and stress that will be undergone using the manual method.
1.2 SCOPE OF THE PROJECT
The mission of this project is to facilitate easy management and administration of a hotel with capabilities to do Booking or reservations of the rooms, Cancellation of the rooms, creating of new user, Room service, Total billing etc. using the computerized hotel management software. One can keep detailed records or info on an unlimited amount of customers. The system lets the user know which all rooms are available for occupancy at any point of time. This makes the booking considerably faster. And thus helps the hotel in better management and reduce a lot of paper work as well as manpower.
1.3 OBJECTIVE OF THE PROJECT
The main objective of the entire activity is to automate and to manage the process of day to dayactivities of Hotel like:
2 Admission of a New Customer
Creating an account for new staff Delete existing account
Lodge in / Lodge Out
Check room if it is currently in use
Assign properties to room according to new update of the room Assign a room according to customer‟s demand,
Checkout of a computer and releasing the room Finally compute the bill etc.
1.4 STATEMENT OF PROBLEM
During peak time like December period people travel a lot and lodging in Hotel cannot be over emphasized. Currently,the system of most hotels used is manual method. It requires a lot of time spared in writing the details in the paper and manually validates and maintains the records. It can involve lots of search and time wastage. Preserving and maintaining large amount of data manually is a difficult task. The manual system being is too slow, erroneous in data collection, lack of security etc. Finding out the final payment amount completely relies on the hotel manager and if he is absent, it takes a long time to find out the details during check out and is prone to errors.
Drawbacks of the Manual Method Manual entry consumes more time.
It is difficult to maintain bulk of record in manual. Restrictions in the users.
Not easy to prepare the daily reports. Lack of accuracy and error prone. Overall efficiency is less.
Lot of paperwork. Non-secure.
3 No method to trace details
Human errors
The manual system is too slow Searching is more time consuming
1.5 SIGNIFICANCE OF THE STUDY
The proposed system is to facilitate easy management and administration of a hotel with capabilities to do Booking or reservations of the rooms, Cancellation of the rooms, Cash billing, ordering of food, Adding new staff, Generate bill, Review of report, etc. using the computerized hotel management software.
1.6. Basic Terminologies
Software:This is the collection of program that solve a particular problem, it solve a particular problem by using the computer to perform the job instead of manual method that is time consuming, software works together with the hardware to achieve a common goal. Database:A collection of data designed to be used by different people is called a database, it
can also be defined as the data repository;it is the back end of application where data store, update and it can be recovered for later use.
Computer: This can be defined as an electronic machine that stored data, processed data and give a feedback that is known as information.
System: This can be defined as an interrelated component that work together to perform a specific action.
GUI: Graphical User Interface.
SQL SERVER: This is a Relational Database Management System. The abbreviation is Structure Query Language. It is the product of Microsoft.
Vb.Net:Visual Basic (VB) is a programming language based on the original DOS language called BASIC (Beginners' All-purpose Symbolic Instruction Code). Is an object-oriented programming language based on VB that is implemented using the Microsoft .NET framework.
4
CHAPTER TWO
LITERATURE REVIEW
2.1 HISTORICAL BACKGROUND STUDYThe hotel proprietors Act, 1956, a hotel is an “Establishment held out by the proprietor as offering food, drink and if so required, sleeping accommodation, without special contract to any traveller presenting himself who appears able and willing to pay a reasonable sum for the services and facilities provided and who is in a fit state to be received” (KuljitKaur, Pooja, 1982).
Hotel is a place where all who conduct themselves properly, and who being able to pay and ready to pay for their entertainment, are received, if there be accommodation for them, who without any stipulated engagement as to the duration of their stay or as to the compensation, are while there, supplied at reasonable cause with their meals, lodging and other services and attention as are necessarily incident to the use as a temporary home‟(KuljitKaur, Pooja, 1982). Hotel keeping can be traced back to many centuries and its evolution through the ages has been brought about by Britain‟s economy and industrial changes and developments.
During the seventh and eight centuries, it was the monasteries that supplied hospitality to strangers and, as no charge was made for the accommodation; all travelers were expected to contribute according to their means to the abbey funds(KuljitKaur, Pooja, 1982).
As more people began to travel there group themselves together, not only for the company, but for mutual protection from highway men and robbers. Consequently, travelers arrived in groups at a monastery and it was often difficult to accommodate them all. In the early nineteenth century the concept of a hotel room in the bedroom, and this period is known as “Golden age of hotel of the great Britain and the world”. Hotel proprietors were legally referred to as „Common Innkeepers‟ (George Koch, 1998).
The turn of the century saw an era that was called „Belle Epoch‟ when grand and luxurious hotel flourished. A few hotels are still operating today. In London and some other cities attempts have
5
been made to recapture some of the grandeur of the past Vera in the making of the modern hotels, and bring back the memories the grand hotels and old days (George Koch, 1998).
According to my research on this project it was discovered that the term „Hotel‟ was used in England in about 1760. Hotel or inn is defined by British law as a place where travelers can receive food and shelter, provided he is in a position to pay for and is in a fit condition to be received‟(George Koch, 1998).
2.2 MANAGEMENT INFORMATION SYSTEM
A management information system (MIS) is a system that provides information needed to manage organizations effectively. Management information systems are regarded to be a subset of the overall internal controls procedures in a business, which cover the application of people, documents, technologies, and procedures used by management accountants to solve business problems such as costing a product, service or a business-wide strategy.
Management information systems are distinct from regular information systems in that they are used to analyze other information systems applied in operational activities in the organization. Academically, the term is commonly used to refer to the group of information management methods tied to the automation or support of human decision making, e.g. Decision Support Systems, Expert systems, and Executive information systems
2.3 RELATED WORKS
A student information system (SIS) is a software application for educational establishments to manage student data. Student information systems provide capabilities for entering student test and other assessment scores through an electronic grade book, building student schedules, tracking student attendance, and managing many other student-related data needs in a school, college or university. The Student Information System also known as student information management system (SIMS,SIM), student records system (SRS), student management system (SMS), and campus management system (CMS) or school management system (SMS).
The SIS is equivalent to an Enterprise Resource Planning or ERP system for acorporate customer. As such, many of the issues with ERP System Selection Methodology, implementation, and operation of an ERP system apply to schools and their SIS systems. These
6
systems vary in size, scope and capability, from packages that are implemented in relatively small organizations to cover student records alone, to enterprise-wide solutions that aim to cover most aspects of running large multi-campus organizations with significant local responsibility. Many systems can be scaled to different levels of functionality by purchasing add-on "modules" and can typically be configured by their home institutions to meet local needs.
Until recently, the common functions of a student records system are to support the maintenance of personal and study information relating to:
Handling inquiries from prospective students Handling the admissions process
Enrolling new students and storing teaching option choices Automatically creating class & teacher schedules
Handling records of examinations, assessments, marks and grades and academic progression
Maintaining records of absences and attendance Recording communications with students Maintaining discipline records
Providing statistical reports
Maintenance boarding house details
Communicating student details to parents through a parent portal Special Education / Individual Education Plan (IEP) services Human resources services
Accounting and budgeting services Student health records
In larger enterprise solutions that have student data at their core, further functions include Student financial aid management and more may be customized by the developer. Where national or government systems exist for student finance or statistical return purposes, student records system often provide functionality that caters for this, by way of modules or coreelements that handle the production of required files, or deal with the formatted transfer of information. Examples are the FAFSA (Free Application for Federal Student Aid) process in the United States, the United Kingdom's Student Loans Company processes (SSAR,
7
SSAC and ATFEE file processing), the UCAS (Universities and Colleges Admissions Service) in the United Kingdom, or the HESA and HESES student statistical returns in the United Kingdom.
In the past, universities and large school districts in particular have created their own bespoke student record systems. One such example is the ROSI system at University of Toronto. With growing complexity in the business of educational establishments, most organizations now choose to buy customizable software, and increasing numbers are buying software as a service (SAAS) such as QuickSchools.com, Orbund, EMPOWER, WeBSIS, Spiral Universe, and Renweb. Most student information systems in use today are server-based, with the application residing on a central computer server, and being accessed by client applications at various places within and even outside the school. But student information systems have been moving to the web since the late 1990s and that trend is accelerating as institutions replace older systems.
2.4 INTEGRATED SYSTEMS / HOSTED SERVICE
In recent years, several forces have been driving an evolution of student information systems and as a result, leading many institutions to replace theirs. Those forces are:
Demand for 24x7 web-based access to information by students, instructors, and (in primary and secondary education, or K-12) parents
Increasing demands in the amount and frequency of data reporting for accountability and other purposes (so-called "vertical reporting" up to state, provincial, and national agencies)
Importance of integrating student information systems with other tools, especially relating to instruction (IMS systems like Orbund, Maestro, School Net and School City in the US), courses (CMS systems like Blackboard, RM Learning Platform, Chamilo, Claroline, eFront, elearnapp, Dokeos, Sakai, Moodle, Spiral Universe) and learning (LMS systems and on-line course ware like APEX).
8 2.5 UPGRADE PITFALLS
Unlike an upgrade to a web browser or a word processor, changes and upgrades to these systems tend to have significant impact on the day-to-day operations of every school employee. These systems typically touch every aspect of school operations even when only the base modules are used. For these reasons, care should be taken to consider the impact on:
Workflow: Since these programs are tightly tied to a school's business workflow and processes, a change to a SIS system can force changes to workflow. This can have a significant impact on daily operations if not considered carefully prior to implementation. Data Conversion: Data conversion of historic data (transcripts, attendance, health records, etc.) for both current and past students can also be a significant issue to transitioning to a new SIS. Since most schools are required to keep historical data on past students, considerations should be given to what information will be converted and what will be archived.
Customized Reports: Since there is little standardization in what and how student information is stored, most schools have their own processes and procedures (e.g. formatting and layout of data reports) for student grade printouts or attendance records. As most SISs are not perfectly compatible with the previous SIS, upgrading can be a long and tedious process.
Training: Some new SIS programs have a tendency to include some unnecessary features, primary for the use of power users, so training employees to use the new SIS program will most likely be a costly and time-consuming process. Like with an ERP system, schools should consider processes similar to the ERP System Selection Methodology when selecting a SIS system.
2.6 CONCEPT OF HOTEL MANAGEMENT SYSTEM
The Hotel Management System (HMS) is a software application for hotel establishments to manage customer information and employee information for quick results. Hotel Management System provide capabilities for entering customer data, facilitate easy management and administration of a hotel with capabilities to do Booking or reservations of the rooms, Cancellation of the rooms, Cash billing, Room service, Total billing etc. using the computerized hotel management software.
9 Features of Hotel Management System
User Authentication Fast Data & Insertion User friendly interface
Advantages of proposed system
The following are the advantages of the proposed system Secure data
Faster process Error Free
Better management Save a lot of manpower Elimination of Paper work. High reliability and security. Fast and economical.
10
CHAPTER THREE
DESIGN METHODOLOGY
3.1 ADOPTED METHODOLOGY
The methodology used for this project is Rapid Application Development (RAD). Rapid Application Development (RAD) refers to a type of software development methodology that uses minimal planning in favor of rapid prototyping. The "planning" of software developed using RAD is interleaved with writing the software itself. The lack of extensive pre-planning generally allows software to be written much faster, and makes it easier to change requirements.
3.2 SYSTEM DEVELOPMENT MODEL
The Model to be employed in the development of this system is the Rapid Application Development model. This is an adaptation of the traditional Waterfall model and is better suited for this project because the development steps can be carried out concurrently i.e. While more data is been gathered to make the system robust and fully effective, design and coding can start and additions made as the project moves on. This will also make room for early testing to ensure that the system meets its requirement. The steps involved in Rapid Application Development are:
Planning and Document Requirements System Analysis and Design
System Development Testing
User Review
3.3 THE PLANNING PHASE
The goal of the planning phase is to map broad capabilities of the system from the student perspective. The phase is further divided into the following sub-phase:
Project Definition Session
11 Final Document
3.3.1 Project definition
This has to do with identifying what the management wants from the project. These include the Purpose, Scope, Objectives, Business Process, Constraints, Resources Requirements, Assumptions and Open issues. The purpose of this particular project is to provide a platform that allows customer and staffs to automate their work in the hotel by keeping information about customer and staffs in the database and generate daily or weekly report for management decision making.
3.3.2 Session
This stage defines how information is entered into the system via computer screen. The two type of defining screens are screen flow and screen design. The session also includes the definition of all outputs from the system and any other printouts.
3.3.3 Final document
The final document contains the entire documentation of the project meetings, procedures and other relevant documents needed for the successful execution of the project.
3.4 DESIGN PHASE
The design phase is divided into two tiers; the front-end and the back-end. The front-end is a graphical interface developed using VB.NET and the back-end which is the database was developed with Microsoft SQL Server.
3.5 DATABASE DESIGN
As earlier stated, the database was built using Microsoft SQL Server 2005 and it consists of various tables storing varying information. The description of each table is stated below.
1. BILL TABLE:It contain information about charges of customer such as food variety charges, room bill, service tax, and extra charges.
12
2. CHECK TABLE: This contain information about in time of customer and check-out time of customer, this table also keep record of number of days spent in the hotel. 3. CUSTOMERS TABLE:This contains record of customers such as customer id,
customer name, customer address, and phone number.
4. LOGIN TABLE:It contains the login information and the information about authenticated user of the system, such as user name, password, first name, last name, phone number.
5. RESERVATION TABLE:It contains information about customers who reserved for later use. Information stored in this table include reservation id, reservation name, address, phone number, reservation date, and no of days used to reserve the room.
6. ROOM_MASTER TABLE: Data stored in this table includes room number, room type, status of the room, and tariff charge of the room.
7. VARIETY TABLE:This table keeps the record of different variety bought in the hotel such as food variety and the full details of the variety such as variety id, variety name, customer id of the customer that bought the variety, costs of the variety.
3.6 APPLICATION ACTIVITY
The application activity illustrates the flow of activities that needed for the operation of the proposed system. In other words, application activity shows how the program is started till when the program is terminated.
i. The process begins; the splash screen is displayed that contain the picture and logo of the hotel welcoming the user “welcome to Daktad Hotel& Suite Hotel Management System” then the system automatically proceed to login page. The user logs in either as an administrator or staff.
ii. If the user is an administrator, he can add a new staff according to their designation, review daily transaction, daily report, weekly report and monthly report, mobilized report for printing, edit or delete staff account.
13
iii. If user is a staff he/she can make use of interface like the input customer information, view room status, order for food according to customer request, assign room for customer, generate receipt for customer after lodge-out and
iv. The administrator can access any page in the Admin modules v. The user signs out.
vi. The process ends 3.7 INPUT DESIGN
The input requirement of the design phase includes the following:
Admin username: This is the required username for administrator to enter in the application Admin password: This is the password of an administrator
Staff username: This is the users‟ username Staff password: This is the users‟ password 3.8 PROCESS DESIGN
1. Room Enquiry and Reservation Module
This module deals with reservation enquiry and reservation. During reservation, the details of the customers, type of room required and number of room required are fed in to the system. Once these in formations are entered, the system searches for the unoccupied rooms and displays the result. In reservation enquiry, customer can get the information such as rent of rooms and details of rooms available.
2. Check In/Check-out Module
This module deals with the reservation checkin (i.e., allocating room for the customer who has already reserved) Direct checkin (i.e., checking in without reservation), handling checkout of guest and Bill payment.
14
This module deals with the generation and tracking of bills and payments made by the guest. The bills are classified into lodging bills and Restaurant Bill. The lodging bill is calculated using the check in and checkout details of the person. The Restaurant bill is generated based on the food items consumed by the guest during his stay in the hotel.
4. Reports
This module deals with the generation of the reports for the various modules. The customer list can be generated. Room status list can be retrieved for reference. The check in and check out registers can also be retrieved for any future queries.
3.9 OUTPUT DESIGN
The requirement of the output design phase is: Report of Hotel Management System
3.10 SYSTEM DEVELOPMENT
Software development like any other field requires a prompt and proper planning in order to have stable and reliable foundation for further development.
3.11 TESTING
This phase test the system before proper deployment to check for errors in its design, where the code modules produced are tested to unravel bugs and ensure that they conform to the stated Users‟ Requirements. The type of system test used during the development of this application is “UNIT TEST”. This test ensures that each unique path of this project performs accurately to the documented specifications contains clearly defined inputs and expected results.
3.12 DATA FLOW DIAGRAM
The data flow diagram (DFD) is one of the most important tools used by system analysts. Data flow diagrams are made up of a number symbols, which represent system components. Most data
15
flow modeling methods use four kinds of symbols. These symbols are used to represent four kinds of system components such as Processes, data stores, data flows and external entities. Circles in DFD represent processes. Data Flow is represented by a thin line in the DFD and each data store has a unique name and rectangle represents external entities. Unlike detailed flow chart, Data Flow Diagrams do not supply detailed description of the modules but graphically describes a system‟s data and how the data interact with the system. An arrow identifies the data flow in motion. It is a pipeline through which information is flown like the rectangle in the flowchart. A circle stands for process that converts data into information. An open-ended box represents a data store, data at rest or a temporary repository of data. A square defines a source or destination of system data.
DFD for Hotel Management System DFD for Overall System:
DFD for Authentication: Data Data Hotel Manageme nt System Database
User
User Name & PasswordUser Validate the User
Alert Message Data Processing Database Invalid User Valid User Data
16
DFD for modules in the Hotel Management System
Customer Data
D a t a D a t a Restaurant Bill Details
Bill Details
Enquiry Data
Room Data Food Details
User Process the Request Restaurant Billing Food Entry Bill Entry Reservation Enquiry RoomData Reservation Entry Check-in Entry Check-Out Entry Database Reports Report Generation Reservation Data Check-in Data Checkout Data Report Data Customer Entry
17
NO 3.13 SYSTEM FLOW CHART
YES Start
LOGIN PAGE
VALIDATE
ADMIN PAGE STAFF PAGE
FILE CREATE REPORT EDIT
EXIT ADD USER
DAILY REPORT GENERATE MONEY YES NO PRINT REPORT DELETE USER VIEW USERS DELETE USER
FILE CREATE RESERVATION VIEW
EXIT CUSTOMER DETAIL RESTAURANT DETAIL PRINT RECEIPT SUBMIT PRINT RECEIPT PROCEED ED RESERVE ROOM VIEW RESERVATION PRINT RESERVED PROCEED CHECK STATUS PROCEED SUBMIT PRINT RECEIPT CHECK-IN / CHECK-OUT ROOM STATUS SHOW STATUS CHECK CHECK OUT END STOP
18
CHAPTER FOUR
SYSTEM IMPLEMENTATION AND EVALUATION
4.0 SYSTEM IMPLEMENTATION
This chapter deals with the implementation and evaluation of the designed system for verification and validation of the various program/function modules embedded in the design. It introduces the software and hardware requirements for the system to work properly.
4.1 CHOICE OF PROGRAMMING LANGUAGE AND TOOLS
The programming language used for this application is Microsoft Visual Basic.Net. Visual Basic (VB) is a programming language based on the original DOS language called BASIC (Beginners' All-purpose Symbolic Instruction Code). VB.NET 2010, an offshoot of Visual Basic, is an object-oriented programming language based on VB that is implemented using the Microsoft .NET framework. Visual Basic .NET can be used to create win forms or web applications and create programming based in any object-oriented programming language (OOP), ADO.NET, Multithreading or Windows Services. VB.NET programming utilizes concepts connected to string encryption, forms inheritance, regular expressions and deployment. During the course of using this approach, the following techniques were adopted: The Top-down design approach the development process begins with the most general view of the application and progressively moves towards a more detailed view. The top-down philosophy ensures that testing of each of the modules begins as soon as they are developed without necessarily completing the project. 4.2 SOFTWARE REQUIREMENTS
The software requirements for this application include: Windows XP, Windows Vista and Windows 7 Microsoft SQL server
Microsoft.Net Framework
Anti-virus software to prevent unwanted attack to the system Firewall software to prevent malicious user attack to the system
19
4.3 HARDWARE REQUIREMENTS
The hardware requirements for this software to run are: Processor Intel Pentium class 833MHz or higher RAM 256Mb or higher
60Gb Hard-Disk or higher(recommended) VGA 800X600, 256 colour
Laser Jet Printer
Uninterrupted Power Supply (UPS)
4.4 PROGRAM INTERFACE AND SCREENSHOT
The respective interface of the new system design to be human friendly and function are explained below.
APPLICATION SCREEN SHOT WELCOME SPLASH
This is the page shown to the user immediately the application is launched, it is a splash screen that welcomes the user.
20 USER LOGIN
This is the main login of the application that allow the user to login as Administrator or Staff
FIG. 4.1 LOGIN SCREEN
ADMINISTRATIVE CONTROL PANEL
This is the main login of the application that allows the user to login as Administrator or Staff.
21 ADD NEW USER
This is the interface that allows the administrator to add new staff to the database.
FIGURE. 4.3 ADD NEW STAFF SCREEN SHOT DAILY REPORT
This is the interface that allows the administrator to check the amount of the total sales make daily. It automatically generates the amount and prints the report.
22 VIEW ALL USER
This is the interface that allows the administrator to check the profile of staffs and can also delete any staff.
FIGURE. 4.6 VIEW USER SCREEN SHOT STAFF MAIN MENU
This is the interface of staff page. The interface automatically changes the User name, Department and the login time according to staff that login.
23 ADD NEW CUSTOMER INFORMATION
This is the interface that allows the staff to fill in customer information according to their choice of room.
FIGURE. 4.8 NEW CUSTOMER DETAILS SCREEN SHOT RESTAURANT INPUT
This is the interface that allows the staff to input customer restaurant information according to customer purchased and calculate their bill.
24 ROOM RESERVATION
This is the interface that allows the staff to reserve a room for customer according to customer demand
FIGURE.4.9.0 ROOM RESERVATION SCREEN SHOT CHECK RESERVATION
This is the interface that allows the staff to check if room is reserved or available.
25 CHECK-IN/CHECK-OUT
This is the interface that allows the staff to check-out the customer in the room when the duration has expired.
FIGURE. 4.9.2 CHECK-IN/CHECK-OUT SCREEN SHOT VIEW ROOM STATUS
This is the interface that allows the staff to view all the room status.
26 4.9.3.1 DATABASE SCREEN SHOT
FIGURE 4.9.3.0.1This is the Customer bill table
27
FIGURE 4.7.3 This is the Screen shot of customer table
28
FIGURE 4.7.6This is the screen shot of reservation table
29
CHAPTER FIVE
CONCLUSION
5.0 CONCLUSION AND RECOMMENDATION
The manual approach involved in managing Hotel Record is considered to be time consuming and monotonous. Therefore, the Hotel Management System was able to a large extent eliminate the manual approach. The overall system test and evaluation shows that the system is capable of keeping, maintaining records of hotel within the shortest possible time at the same time reducing the complexities with the manual methods.
5.1 RECOMMENDATION
A series of future work in this research area is highly recommended. This project has actually provided a platform for further studies in the area of Hotel Management System. The following research areas could be exploited to further enhance this research.
30
REFERENCES
Akeel I Din (2008), „Introduction to SQL‟, NCC BLACKWELL Publisher
http://www.goodreads.com/book/show/2048020.Structured_Query_Language_SQL_
Brad Siler, William Spot (2006), „Understanding VB.Net‟,(pp 1-200)
http://www.nps.gov/frla/photosmultimedia/upload/Olmsted-combined-research-notes-09-13-2012.pdf
Craig Utley (2005), „Programmers Introduction to VB.Net‟ ,(pp 30-120)
http://research.ijcaonline.org/volume37/number9/pxc3876690.pdf
Dave Grundgeiger (2007), „Programming Visual Basic.Net‟, BOOKMAN Publisher
ftp://ftp.bl.uk/pub/nbs/pubs/bnb/bl-annual-03/classified/15-12-03/Class1.1_100.pdf
David McAMis (2008), „Crystal Report for Visual Studio.Net „,(pp 1-70)
http://rp1989.blogspot.com/
Kennedy, k (1999), „Synopsis of Online Hotel Management System‟
http://dspace.cusat.ac.in/jspui/bitstream/123456789/4276/1/OnlineHotelMgt.pdf
KuljitKaur, Pooja (1982), „Report for Hotel and Hospitality Industry‟,(pp 5-189)
31
APPENDICES
Imports System.Data.SqlClientImports System.Web.Configuration.WebConfigurationManager
PublicClass AddNewUser
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If txtPass.Text = ""Then
MsgBox("username/password cannot be empty")
ExitSub EndIf Try
cn.Open()
Dim cmdText AsString = "select * from Login where password='"& txtPass.Text &"'"
Dim cmd As SqlCommand
cmd = New SqlCommand(cmdText, cn)
Dim rea As SqlDataReader
rea = cmd.ExecuteReader Dim a AsString = "" While rea.Read a = rea("username") EndWhile cn.Close() cn.Open() If a = ""Then
cmdText = "Insert into Login values('"& txtPass.Text &"','"& txtFirst.Text _
&"','"& txtLast.Text &"','"& txtAdd.Text &"','"& txtPhone.Text &"','"& cbxDept.SelectedItem & _ "','Staff')" cmd = New SqlCommand(cmdText, cn) cmd.ExecuteScalar() MsgBox("Inserted") clear() Else
MsgBox("This username exists!")
EndIf Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub Sub clear() txtAdd.Text = "" txtFirst.Text = "" txtLast.Text = "" txtPass.Text = "" txtPhone.Text = "" cbxDept.SelectedItem = Nothing EndSub
32
EndClass
PublicClass AdminMeni
PrivateSub AdminMeni_FormClosing(ByVal sender AsObject, ByVal e As
System.Windows.Forms.FormClosingEventArgs) HandlesMe.FormClosing Form1.Show()
EndSub
PrivateSub AddNewUserToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles AddNewUserToolStripMenuItem.Click AddNewUser.Show()
EndSub
PrivateSub ViewUserToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ViewUserToolStripMenuItem.Click
Dim allusers AsNew ViewAllUsers allusers.Show()
EndSub
PrivateSub DailyReportToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles DailyReportToolStripMenuItem.Click
Dim dReport AsNew DailyReport dReport.Show()
EndSub
PrivateSub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ExitToolStripMenuItem.Click Form1.Show() Me.Hide() EndSub EndClass Imports System.Data.SqlClient Imports System.Web.Configuration.WebConfigurationManager PublicClass CheckInCheckOut
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If txtCust.Text = ""Then
MsgBox("You must enter customer ID")
ExitSub EndIf Try
33
Dim cmdText AsString = "select * from [check] where cust_id='"& txtCust.Text &"'"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open()
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
While reader.Read
txtChkD.Text = reader("chkInDate") txtChkT.Text = reader("chkInTime") txtRoomNo.Text = reader("room_no") txtNoD.Text = reader("noOfDays") txtChkOutD.Text = reader("chkOutDt") txtChkOutT.Text = reader("chkOutTime")
EndWhile
If txtChkOutD.Text = ""Then
MsgBox("No record found")
EndIf Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
If txtRoomNo.Text = ""Then
MsgBox("Room Number can't be null")
ExitSub EndIf
Dim cmdT AsString = "select * from [check] where cust_id='"& txtCust.Text &"' "
Dim comand AsNew SqlCommand(cmdT, cn) cn.Open()
Dim rea As SqlDataReader
Dim status AsString = ""
rea = comand.ExecuteReader
While rea.Read
status = rea("status").ToString
EndWhile
cn.Close() cn.Open()
If status = "check out"Then
MsgBox("This user with id: "& txtCust.Text &" has already
checked out")
clear()
Else
Dim cmdText AsString = "update Room_Master Set
Status='Available',checkOutDate='Not Set' where Room_No='"& txtRoomNo.Text
&"'"
Dim cmd AsNew SqlCommand(cmdText, cn) cmd.ExecuteScalar()
34
cmdText = "update [check] set status='check out' where
cust_id='"& txtCust.Text &"'"
cmd = New SqlCommand(cmdText, cn) cmd.ExecuteScalar()
MsgBox("Customer succcessfully checked out") clear() EndIf Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub Sub clear() txtChkD.Text = "" txtChkOutD.Text = "" txtChkOutT.Text = "" txtChkT.Text = "" txtCust.Text = "" txtNoD.Text = "" txtRoomNo.Text = "" EndSub EndClass Imports System.Data.SqlClient Imports System.Web.Configuration.WebConfigurationManager PublicClass CustomerDetails
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub CustomerDetails_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
Dim RanNum AsNew Random
txtCust.Text = RanNum.Next(9999, 999999)
EndSub
Sub Customers()
Try
cn.Open()
Dim cmdText AsString = "Insert Into customers VALUES('"& txtCust.Text &"','"& txtCustName.Text &"','"& txtAddress.Text &"','"& txtPhone.Text &"')"
Dim cmd AsNew SqlCommand(cmdText, cn) cmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry
35
EndSub
Sub checkIN()
Try
Dim ccc AsString = "Insert into [check] VALUES('"& txtCust.Text &"','"& dtChkIn.Text &"','"& _
txtChkTime.Text &"','"& txtRoomS.Text &"','"& txtNoD.Text &"','"& dtChkOutDate.Text &"','"& dtChkOutTime.Text &"','check in')"
Dim cmd AsNew SqlCommand(ccc, cn) cn.Open() cmd.ExecuteScalar() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub Sub UpdateRoomNo() Try
Dim cmdText AsString = "UPDATE Room_Master Set
Status='unavailable',CheckOutDate='"& dtChkOutDate.Text &"' where Room_No='"&
txtRoomS.Text &"'"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open() cmd.ExecuteScalar() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PublicSub LoadDataSet(ByRef cmdText AsString)
Dim da AsNew SqlDataAdapter(cmdText, cn)
Dim ds AsNew DataSet da.Fill(ds)
EndSub
Sub InsertTax(ByRef cust_id AsString, ByRef servTax AsInteger, ByRef Total
AsInteger)
Try
Dim cmdText AsString = "Insert INTO
Bill(CustomerID,theDate,ServiceTax,Total_Charge) Values('"& cust_id &"','"&
dtChkIn.Text &"','"& servTax &"','"& Total &"')"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open() cmd.ExecuteScalar() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub Sub Print() Try
36
Dim cmdText AsString = "Delete from cust_Report INSERT INTO cust_Report
Values('"& txtCust.Text &"','"& txtCustName.Text &"','"& txtPhone.Text &"','"
_
& txtAddress.Text &"','"& txtChkTime.Text &"','"& dtChkIn.Text &"','"& dtChkOutTime.Text &"','"& dtChkOutDate.Text &"','"& txtNoD.Text &"','"& txtRoomS.Text &"')"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open()
cmd.ExecuteNonQuery()
Dim tText AsString = "Delete from BillTemp Insert INTO
BillTemp(cust_id,servT,Tot_Charge) select CustomerID,ServiceTax,Total_Charge
from Bill where CustomerID='"& txtCust.Text &"'"
cmd = New SqlCommand(tText, cn) cmd.ExecuteNonQuery() cn.Close() Catch ex As Exception MsgBox(ex.Message) EndTry EndSub
PrivateSub cbxRType_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cbxRType.SelectedIndexChanged
Try
Dim cmdText AsString = "select Room_No from Room_Master where Room_Type='"& cbxRType.SelectedItem &"'"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open()
Dim rea As SqlDataReader
rea = cmd.ExecuteReader lstRoom.Items.Clear() While rea.Read lstRoom.Items.Add(rea(0).ToString) EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub lstRoom_SelectedIndexChanged_1(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lstRoom.SelectedIndexChanged
Try
Dim cmdText AsString = "select * from Reservation where Res_Date='"& dtChkIn.Text &"' and Room_No='"& lstRoom.SelectedItem &"'"
Dim da AsNew SqlDataAdapter(cmdText, cn)
Dim ds AsNew DataSet
da.Fill(ds, "Reservation")
Dim RoomNo AsString = ""
Dim theDate AsString = ""
ForEach s As DataRow In ds.Tables(0).Rows RoomNo = s("room_no") theDate = s("Res_date")
Next
cmdText = "select * from Room_Master where room_no='"& lstRoom.SelectedItem &"'"
37
da = New SqlDataAdapter(cmdText, cn) ds = New DataSet
da.Fill(ds, "Room_Master")
Dim RoomNo2 AsString = ""
ForEach t As DataRow In ds.Tables(0).Rows RoomNo2 = t("status")
Next
cn.Open()
Dim myText AsString = "select * from Room_Master where Room_No='"& lstRoom.SelectedItem &"'"
Dim cmd AsNew SqlCommand(myText, cn)
Dim rr As SqlDataReader = cmd.ExecuteReader
While rr.Read
txtTariff.Text = rr("Tariff")
txtRoomS.Text = lstRoom.SelectedItem
If dtChkIn.Text = theDate And lstRoom.SelectedItem = RoomNo Then
txtRStatus.Text = "Reserved"
ElseIf RoomNo2 = "unavailable"Then
txtRStatus.Text = "unavailable" Else txtRStatus.Text = "Available" EndIf EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
'Const SerChar As Single = 0.02
Dim tarriff AsInteger
tarriff = txtTariff.Text
Dim NoD AsInteger
NoD = txtNoD.Text Dim TM AsInteger TM = tarriff * NoD Customers() checkIN() UpdateRoomNo() InsertTax(txtCust.Text, 0.02, TM) Print() PrintCustomerReport.Show() Me.Hide() EndSub EndClass
38
PublicClass MainMenu
PrivateSub ReserveRoomToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ReserveRoomToolStripMenuItem.Click RoomsReservation.Show()
EndSub
PrivateSub ViewReservationsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ViewReservationsToolStripMenuItem.Click viewReservation.Show()
EndSub
PrivateSub AddCustomerDetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddCustomerDetailsToolStripMenuItem.Click CustomerDetails.Show()
EndSub
PrivateSub CheckINcheckOUTDetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CheckINcheckOUTDetailsToolStripMenuItem.Click CheckInCheckOut.Show()
EndSub
PrivateSub RoomStatusToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles RoomStatusToolStripMenuItem.Click viewRoomStatus.Show()
EndSub
PrivateSub MainMenu_FormClosing(ByVal sender AsObject, ByVal e As
System.Windows.Forms.FormClosingEventArgs) HandlesMe.FormClosing Form1.Show()
EndSub
PrivateSub MainMenu_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) HandlesMyBase.Load lblTime.Text = DateTime.Now lblDept.Text = userInfo.dept
lblUName.Text = userInfo.name1 &" "& userInfo.name2
EndSub
PrivateSub NewRestaurantDetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
NewRestaurantDetailsToolStripMenuItem.Click
Dim rd AsNew Restaurant rd.Show()
EndSub
PrivateSub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ExitToolStripMenuItem.Click Form1.Show()
Me.Hide()
EndSub EndClass
39
Imports System.Data.SqlClient
Imports System.Web.Configuration.WebConfigurationManager
PublicClass Restaurant
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub cbxCategory_SelectionChangeCommitted(ByVal sender AsObject, ByVal
e As System.EventArgs) Handles cbxCategory.SelectionChangeCommitted
Dim cmdTet AsString = "select * from variety where category='"& cbxCategory.SelectedItem &"' "
Dim cmd AsNew SqlCommand(cmdTet, cn)
Try
cn.Open()
Dim reader As SqlDataReader
reader = cmd.ExecuteReader lstVarName.Items.Clear()
While reader.Read
lstVarName.Items.Add(reader("varName").ToString)
EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub lstVarName_SelectedIndexChanged(ByVal sender AsObject, ByVal e As
System.EventArgs) Handles lstVarName.SelectedIndexChanged
Dim water AsString = "select * from variety where varName='"& lstVarName.SelectedItem &"' "
Dim cmd AsNew SqlCommand(water, cn)
Try cn.Open() Dim rr As SqlDataReader rr = cmd.ExecuteReader While rr.Read txtAmount.Text = rr("cost") EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Try
If txtQuan.Text = ""Or txtAmount.Text = ""Then
MsgBox("supply quantity")
ExitSub EndIf
Dim quantity AsInteger Dim amount AsInteger Dim Total AsDouble
40
amount = txtAmount.Text Total = quantity * amount
txtOverallAm.Text += Total
Dim cmdText AsString = "INSERT INTO Restaurant VALUES('"& txtResID.Text &"','"& txtCustName.Text &"','"& _
lstVarName.SelectedItem &"','"& txtQuan.Text &"','"& txtAmount.Text &"','"& DateTimePicker1.Text &"')"
cn.Open()
Dim cmd AsNew SqlCommand(cmdText, cn) cmd.ExecuteScalar() MsgBox("saved") Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub Restaurant_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
Dim RanNum AsNew Random
txtResID.Text = RanNum.Next(10000000, 30000000) &"eA"
EndSub
PrivateSub btnPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrint.Click
If txtCustName.Text = ""Or txtAmount.Text = ""Or txtQuan.Text = ""Or
txtOverallAm.Text < 0 Then
MsgBox("You can't print with an incomplete information")
ExitSub EndIf Try
Dim cmdText AsString = "delete from RestaurantTemp Insert INTO RestaurantTemp Select Rest_ID,Cust_Name,FoodOrdered,quantity,amount from Restaurant where
Rest_ID='"& txtResID.Text &"'"
Dim cmd AsNew SqlCommand(cmdText, cn) cn.Open()
cmd.ExecuteNonQuery()
cmdText = "delete from header INSERT INTO header VALUES('"& txtResID.Text &"','"& txtOverallAm.Text &"')"
cmd = New SqlCommand(cmdText, cn) cmd.ExecuteNonQuery() RestReportForm.Show() Me.Hide() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub EndClass
41
Imports System.Data.SqlClient
Imports System.Web.Configuration.WebConfigurationManager
PublicClass RoomsReservation
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub RoomsReservation_Load(ByVal sender AsObject, ByVal e As
System.EventArgs) HandlesMe.Load
Dim ranNum AsNew Random
txtResID.Text = ranNum.Next(2000000, 3000000)
EndSub
PrivateSub cbxRoomT_SelectedIndexChanged(ByVal sender AsObject, ByVal e As
System.EventArgs) Handles cbxRoomT.SelectedIndexChanged
Try
cn.Open()
Dim cmdText AsString = "select * from Room_Master where Room_Type='"& cbxRoomT.SelectedItem &"'"
Dim cmd AsNew SqlCommand(cmdText, cn)
Dim rea As SqlDataReader
rea = cmd.ExecuteReader lstRooms.Items.Clear() While rea.Read lstRooms.Items.Add(rea(0).ToString) EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub lstRooms_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles lstRooms.SelectedIndexChanged
Try
Dim cmdText AsString = "select * from Reservation where Res_Date='"& dtDate.Text &"' and Room_No='"& lstRooms.SelectedItem &"'"
Dim da AsNew SqlDataAdapter(cmdText, cn)
Dim ds AsNew DataSet
da.Fill(ds, "Reservation")
Dim RoomNo AsString = ""
Dim theDate AsString = ""
ForEach s As DataRow In ds.Tables(0).Rows RoomNo = s("room_no") theDate = s("Res_date")
Next
cn.Open()
Dim myText AsString = "select * from Room_Master where Room_No='"& lstRooms.SelectedItem &"'"
Dim cmd AsNew SqlCommand(myText, cn)
Dim rr As SqlDataReader = cmd.ExecuteReader
While rr.Read
txtTariff.Text = rr("Tariff")
txtRoomN.Text = lstRooms.SelectedItem
42 txtStatus.Text = "Reserved" Else txtStatus.Text = "Free" EndIf EndWhile Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
If txtCustName.Text = ""Or txtDays.Text = ""Or txtPhone.Text = ""Or
txtAdd.Text = ""Then
MsgBox("No field can be empty")
ExitSub EndIf
cn.Open()
Dim ccc AsString = "Insert into Reservation Values('"& txtResID.Text &"','"& txtCustName.Text & _
"','"& txtAdd.Text &"','"& txtPhone.Text &"','"& dtDate.Text &"','"&
txtDays.Text &"','"& txtRoomN.Text &"','"& txtTariff.Text &"')"
Dim cmd AsNew SqlCommand(ccc, cn) cmd.ExecuteScalar()
ccc = "Delete FROM ReservationTemp INSERT INTO ReservationTemp
SELECT * from Reservation where Res_Id='"& txtResID.Text &"'"
cmd = New SqlCommand(ccc, cn) cmd.ExecuteScalar()
MsgBox("Room Reserved successfully") ReservationReportForm.Show() Me.Hide() Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub EndClass Imports System.Data.SqlClient Imports System.Web.Configuration.WebConfigurationManager PublicClass ViewAllUsers
Dim cn AsString = ConnectionStrings("Hotel").ToString
PrivateSub ViewAllUsers_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) HandlesMyBase.Load
43
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cp AsNew SqlConnection(cn)
Dim cmdText AsString = "select * from Login where designation='Staff'"
Dim da AsNew SqlDataAdapter(cmdText, cn)
Dim ds AsNew DataSet
da.Fill(ds, "Login")
DataGridView1.DataSource = ds DataGridView1.DataMember = "Login"
EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
If txtPassword.Text = ""Then
MsgBox("You must enter password")
ExitSub EndIf
Dim cmdText AsString = "select * from Login where password='"& txtPassword.Text &"'"
Dim cp AsNew SqlConnection(cn)
Dim cmd AsNew SqlCommand(cmdText, cp) cp.Open()
Dim reader As SqlDataReader
reader = cmd.ExecuteReader Dim a AsString = "" While reader.Read a = reader("password") EndWhile cp.Close() cp.Open() If a = ""Then
MsgBox("No record to delete")
Else
Dim ccc AsString = "DELETE FROM Login where password='"& txtPassword.Text &"'"
cmd = New SqlCommand(ccc, cp) cmd.ExecuteNonQuery()
MsgBox("record deleted") txtPassword.Text = "" EndIf cp.Close() EndSub EndClass Imports System.Data.SqlClient Imports System.Web.Configuration.WebConfigurationManager PublicClass viewReservation
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
If txtCust.Text = ""Then
MsgBox("You must enter customer ID")
44
EndIf
Dim cmdText AsString = "select * from Reservation where Res_Id='"& txtCust.Text &"'"
Dim cmd As SqlCommand
Try
cmd = New SqlCommand(cmdText, cn)
Dim rea As SqlDataReader cn.Open() rea = cmd.ExecuteReader While rea.Read txtCustName.Text = rea(1) txtAdd.Text = rea(2) txtPhone.Text = rea(3) txtResDate.Text = rea(4) txtDays.Text = rea(5) txtRoom.Text = rea(6) Button1.Enabled = True EndWhile If txtCustName.Text = ""Then
MsgBox("NO record found")
EndIf Catch ex As Exception MsgBox(ex.Message) Finally cn.Close() EndTry EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ReserveItems.Res_Name = txtCustName.Text ReserveItems.Address = txtAdd.Text ReserveItems.Phone = txtPhone.Text ReserveItems.Res_Date = txtResDate.Text ReserveItems.noOfDays = txtDays.Text ReserveItems.room_no = txtRoom.Text ReserveItems.tariff = txtTariff.Text CustomerDetails.Show() Me.Hide() EndSub EndClass Imports System.Data.SqlClient Imports System.Web.Configuration.WebConfigurationManager PublicClass viewRoomStatus
Dim cp AsString = ConnectionStrings("Hotel").ToString
Dim cn AsNew SqlConnection(cp)
PrivateSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs)
Handles Button1.Click
Dim cmdText AsString = "select * from Room_Master"
Dim da AsNew SqlDataAdapter(cmdText, cn)
45 da.Fill(ds, "Room_Master") DataGridView1.DataSource = ds DataGridView1.DataMember = "Room_Master" EndSub EndClass