Documente Academic
Documente Profesional
Documente Cultură
CERTIFICATE
This is to certify that the project work entitled HOTEL MANAGEMENT SYSTEM submitted by ASIF USMANI for the partial fulfillment of the requirement for the B.C.A. VI Sem in record of the student own work carried out under my supervision. I have instructed / guided them the said work from time to time and I found them to be satisfactorily progressive. I have assessed the said work. I am satisfied that the same is up to the standard required for the course.
ACKNOWLEDGEMENT
I am extremely grateful to project MRS.SANGEETA JOHARI for her invaluable help and support throughout the completion of this project. Without her help it would have been really difficult to complete the project. I express my deep sense of respect and thanks to Ms. Sangeeta Johari for her encouragement and coordination at every step of this project. At last I would like to thank my team members and everybody for always being supportive and leading a helping hand whenever required.
ASIF USMANI
CONTENTS
Cover Page Acknowledgement Forwarding Letter Certificate Index 1. PROJECT MANUAL
a. b. c. d. e. f. Introduction Problem Description Objective of Project Scope for New Existing System Advantages Proposed Menu Design
2. THEORITICAL BACKGROUND
a. About Front-End (MS Visual Basic 6.0) b. About Back-End(MS Access 2003) c. About SDLC Steps
4. DATABASE MANUAL
a. b. c. d. e. f. g. h. Data Model Entity Attribute Relationship Tables & Keys Constraints & Validation E-R Diagram Database Design View In Ms Access
5. USER MANUAL
a. Requirement Analysis b. Functional Decomposition Chart of Project c. Data Flow Diagram(DFD)
Context Analysis Diagram (Level-0) Level-1 Level-2
f. Report
6. TESTING
a. Methodology used for Testing b. Testing Strategies & Techniques
PROJECT MANUAL
INTRODUCTION
If you are looking for different career option apart form the regular once like Engineering or Bachelor degree? Computer Science is quite Exciting and challenging job. In this career daily you get an opportunity to work and meet different people. This career offer immense satisfaction, good salary and bright future too. Hotel management system is an extension and computerization to the manual examination system. It contains all the facilities, tricks and tracks and all that which could be used to enhance the overall procedure and operating style. It removes all the anomalies which were present in the manual examination. In manual examination system we made the assessment manually which cause dissatisfaction and it was rather irritating. In management System removed it by giving the facility to produce the instant result which it turns induced accuracy, time factor.
AREA OF PROJECT
The existing system of is manual. It maintains huge records for various departments. The book keeping procedure is tedious and it prompts to errors. Very careful handling is needed is manual systems. Even a very minute mistake may lead to imbalanced results. Manual processes results is waste of time and energy. In the earlier system the inventory report is calculated manually. Whenever the accounting is to be performed. That info. Must be extracted from file and calculation will have to check person. The existing system leads to a lot of problems. The existing system consumed a lot of stationary cost. Daily transactions are maintained in journals. These journal entries are then posted on to the ledger accounts correspondingly. This s/w will be useful for any hotel branches. This software will useful for manager, administrator, and customer. This s/w covers all computerized activities which can be perform in the hotel through computer as much as possible.
PROBLEM DISCRIPTION
This project is HOTEL MANAGEMENT SYSYEM; the main aim of this project is gives the customer view of the hotel. The customer needs in hotel are, enquiry about room reservation process, vacating process, canceling the reservation. In this project the first module gives the administrator we for log in. The customer need enquiry for first process. So the enquiry process is shown in the project that more effectively then the manual process the next process of customer is reservation. This reservation is for May today or future, for this the reservation from can work more efficient then the manual process. This form also checks the rooms for reservation dates. It is interactive to the customer; if the rooms are not available it gives message and not allows receiving for that date.
OBJECTIVES OF PROJECT
The main objective of my project is to computerize the rememberance.Maintaining records manually will be a hard task and also a time consuming process. By doing computerization it will gives lots of facilities to the remembering like whole data will now be computerized updating will done automatically, maintaining the records of customer will be easy, saved lots of time. Every day lots of saving, transactions, takes place. Keepings records of all these tracks manually will a very hard and challenging task; a small mistake can corrupts the whole task, therefore, need for computerization is necessary in this field.
ADVANTAGES
The system has the following advantages:1. The data can be maintained and updated easily with minimum efforts. 2. The complex reports were generated easily and without delay. 3. The allocation of the rooms status is immediately provided to the customer as earlier. 4. Various kinds of queries put in the customer can be answered immediately. Various level of security is maintained for the information at most
THEORTICAL BACKGROUND
System Design
Detailed Design
Implementation
Maintenance
HARDWARE SPECIFICATION:
Hardware is a term given to machine itself and to various pieces of equipment. It refers to physical devices of a computer system, thus, the input, storage, processing, control and output devices are hardware.
Processor: Pentium-V 2.0 GHz Ram: 256 MB Hard disk capacity: 40.0 GB Monitor: 15 Colored Keyboard: 104 Keys Keyboard Mouse: Option Mouse
SOFTWARE SPECIFICATION:
Software means a program where the objective is to enhance the capabilities of the hardware machine. The following defines the software of the proposed system developmentOperating system: 2000 professional Programming language: Microsoft visual basic 6.0(enterprise edition). Database: MS-Access 2000
DATABASE MANUAL
A. Data Model
B. Entity
CUSTOMER FACILITIES ROOMS BILL
C. ATTRIBUTE
CUSTOMER
Customer-id Customer-name Customer-address Customer-ph.no
FACILITIES
Facilities-type Facilities-name
ROOMS
Customer_id(foreign Key) Room-no. Room-type Room-charge
BILL
Type facilities Type room
RELATIONSHIP
A relational database management system is the most popular and most dominant information management system available today. Commencing in 1971 this concept has proven to the one of the highly prudent ways of storing, retrieving, analyzing and managing data. Once who use system built on RELATIONAL MODEL will instantly appreciate this is a convenient and powerful system. Customer : it must be a customer id(Constraints Primary Key) Room Service : it must be no. and room type(Composite Key)(customer id will be : it must be the service provided to the customer foreign key in room table)
ENTITIES: 1. CUSTOMER 2. FACILITIES 3. ROOMS 4. BILL ATTRIBUTES: CUSTOMER: This table CUSTOMER keeps all customer information. The structure
is as:
NAME
Cid Cname CAddress Cph.no.
Constraints
Primary key Not Null Not Null Not Null
Type
Text Text Text Number
Description
Customer id Customer name Customer Address Customer ph.no.
FACILITIES: FACILITIES: This table FACILITIES is used to provide the facilities to fulfill the
customers need. The structure is as:
NAME
Type Name
Constraints
Not Null Not Null
Type
Text Text
Description
Facilities Type Facilities Name
ROOMS: ROOMS: This table ROOMS is shows the no. of room, type and charges according to
customer configuration.
NAME
Cus Cusid Rno. RType Rcharges
Constraints
Primary key Not Null Not Null Not Null
Type
Text Number Text Currency
Description
Customer id Room number Room type Room charges
BILL: BILL: This table BILL is used to generate the bill for the customer of the charges and
other facilities which is provided by the hotel for the customer.
NAME
Tfacilities Trooms
Constraints
Not Null Not Null
Type
Text Text
Description
Type Facilities Type Rooms
ER-diagram
USER MANUAL
REQUIRMENT ANALYSIS
The origin of most s/w system is in the need of a client, who either wants to automate an existing manual system or desires a new s/w system. Thus there are three major parties interested in a new system: the client use and the developers. The basic purpose of s/w requirement specification is to bridge communication gap b/w the s/w development process and client problems. I have done this analysis in order to make a prototype of what the new system should look like. Since my main aim is to learn that how project are made and maintained, so this project of mine has gone through all stages of s/w development process.
(0 LEVEL)DFD
CUSTOMER
ALLOT FILL REQUEST FROM
CUSTOMER
HOTEL MANAGEMENT
ROOM
MANAGER
VACANT ROOM
CUSTOMER
CHECK OUT
TESTING
TESTING
Testing is the only phase in the whole s/w development process that is regarded as a destructive process rather than a constructive one. During the testing phase, the engineer creates a series of test cases that is intended to demolish the s/w that has been built. The basic testing principles that a s/w engineer must understand before applying method to design effective test cases are:1. All tests should be traceable to customer requirement. 2. Tests should be planned long before testing begins. 3. Testing should be begin in the small and progress toward testing in the large. 4. To be most effective, an independent third party should conduct testing. There are mainly two fundamental approaches to testing. These are:-`
Black box testing, which check for the fundamental aspect of a system with little
regard for the internal logic structure of the s/w. black box tests are used to demonstrate that s/w function are operational, that input is properly accepted and output is correctly produced, and that the integrity of external information is maintained.
White box testing, which check for the correctness of the procedural details at the
grass root level of the code. White box testing is used to ensure that internal opr. Are performed according to specifications and all internal components have been adequately exercised. White box testing of s/w is predicted on close examination of procedural detail. Providing test cases, which exercise specific sets of conditions and/ or loops, tests logical paths through the s/w.
The overall strategy for s/w testing may also be viewed in the context of the spiral. The spiral model of s/w development has following types of testing:-
1. Unit testing: - unit testing begins at the vortex of the spiral and concentrates on
each unit (i.e., component) of the s/w implemented in source code. Using the component level design description as a guide, important control paths are tested to uncover errors within the boundary of the module. The unit test is white box oriented and the step can be conducted is parallel for the multiple components. Test of data flow across s module interface are required before any other test is initiated. In addition, local data structures should be exercised and the local impact on global data should be ascertained during unit testing.
4. System testing: - In system testing, the software and other system elements are
tested as a whole. System testing is actually a series of tests whose primary purpose is to fully exercise the computer based system. Although each test has a different purpose, all work to verify that system elements have been properly have been properly integrated and perform allocated functions.
CODING
End Sub
End Sub
End Sub
End Sub
End Sub
Private Sub Form_Load() On Error Resume Next Data1.DatabaseName = App.Path & "/" & "HMDATA1.MDB" Data1.RecordSource = " SELECT * FROM ROOMS " Data1.Refresh Text1.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text2.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text3.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text4.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text5.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text6.Text = Data1.Recordset.Fields(3).Value Data1.Recordset.MoveNext Text7.Text = Data1.Recordset.Fields(3).Value
End Sub
Private Sub Command1_Click() Unload Me INTRODUCTION.Show INTRODUCTION.Refresh End Sub Private Sub Command10_Click() Text5.Text = "LANAL" Text4.Text = "8000" End Sub Private Sub Command11_Click() KITMENU2.Show End Sub Private Sub Command2_Click() On Error Resume Next D1.RecordSource = "SELECT * FROM HOTEL " D1.Refresh D1.Recordset.AddNew D1.Recordset.Fields("ROOMS") = Command4.Caption D1.Recordset.Update ROOMS.Text1.Text = Val(ROOMS.Text1.Text) - 1 D1.Recordset.AddNew
D1.Recordset.Fields(0) = Trim(T1.Text) D1.Recordset.Fields(1) = Trim(T2.Text) D1.Recordset.Fields(2) = Trim(DTPicker1.Value) D1.Recordset.Fields(3) = Trim(DTPicker2.Value) D1.Recordset.Fields(9) = Trim(Combo2.Text) D1.Recordset.Fields("ROOM_NO") = Val(Trim(Text1.Text)) D1.Recordset.Fields(10) = Val(Trim(Text6.Text)) D1.Recordset.Fields(4) = Trim(T7.Text) D1.Recordset.Fields(5) = Trim(T8.Text) D1.Recordset.Fields(6) = Trim(Combo1.Text) D1.Recordset.Fields(7) = Trim(T11.Text) D1.Recordset.Fields(8) = Trim(T12.Text) D1.Recordset.Fields(14) = Trim(Text5.Text) D1.Recordset.Fields(12) = Trim(Text2.Text) D1.Recordset.Fields(11) = Val(Trim(Text4.Text)) D1.Recordset.Fields(14) = Trim(Text5.Text) D1.Recordset.Fields(15) = Trim(T3.Text) D1.Recordset.Fields(16) = Trim(Text7.Text) D1.Recordset.Update D1.RecordSource = "SELECT * FROM ROOMS WHERE ROOMS='" & Trim(Text5.Text) & "'" D1.Refresh D1.Recordset.Edit
D1.Recordset.Fields("ROOMS AVALIBLE") = D1.Recordset.Fields("ROOMS AVALIBLE").Value - 1 D1.Recordset.Update T1.Text = "" T2.Text = "" T3.Text = "" Text7.Text = "" Text6.Text = "" Text1.Text = "" T7.Text = "" T8.Text = "" T9.Text = "" T11.Text = "" T12.Text = "" End Sub Private Sub Command3_Click() BILLS.Show End Sub Private Sub Command4_Click() Text5.Text = "SINGLE" Text4.Text = "1000" End Sub Private Sub Command5_Click()
Text5.Text = "DOUBLE" Text4.Text = "2000" End Sub Private Sub Command6_Click() Text5.Text = "SWEET" Text4.Text = "3500" End Sub Private Sub Command7_Click() Text5.Text = "DUPLEX" Text4.Text = "5500" End Sub Private Sub Command8_Click() Text5.Text = "SWEET" Text4.Text = "8000" End Sub Private Sub Command9_Click() Text5.Text = "DOUBLE DOUBLE" Text4.Text = "10000" End Sub
End If End Sub Private Sub Form_Activate() On Error Resume Next D1.DatabaseName = App.Path & "/" & "HMDATA1.MDB" D1.RecordSource = "SELECT ROOM_NO FROM HOTEL" Cbo1.Clear Do While Not D1.Recordset.EOF = True Cbo1.AddItem D1.Recordset.Fields("ROOM_NO").Value D1.Recordset.MoveNext Loop End Sub Private Sub Form_Load() On Error Resume Next D1.DatabaseName = App.Path & "/" & "HMDATA1.MDB" D1.RecordSource = "SELECT * FROM HOTEL" D1.Refresh Text2.Text = Date Combo1.AddItem (1000) Combo1.AddItem (2000) Combo1.AddItem (3000)
Combo1.AddItem (4000) Combo1.AddItem (5000) Combo2.AddItem (1) Combo2.AddItem (2) Combo2.AddItem (3) Combo2.AddItem (4) Combo2.AddItem (5) Combo2.AddItem (6) Combo2.AddItem (7) Combo2.AddItem (8) Combo2.AddItem (9) Combo2.AddItem (10) End Sub Private Sub T13_Change() If KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 13 Then Else KeyAscii = 0 End If End Sub Private Sub Option6_Click() End Sub
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 123 Or KeyAscii = 8 Or KeyAscii = 32 Then Exit Sub Else KeyAscii = 0 End If End Sub Private Sub T11_KeyPress(KeyAscii As Integer) If KeyAscii >= 67 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 123 Or KeyAscii = 8 Or KeyAscii = 32 Then Exit Sub Else KeyAscii = 0 End If End Sub
Private Sub T12_KeyPress(KeyAscii As Integer) If KeyAscii >= 67 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 123 Or KeyAscii = 8 Or KeyAscii = 32 Then Exit Sub Else KeyAscii = 0 End If
End Sub
Private Sub T3_KeyPress(KeyAscii As Integer) If KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 13 Then
Private Sub T5_KeyPress(KeyAscii As Integer) If KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 13 Then
End Sub
Private Sub T9_KeyPress(KeyAscii As Integer) If KeyAscii = 8 Or KeyAscii = 32 Then Exit Sub ElseIf KeyAscii <= 48 And KeyAscii >= 58 Then KeyAscii = 0 Exit Sub End If End Sub
Private Sub Text1_LostFocus() On Error Resume Next D1.RecordSource = "SELECT * FROM HOTEL WHERE ROOM_NO=" & Val(Text1.Text) & "'" D1.Recordset.MoveLast A = D1.Recordset.RecordCount D1.Recordset.MoveFirst For I = 0 To A - 1 If D1.Recordset.Fields("ROOM_NO").Value = Val(Text1.Text) Then MsgBox "ROOM ALREADY BOOKED" Text1.Text = "" Exit Sub
Exit Sub ElseIf KeyAscii >= 48 And KeyAscii <= 58 Then Exit Sub Else KeyAscii = 0 End If End Sub
Exit Sub ElseIf KeyAscii >= 48 And KeyAscii <= 58 Then Exit Sub Else
KeyAscii = 0 End If End Sub Private Sub Check1_Click() If Check1.Value = 1 Then TXT1.Text = "ADMINISTRATOR" TXT1.Enabled = False TXT2.SetFocus Else TXT1.BackColor = &H80000005 TXT1.Text = "" TXT1.Enabled = True End If End Sub
Private Sub Command3_Click() If TXT1.Text = "anubhav" And TXT2.Text = "welcome123" Then Unload Me INTRODUCTION.Show Else Unload Me intro2.Show End If
End Sub
Private Sub Command4_Click() On Error Resume Next Dim I As Integer I = MsgBox("Do you want to quit?", vbYesNo + vbQuestion, "HOTEL MESSAGE") If I = 6 Then End Else TXT1.Text = "" TXT2.Text = "" TXT1.SetFocus End If End Sub
Private Sub Form_Load() On Error Resume Next D1.DatabaseName = App.Path & "\" & "HMDATA1.MDB" End Sub
Private Sub Timer1_Timer() LBL3.Caption = Time End Sub Private Sub Combo1_Click() On Error Resume Next Dim TRY As Integer Dim I As Integer D2.RecordSource = "SELECT * FROM MENU3 WHERE TYPE=" & "'" & combo1.Text & "'" D2.Refresh Combo2.Clear Do While Not D2.Recordset.EOF For I = 0 To Combo2.ListCount - 1 If Combo2.List(I) = Trim(D2.Recordset.Fields("MAIN_ITEM").Value) Then FLAG = 1 Exit For Else FLAG = 0 End If Next If FLAG = 0 Then Combo2.AddItem Trim(D2.Recordset.Fields("MAIN_ITEM").Value) End If
Private Sub Combo2_Click() On Error Resume Next D2.RecordSource = "SELECT * FROM MENU3 WHERE MAIN_ITEM='" & Trim(Combo2.Text) & "'" D2.Refresh Combo3.Clear Do While Not D2.Recordset.EOF Combo3.AddItem (D2.Recordset.Fields(2).Value) D2.Recordset.MoveNext Loop End Sub
End Sub
End Sub
Private Sub RA_Click() Unload Me ROOMS.Show End Sub Private Sub Command1_Click() CHANGE_PASSWORD.Show
End Sub
End Sub
End Sub
End Sub
Private Sub CMDOK_Click() Dim PASS As String If Text1 = "" Then MsgBox "Enter valid Username", vbExclamation
Text1.SetFocus Else Data1.RecordSource = "SELECT * FROM LOGON WHERE NAME='" & Trim(Text1.Text) & "'" Data1.Refresh If Data1.Recordset.RecordCount = 0 Then If Text2.Text = "" Then MsgBox "Enter valid Password", vbExclamation
Text2.SetFocus Else
If Text2.Text = Text3.Text Then Data1.Recordset.AddNew Data1.Recordset.Fields("NAME") = Trim(Text1.Text) Data1.Recordset.Fields("PASSWORD") = Trim(Text2.Text) Data1.Recordset.Update MsgBox "User Created", vbInformation
Unload Me INTRODUCTION.Show Else MsgBox " Password and Retype Password must be same", vbExclamation
Private Sub DEEP_Load() Data1.DatabaseName = App.Path & "/" & "HMDATA1.MDB" Data1.RecordSource = "SELECT * FROM LOGON " Data1.Refresh End Sub
Private Sub Command1_Click() Dim PASS As String d1.RecordSource = "SELECT * FROM LOGON WHERE NAME='" & Trim(TXT1.Text) & "'" d1.Refresh If d1.Recordset.RecordCount = 0 Then MsgBox "User not found", vbExclamation TXT1.SetFocus TXT2.Text = "" TXT3.Text = "" TXT4.Text = "" Else If TXT2.Text = d1.Recordset.Fields("PASSWORD").Value Then If TXT3.Text = "" Then MsgBox "Enter a valid Password", vbExclamation
TXT3.SetFocus Else If TXT3.Text = TXT4.Text Then d1.Recordset.Edit d1.Recordset.Fields("PASSWORD").Value = TXT3.Text d1.Recordset.Update MsgBox "Password has been changed", vbInformation
Unload Me INTRODUCTION.Show Else MsgBox "Password does not match", vbExclamation TXT4.SetFocus End If End If Else MsgBox "Incorrect Password", vbExclamation TXT2.SetFocus End If End If
End Sub Private Sub Command2_Click() Unload Me INTRODUCTION.Show End Sub Private Sub Form_Load() d1.DatabaseName = App.Path & "/" & "HMDATA1.MDB" d1.RecordSource = "SELECT * FROM LOGON" d1.Refresh End Sub
Private Sub CAN_Click() Txt1.Text = "" Txt2.Text = "" Txt5.Text = "" Txt4.Text = "" Txt9.Text = "" Txt10.Text = "" Txt11.Text = "" Txt7.Text = "" Txt14.Text = "" Txt3.Text = "" Txt12.Text = ""
Private Sub Command2_Click() On Error Resume Next Data4.RecordSource = "SELECT * FROM HOTEL WHERE ROOMNO=" & "'" & Txt1.Text & "'" Data4.Refresh End Sub
Private Sub Command4_Click() On Error Resume Next D1.Recordset.AddNew D1.Recordset.Fields(0) = Trim(Txt1.Text) D1.Recordset.Fields(1) = Trim(Txt7.Text) D1.Recordset.Fields(2) = Trim(Txt2.Text) D1.Recordset.Fields(3) = Trim(Txt14.Text)
D1.Recordset.Fields(4) = Trim(Txt3.Text) D1.Recordset.Fields(5) = Trim(Txt5.Text) D1.Recordset.Fields(6) = Trim(Txt4.Text) D1.Recordset.Fields(8) = Trim(Txt11.Text) D1.Recordset.Fields(9) = Trim(Txt12.Text) D1.Recordset.Fields(10) = Trim(Txt10.Text) D1.Recordset.Fields(11) = Trim(Text6.Text) D1.Recordset.Fields(12) = Trim(Text8.Text) D1.Recordset.Update Txt1.Text = "" Txt2.Text = "" Txt3.Text = "" Txt4.Text = "" Txt5.Text = "" Txt14.Text = "" Txt9.Text = "" Txt7.Text = "" Txt2.Text = "" Txt11.Text = "" Txt12.Text = "" Txt10.Text = "" Text6.Text = "" Text8.Text = ""
End Sub
Private Sub Command5_Click() Txt1.Text = "" Txt2.Text = "" Txt5.Text = "" Txt4.Text = "" Txt9.Text = "" Txt10.Text = "" Txt11.Text = "" Txt7.Text = "" Txt14.Text = "" Txt3.Text = "" Txt12.Text = "" Text6.Text = "" Text8.Text = "" End Sub
Private Sub Command9_Click() On Error Resume Next Dim B As Integer B = Txt1.Text Data4.DatabaseName = App.Path & "\" & "HMDATA1.MDB" Data4.RecordSource = "SELECT * FROM HOTEL2 WHERE ROOM_NO=" & B Data4.Refresh Data4.Recordset.AddNew Data4.Recordset.Fields(4).Value = Txt11.Text Data4.Recordset.Fields(14).Value = Txt14.Text Data4.Recordset.Fields(6).Value = Txt10.Text Data4.Recordset.Fields(13).Value = Txt9.Text Data4.Recordset.Fields(9).Value = Txt7.Text Data4.Recordset.Fields(10).Value = Txt1.Text Data4.Recordset.Fields(16).Value = Txt4.Text Data4.Recordset.Fields(11).Value = Txt3.Text Data4.Recordset.Fields(0).Value = Txt2.Text Data4.RecordSource = "SELECT * FROM HOTEL WHERE ROOM_NO=" & B Data4.Refresh Data4.Recordset.Delete
Data4.Refresh End Sub Private Sub DET_Click() DETAIL_MEN.Show End Sub Private Sub EN_Click() INTRODUCTION.Show End Sub
Private Sub Form_Load() On Error Resume Next DATA1.DatabaseName = App.Path & "\" & "HMDATA1.MDB" DATA1.RecordSource = "HOTEL" D1.DatabaseName = App.Path & "\" & "HMDATA1.MDB" D1.RecordSource = "BILLGEN" End Sub Private Sub SAV_Click() Command4.Value = True End Sub Private Sub TOT_Click() Command6.Value = True End Sub
Private Sub TXT1_KeyPress(KeyAscii As Integer) If KeyAscii = 8 Or KeyAscii = 32 Then Exit Sub ElseIf KeyAscii >= 48 And KeyAscii <= 58 Then Exit Sub Else KeyAscii = 0 End If End Sub
Private Sub TXT1_LostFocus() On Error Resume Next Dim B As Integer B = Val(Txt1.Text) DATA1.RecordSource = "SELECT * FROM HOTEL WHERE ROOM_NO=" & B DATA1.Refresh If DATA1.Recordset.RecordCount <> 0 Then MsgBox "Record already Exists", vbInformation
Txt4.Text = DATA1.Recordset.Fields(16).Value Txt5.Text = DATA1.Recordset.Fields(10).Value Txt7.Text = DATA1.Recordset.Fields(9).Value Txt9.Text = DATA1.Recordset.Fields(13).Value Txt10.Text = DATA1.Recordset.Fields(6).Value Txt14.Text = DATA1.Recordset.Fields(14).Value Txt11.Text = DATA1.Recordset.Fields(4).Value Txt11.Text = DATA1.Recordset.Fields(3).Value End If End If DATA1.Recordset.Close Data2.RecordSource = "SELECT * FROM MENUBILLS WHERE ROOMNO=" & "'" & Txt1.Text & "'" Data2.Refresh If Data2.Recordset.RecordCount <> 0 Then Do While Not Data2.Recordset.EOF If Not IsNull(Data2.Recordset.Fields("PRICE").Value) = True And Data2.Recordset.Fields("ROOMNO").Value = Val(Txt1.Text) Then Text6.Text = Val(Text6.Text) + Data2.Recordset.Fields("PRICE").Value End If Data2.Recordset.MoveNext Loop End If
Data3.RecordSource = "SELECT * FROM BARBILLS WHERE ROOMNO=" & "'" & Txt1.Text & "'" Data3.Refresh If Data3.Recordset.RecordCount <> 0 Then Do While Not Data3.Recordset.EOF If Not IsNull(Data3.Recordset.Fields("PRICE").Value = True And Data3.Recordset.Fields("ROOMNO").Value = Val(Txt1.Text)) Then Text8.Text = Val(Text8.Text) + Data3.Recordset.Fields("PRICE").Value Txt12.Text = Val(Txt10.Text) - Val(Txt12.Text) Txt12.Text = (Val(Txt3.Text) * Val(Txt5.Text)) - Val(Txt10.Text) End If Data3.Recordset.MoveNext Loop End If 0 End Sub
Private Sub Txt12_Change() Txt12.Text = (Val(Txt3.Text) * Val(Txt5.Text)) - Val(Txt10.Text) + (Val(Text6.Text) + Val(Text8.Text)) End Sub
On Error Resume Next B = Txt1.Text DATA1.RecordSource = "SELECT * FROM HOTEL WHERE ROOM_NO=" & B DATA1.Refresh Txt3.Text = Val(DATA1.Recordset.Fields(11)) * Val(Txt5.Text) End Sub
Dim A As Currency Private Sub Combo1_Click() On Error Resume Next Dim A As Currency Combo2.Clear If Combo1.Text = "WHISKY" Then D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & "WHISKY" & "'" D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop ElseIf Combo1.Text = "RUM" Then D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & "RUM" & "'"
D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop ElseIf Combo1.Text = "BARANDY" Then D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & "BARANDY" & "'" D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop ElseIf Combo1.Text = "BEER" Then D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & "BEER" & "'" D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop ElseIf Combo1.Text = "SHAMPION" Then
D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & "SHAMPION" & "'" D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop ElseIf Combo1.Text = "SOFT DRINKS" Then D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM=" & "'" & Combo1.Text & "'" D2.Refresh Do While Not D2.Recordset.EOF Combo2.AddItem D2.Recordset.Fields(1).Value D2.Recordset.MoveNext Loop End If End Sub Private Sub Combo2_Click() On Error Resume Next Dim A As Currency D2.RecordSource = "SELECT * FROM BAR1 WHERE MAIN_ITEM='" & Combo1.Text & "'" D2.Recordset.MoveFirst
D2.Refresh A = D2.Recordset.Fields("PRICE").Value List3.AddItem D2.Recordset.Fields("MEASURMENT").Value List1.AddItem Combo2.Text List2.AddItem A TXT4.Text = Val(TXT4.Text) + A End Sub
Private Sub Combo3_Click() On Error Resume Next Dim A As Currency D2.RecordSource = "SELECT * FROM BAR1 WHERE ITEM='" & Trim(Combo3.Text) & "'" D2.Refresh A = D2.Recordset.Fields("PRICE").Value List3.AddItem D2.Recordset.Fields("MEASURMENT").Value List1.AddItem Combo3.Text List2.AddItem A Text2.Text = Val(Text2.Text) + A End Sub
Dim A As Currency D2.RecordSource = "SELECT * FROM BAR1 WHERE ITEM='" & Trim(Combo4.Text) & "'" D2.Refresh A = D2.Recordset.Fields("PRICE").Value List3.AddItem D2.Recordset.Fields("MEASURMENT").Value List1.AddItem Combo4.Text List2.AddItem A Text2.Text = Val(Text2.Text) + A End Sub
Private Sub Combo5_Click() On Error Resume Next Dim A As Currency D2.RecordSource = "SELECT * FROM BAR1 WHERE ITEM='" & Trim(Combo5.Text) & "'" D2.Refresh A = D2.Recordset.Fields("PRICE").Value List3.AddItem D2.Recordset.Fields("MEASURMENT").Value List1.AddItem Combo5.Text List2.AddItem A Text2.Text = Val(Text2.Text) + A End Sub
Private Sub Combo6_Click() On Error Resume Next Dim A As Currency D2.RecordSource = "SELECT * FROM BAR1 WHERE ITEM='" & Trim(Combo6.Text) & "'" D2.Refresh A = D2.Recordset.Fields("PRICE").Value List3.AddItem D2.Recordset.Fields("MEASURMENT").Value List1.AddItem Combo6.Text List2.AddItem A Text2.Text = Val(Text2.Text) + A End Sub
Private Sub Command1_Click() On Error Resume Next D3.Recordset.AddNew D3.Recordset.Fields(0) = Text1.Text D3.Recordset.Fields(1) = TEXT3.Text D3.Recordset.Fields(2) = Combo1.Text D3.Recordset.Fields(3) = List1.Text D3.Recordset.Fields(4) = TXT4.Text For I = 0 To List1.ListCount - 1
Next D3.Recordset.Update Text1.Text = "" TEXT3.Text = "" Combo1.Clear Combo2.Clear List1.Clear List2.Clear List3.Clear End Sub
Private Sub Command2_Click() Unload Me INTRODUCTION.Show End Sub Private Sub EN_Click() INTRODUCTION.Show End Sub Private Sub Form_Activate() On Error Resume Next D2.RecordSource = "SELECT DISTINCT MAIN_ITEM FROM BAR1" D2.Refresh Do While Not D2.Recordset.EOF = True
If Not IsNull(D2.Recordset.Fields("MAIN_ITEM").Value) = True Then Combo1.AddItem D2.Recordset.Fields("MAIN_ITEM").Value End If D2.Recordset.MoveNext Loop Text1.Text = Date End Sub
Private Sub Form_Load() On Error Resume Next SAV.Enabled = False D3.DatabaseName = App.Path & "/" & "HMDATA1.MDB" D3.RecordSource = "SELECT * FROM BARBILLS" D2.DatabaseName = App.Path & "/" & "HMDATA1.MDB" Exit Sub Text1.Text = Date End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer) If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 32 Or KeyAscii = 8 Then Exit Sub Else KeyAscii = 0
FORMS
LIMITATIONS
This project should not be run online Due to lack of resources this project should not be full fleged
CONCLUSION
After the completion of project can say that the project is repaying back the countless hour of my effort. After running the whole project and performing all the testing and debugging method this project is fulfilling the requirement of the client. This project also having the scope of future enhancement. At last one again to specify it very clearly that the project is fulfilling the requirement of the client.
BIBLIOGRAPHY
ADVANCED VISUAL BASIC By Black. VISUAL BASIC FOR WINDOWS 95 BYGary Cornall & Tata Macgraww.hill. PROGRAMMING IN VISUAL BASIC 6.0 By Jullia case Bradley,