A Minor Project Project Report Report Submitted to to WEST BENGAL UNIVERSITY OF TECHNOLOGY
By ABDUL GHULAM GHULAM MUSTAF MUSTAFA A ROLL NO: 08105010041 REG. NO: 081050510001 of 2008 -2009,
In partial fulfilment for the award of the degree of MASTER COMPUTER APPLICATION
BANKURA UNNYANI INSTITUTE OF ENGINEERING Poabagan, Bank ura
Table of Contents CERTIFICATE BY GUIDE
4
ACKNOWLEDGEMENT ACKNOWLEDGEMEN T
5
INTRODUCTION
6
................................................................................................................................ 6 PROJECT OVERVIEW ................................................................................................................................ OBJECTIVE .................................................................................................................................................. 8 SCOPE............................................................................................................................................................ 9 THREAT .......................................................................................................................................................10
................................................................................................................................... ...................................................................................11 ................11 SOLUTION ................................................................ PROJECT CATEGORY ...............................................................................................................................12 HOSTING REQUIREMENT ......................................................................................................................13
SOFTWARE SOLUTION
15
.................................................................................................................................15 FEASIBILITY STUDY .................................................................................................................................15 Technical feasibility
15
Operational feasibility
16
Economic feasibility
16
SYSTEM REQUIREMENT & SPECIFICATION ......................................................................................17
Functional Requirements
18
Technical Requirements:
19
Non-Functional Requirements:
19
Design Goals and Constraints
20
................................................................................................................................... .......................................................................21 .....21 SYSTEM DESIGN................................................................. Use Case
22
Data Flow Diagram
23
Sequence Diagram
25
E-R Diagram
27
Data Model
28
IMPLEMENTAION TECHNOLOGIES.....................................................................................................29 USER INTERFACE USER INTERFACE SCREENSHOT .......................................................... ..........................................................................................................32 ................................................32 CODING(VB.NET) ......................................................................................................................................33
SCOPE OF FUTURE APPLICATION
42
SCOPE OF IMPROVEMENT IMPROVEMENT
42
REFERENCES
43
Table of Contents CERTIFICATE BY GUIDE
4
ACKNOWLEDGEMENT ACKNOWLEDGEMEN T
5
INTRODUCTION
6
................................................................................................................................ 6 PROJECT OVERVIEW ................................................................................................................................ OBJECTIVE .................................................................................................................................................. 8 SCOPE............................................................................................................................................................ 9 THREAT .......................................................................................................................................................10
................................................................................................................................... ...................................................................................11 ................11 SOLUTION ................................................................ PROJECT CATEGORY ...............................................................................................................................12 HOSTING REQUIREMENT ......................................................................................................................13
SOFTWARE SOLUTION
15
.................................................................................................................................15 FEASIBILITY STUDY .................................................................................................................................15 Technical feasibility
15
Operational feasibility
16
Economic feasibility
16
SYSTEM REQUIREMENT & SPECIFICATION ......................................................................................17
Functional Requirements
18
Technical Requirements:
19
Non-Functional Requirements:
19
Design Goals and Constraints
20
................................................................................................................................... .......................................................................21 .....21 SYSTEM DESIGN................................................................. Use Case
22
Data Flow Diagram
23
Sequence Diagram
25
E-R Diagram
27
Data Model
28
IMPLEMENTAION TECHNOLOGIES.....................................................................................................29 USER INTERFACE USER INTERFACE SCREENSHOT .......................................................... ..........................................................................................................32 ................................................32 CODING(VB.NET) ......................................................................................................................................33
SCOPE OF FUTURE APPLICATION
42
SCOPE OF IMPROVEMENT IMPROVEMENT
42
REFERENCES
43
3
CERTIFICATE BY GUIDE This to certify that the report of the project submitted is the outcome of the project work entitled “HOTEL RESERVATION SYSTEM” SYSTEM ” carried out by ABDUL GHULAM MUSTAFA & SOUMEN DAS under my guidance and supervision for the award of Degree in Master of Computer Application of Application of West Bengal University of Technology (W.B.), India. To the best of the my knowledge the report Embodies the work work of the candidate him/herself, him/herself, Has duly been completed, completed, Fulfils the requirement requirement of the ordinance relating to the MCA degree of the University and Is up to the desired standard standard for the purpose purpose of which is submitted.
Signature Mr Subhabrata Rakshit
The project work as mentioned above is hereby being recommended and forwarded for examination and evaluation.
4
ACKNOWLEDGEMENT Completing a task is never one man’s effort. It needs help of numbers of persons in direct or indirect ways. I wish to express my gratitude to DPL Reservation and also to Mr . Subhabrata Rakshit, to grant me permission to do same project. My sincere thanks to all the faculty members of my institute for providing me their valuable supports and cooperation that was necessary to carry out the work.
Finally I would like to express my deepest gratitude and reverence to my parents and friends for their steady encouragements throughout the progress of this work.
ABDUL GHULAM MUSTAFA SOUMEN DAS MCA, 5Th Sem
5
INTRODUCTION
PROJECT OVERVIEW
In this case, we will be designing a simple online e-commerce Bicycle Store. The site will provide a soothing shopping experience for customers. The system will allow more than one Categories and different items to choose and can be added in cart. The case will trace the following sequence. A customer visits the online e-commerce Bicycle Store. A customer may buy item or just visit the page and logout. The customer can select a category, and items to get the different products in the desired category. The customer can select the product for purchasing. The process can be repeated for more items. Once the customer finishes selecting the product/s the cart can be viewed , If the customer wants to edit the final cart it can be done here. For final payment the customer has to login the website, if the customer is visiting for the first time he must register with the site, else the customer must use the login page to proceed. Final cart is submitted for payment and card details and address (where shipment has to be made) are be confirmed by the customer .Customer is confirmed with a shipment Id and delivery of goods within 15 days.
PAYPAL SHOPPING CART PayPal Shopping Cart has been integrated in Bicycle store website, customers can purchase multiple items with a single payment, browse your entire selection, and view a consolidated list of all their items before purchasing. The PayPal Shopping Cart is a low-cost way for you to accept credit card and bank account payments, and can be fully integrated with your website in a few easy steps. What are the benefits? Save time and money with PayPal's hassle-free Shopping Cart: Easy to implement - no CGI scripting necessary No up-front costs - you'll enjoy the same low fee schedule used when you receive other PayPal payments Sell with ease - PayPal maintains detailed transaction records on our website
6
Improve buyer experience - with customizable buttons and secure payments, happy customers become repeat customers
The limited time and resources have restricted us to incorporate, in this project, only a main activities that are performed in a Bicycle Store web application, but utmost care has been taken to make the system efficient and user friendly navigation. This web application has been designed to support the full featured e-commerce solution through which the following functions are performed:
Register to the Site. Log in to Check Out. Browse/Search through Product catalog. Filter the product as per need like Color, Weight etc. Change/Recover the Password. Multiple items can be added in Shopping Cart. View the Recent & Related product individually by the customer. Check-out customer with PayPal account. Bill Print after successful payment. E-mail acknowledgment after payment made for product. Only Admin can Add/Remove/Update product related items. Individual customer Report
7
OBJECTIVE Ecommerce and online stores go hand in hand. If you want to sell your products and services online, it’s important that you have the necessary elements in place that will help a visitor buy your products and services. This can only happen if you integrate shopping cart solutions in your E-commerce site.
Customized Shopping Cart Development The needs and requirements of every business are unique. Businesses might belong to the same domain, but the way they will be going about achieving their goals will be different. At Bicycle Store, we focus on custom shopping cart design, and our objective is to deliver outof-the-box solutions. We bring together all the ecommerce elements in one single package to ensure an improvement in customer conversion rates, sales growth and an enhanced interaction between customers, business partners and suppliers.
Spotlight is on Customer Orientation Providing customer oriented solutions lie at the very heart of any and every ecommerce application development including ecommerce shopping cart development. Bicycle Store is home to individuals who have superior online store development and management expertise. Their primary goal is to gather a complete understanding of the client requirements and deliver solutions with strong revenue generation potential. Our proficiency in shopping cart development is an integral part of our e-store design services and the wide scope of our services helps us give due importance to the various factors that contribute to the growth and development of an online business.
8
SCOPE Companies involved in e-commerce as ether buyer s or sellers rely on Internet based technologies, and E-commerce applications and service to accomplish marketing, discovery, transaction, processing, and product and customer services processing. For example, electronic commerce can include interactive, marketing, ordering, payment and customer support process at E-commerce catalog and auction site on the World Wide Web, extranet access of inventory databases by customers and suppliers, intranet access of customer relationship management systems by sales and customer collaboration in product development via E-mail and internet newsgroup. Many companies today are participating in or sponsoring three basic categories of electronic commerce applications, business-to-consumer, business-to-business and consumer-to-consumer E-commerce. However, many E-commerce concepts apply to such applications. Business to Consumer or B2C In this form electronic commerce, business must develop attractive electronic marketplaces to entice and sell product and services to consumer. For example, many companies offer Ecommerce websites that provide virtual storefronts and multimedia catalogs, interactive order processing, secure electronic payment system, and online customer support.
9
THREAT
eCommerce has forever revolutionized the way business is done. Retail has now a long way from the days of physical transactions that were time consuming and prone to errors. However, eCommerce has unavoidably invited its share of trouble makers. As much as eCommerce simplifies transactions, it is occasionally plagued by serious concerns that jeopardize its security as a medium of exchanging money and information. Major threats to present day eCommerce include BREACH OF SECURITY: Money Thefts eCommerce services are about transactions, and transactions are very largely driven by money. This attracts hackers, crackers and everyone with the knowledge of exploiting loopholes in a system. Once a kink in the armor is discovered, they feed the system(and users) with numerous bits of dubious information to extract confidential data(phishing). This is particularly dangerous as the data extracted may be that of credit card numbers, security passwords, transaction details etc. Also, Payment gateways are vulnerable to interception by unethical users. Cleverly crafted strategies can sift a part or the entire amount being transferred from the user to the online vendor. Identity thefts Hackers often gain access to sensitive information like user accounts, user details, addresses, confidential personal information etc. It is a significant threat in view of the privileges one can avail with a false identity. For instance, one can effortlessly login to an online shopping mart under a stolen identity and make purchases worth thousands of dollars. He/she can then have the order delivered to an address other than the one listed on the records. One can easily see how those orders could be received by the impostor without arousing suspicion. While the fraudsters gains, the original account holder continues to pay the price until the offender is nabbed. Threats to the system Viruses, worms, Trojans are very deceptive methods of stealing information. Unless a sound virus-protection strategy is used by the eCommere Solutions firm, these malicious
10
agents can compromise the credibility of all eCommerce web solution services. Often planted by individuals for reasons known best to them alone, viruses breed within the systems and multiply at astonishing speeds. Unchecked, they can potentially cripple the entire system. SOLUTION There is but one solution to all issues that at times dent the security of eCommerce services. Strict vigil on malicious intruders. Easier said than done? So is every preventive measure. However, with online transactions, progress in security has been overwhelming. Authentication Most notable are the advances in identification and elimination of non-genuine users. Ecommerce service designers now use multi-level identification protocols like security questions, encrypted passwords(Encryption), biometrics and others to confirm the identity of their customers. These steps have found wide favor all around due to their effectiveness in weeding out unwelcome access. Intrusion Check The issue of tackling viruses and their like has also seen rapid development with anti-virus vendors releasing strong anti-viruses. These are developed by expert programmers who are a notch above the hackers and crackers themselves. Firewalls are another common way of implementing security measures. These programs restrict access to and from the system to pre-checked users/access points. Educating Users eCommerce is run primarily by users. Thus, eCommerce service providers have also turned to educating users about safe practices that make the entire operation trouble free. Recent issues like phishing have been tackled to a good extent by informing genuine users of the perils of publishing their confidential information to unauthorized information seekers.
11
PROJECT CATEGORY
This Project is coupled with material on how to use the various tool, sub sets available in IDE Database GUI 3rd Party Web Server Client Side Server Side
: : : : : :
Visual Studio 2010 MS SQL SERVER Component One Custom Control for ASP.NET. IIS 6.0/7.0 HTML, Ajax, CSS, JavaScript, jQuery, XML Asp.net C#.
The app uses Entity Framework, Linq, AJAX, jQuery, CSS, and so much more. This is a full blown reference web application for the fictitious Bicycle Store.
12
HOSTING REQUIREMENT
.
Hardware requirements
Processor
Minimum
1 GHz
Recommended
1 GHz
RAM
Minimum
128 MB
Recommended
256 MB
Disk space (minimum)
Mirrored/RAID disk sub-system 10 GB
Duplex Ethernet adapters
100Mbit
Software Requirements Operating System Web Server Database
: : :
Windows 2000 or higher. IIS 6.0 or Higher. SQL Server 7 or higher
Additional Software Requirements
Firewall & Good Antivirus Solution. .Net 3.5 or higher. Latest service pack .
Servers should backed up nightly and there should be a number of hot-standby servers (and components) in the event of a systems failure.
Bandwidth In working out our hosting costs, Home page calculates the amount of bandwidth that your site will need, based on the number of visits you require it to cope with. For example, a site expecting 500,000 hits per month equates to a bandwidth requirement of an average of 158Kbit/s. This is based on:
Average 50K page size 30 days per month Traffic spread evenly over 12 hours
13
14
SOFTWARE SOLUTION
FEASIBILITY STUDY Feasibility study conducted once the problem is clearly understood. Feasibility study is a high level capsule version of the entire system-analysis and design process. The objective is to determine quickly and at the minimum expense how to solve the problem and to determine the problem is solved. The system has been tested for feasibility in the following ways.
Technical feasibility Operational feasibility Economic feasibility
Technical feasibility A study of function, performance and constraints may affect the ability to achieve an acceptable system so, that necessary function and performance are achieved within the constraints uncovered during system analysis. This is a Product based e-commerce website which include Product catalog, Shopping Cart, PayPal Payment and Administrative Page. MS SQL Server is used as backend considering the Three Tier Architecture. When building the web site, implementing a flexible architecture composed of pluggable components allows you to add new features—such as the shopping cart, the departments list, or the product search feature— by coding them as separate components and plugging them into the existing application. Achieving a good level of flexibility is one of the goals regarding the application’s architecture. You’ll see that the level of flexibility is proportional to the amount of time required to design and implement it, so we’ll try to find a compromise that provides the best gains without complicating the code too much., so the project is technically feasible.
15
Operational feasibility The purpose of this project is to develop a Full Featured E Commerce Solution which facilitates Product Browsing, Adding/Removing items in Shopping Cart and Provide the easy way to payment such as PayPal from anywhere in the world. The activities of the system such as Add/Remove Product by Administrator, information retrieval, updating and deletion of records from various tables etc. are made easy. All the operators of this website are trained in this area. So this project is operational feasible.
Economic feasibility Economic analysis includes a broad range of concerns that include cost benefit analysis, long term cooperative income strategies, cost of resources needed for development .In existing they had to maintain a large number of Products/registers is a costly affair. This can be avoided by putting the data in the computer format that is cheaper and reliable such as SQL Express which is free to use in Production environment. Since the cost of resources for development of system satisfies the organization, the software is economically feasible.
16
SYSTEM REQUIREMENT & SPECIFICATION The Software Requirements Specification (SRS) will provide a detailed description Of the requirements for the Bicycle Store (BS). This SRS will allow for a complete understanding of what is to be expected of the BS to be constructed.
USER STORIES Story 1. A customer connects to the e-commerce front-end looking for a product: 1. 2. 3. 4.
The customer starts at the e-commerce front-end main page. The customer searches in the products catalog for a specific product. The customer gets information about the product. The customer decides if she wants to proceed with an order.
Story 2. A customer connects to the e-commerce front-end for browsing the products catalog: 1. 2. 3. 4.
The customer starts at the e-commerce front-end main page. The customer browser hierarchically the products catalog. The customer gets information about the product. The customer decides if she wants to proceed with an order.
Story 3. A customer places successfully an order into the system: 1. 2. 3. 4.
The customer registers or logins into the system. The customer places an order within the system. Completes the order successfully. Decides if she wants an invoice send by mail or shown to her.
Story 4. A customer tracks the status of her orders: 1. 2. 3. 4. 5. 6.
The customer logins into the system. The customer can change /recover his password. Browses her recent list of visited items. Browses her related list of items. Selects the order for which wants more detail and its status. Detail of the order is shown.
17
Functional Requirements
User roles & profiles
The system administrator. The person that installs & configure IIS, SQL Express for website up & running. Additionally, this person also Maintain, Backup, Restore the Database. The customer. The person that connects to the on-line e-commerce front-end and browses the product catalog or places an order and pay the bill through PayPal. The sales manager. The person is the company that looks after the sales orders and ensures that all the sales operations work correctly.
Business process definition
Search the product catalog. Browse the product catalog. Making an order using an on-line front-end. Generate an invoice for an order that has been completed. Pay through PayPal.
Customer management It's a common scenario that a new user registers using the e-commerce front-end to be able to perform a commercial transaction later. It should be possible to:
Check if a customer already exists in System. Create new customers in System. Modify the information of a customer in Website system.
Product catalog A product catalog contains all the products that a user can view. General considerations:
This website supports multiple items for the product. All the information about the products in the catalog is stored in SQL Server database.
It should be possible for a user to perform the following actions:
Browse the product catalog hierarchically by product category. Search the product catalog. Get all the details of a product.
Every product object can contain at least the following details:
18
Product name. Product description. Product category. Product attributes (weight, color, size, etc.). Product price and tax.
It should be possible for users to query product's inventory availability. This can be displayed when the user is viewing the product information. Sales order It should be possible for a user to:
Perform a full sales order. Get a list of the products that has bought. Track the status of his orders pending to be send. Give details of Shipping method and shipping Address
Invoicing It should be possible for the e-commerce system:
Get access to the full invoice object to render an invoice by itself. Get a PDF version of an invoice using the default server report.
User Interface Mockups
Technical Requirements: Web services allows applications to be integrated more rapidly and easily. Integration focuses on the XML messages that define the services rather than the protocol used to relay these messages. These characteristics are ideal for connecting business functions across heterogeneous systems. The integration requirements are:
The e-commerce system makes calls to the web server whenever it requires a synchronization. The definition of these web services should not change from version to version to guarantee the integration with different web server versions.
Non-Functional Requirements: These are general requirements that impact in the technical decisions:
The final system should scale correctly to support high traffic loads. Security is a key area since we are performing commercial translations and dealing with confidential data.
Open Discussion Items
19
Which e-commerce platform is better to do the example integration?
Design Goals and Constraints Performance No more than a 5-percent degradation in average page response is allowed with each 100 concurrent users that are added to the system. Processor utilization should not exceed 80 percent during spikes of 1000 concurrent users.
Availability Because the Web site is accessed by customers across the world, it needs to be available 24 hours a day, 7 days a week.
Reliability Because of the need for 24 x 7 availability, automatic failover will be required. In addition, existing disaster recovery and backup plans and procedures must be revised to incorporate the e-commerce Application.
Scalability E-commerce Application anticipates an average load of 500 concurrent users after the system is fully operational, and expects that to grow by 5 percent each year for the next five years.
Security For the Web Site Enhancement project, customers will need to log on securely, and sensitive information will be encrypted by using SSL. For the Sales Force Automation project, no data encryption is required. Sales staff will need to log on, and their user names will be used to determine access to different parts of the system.
20
SYSTEM DESIGN Based on the requirements and specifications, the system design was carried out to give detailed description of input screens, output screens, and table descriptions. The system has been designed to provide easy browsing through different product category and shopping cart .Data can be entered in the form of database tables. Payment Bill are also generated. The system has been designed to reduce workload inconsistencies, redundancy of data and also to improve transparency.
21
Use Case Use cases have their beginnings in software engineering, where they were used to visually or textually describe a system's behavior as it responds to queries, input, or other actions from external systems or "actors." But marketers have adopted use cases to provide descriptions of how users will perform specific tasks on a website. In the case of ecommerce, we know that customers are generally going to be researching products or services, searching for products or services, or ready to purchase products or services when they visit our site. But developing use cases can help us clearly understand how these interactions take place and may help us streamline the experience for our customers.
There are two Actor: 1. Customer 2. Admin
Use Case 1-Bicycle Store
22
Data Flow Diagram A data flow diagram (DFD) is a graphical representation of the "flow" of data through an information system. DFDs can also be used for the visualization of data processing (structured design).
DFD: 1-Context Level diagram
DFD: 2-Register
23
DFD: 3-Login
DFD: 4-Add Item to Cart
DFD: 5-Add/Remove item in Product Table
DFD: 6-Payment Info
24
Sequence Diagram UML sequence diagrams are used to represent or model the flow of messages, events and actions between the objects or components of a system.
Sequence Diagram 1-View Catalog
25
Sequence Diagram 2-Create Order
26
E-R Diagram Entity relationship diagramming is a technique that is widely used in the world of business and information technology to show how information is, or should be, stored and used within a business system.
ER Diagram 1-Bicycle Store
27
Data Model Data modeling defines primary data objects, composition of each data object, and attributes of the object, relationships between each object and other objects and between objects and the processes.
Data Model 1-Bicycle Store
28
IMPLEMENTAION TECHNOLOGIES
Introducing ASP.NET ASP.NET was developed in direct response to the p roblems that developers had with classic ASP. Since ASP is in such wide use, however, Microsoft ensured that ASP scripts execute without modification on a machine with the .NET Framework (the ASP engine, ASP.DLL, is not modified when installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET scripts on the same machine.
Advantages of ASP.NET 1.
Separation of Code from HTML To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently. This makes it much easier for t eams of programmers and designers to collaborate efficiently.
2. Support for compiled languages developer can use VB.NET and access features such as strong typing and object -oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes. 3. Use services provided by the .NET Framework The .NET Framework provides class libraries that can be used by your applic ation. Some of the key classes help you with input/output, access t o operating system services, data access, or even debugging. We will go into more detail on some of them in t his module. 4. Graphical Development Environment Visual Studio .NET provides a very rich development environment for Web developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML. 5.
State management To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management. State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down.
6. Update files while the server is running! Components of your application can be updated while the server is online and clients are
29
connected. The Framework will use the new files as soon as they ar e copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished. 7.
XML-Based Configuration Files Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application.
ASP.NET Overview Here are some point that gives the quick overview of ASP.NET.
ASP.NET provides services to allow the creation, deployment, and execution of Web Applications and Web Services Like ASP, ASP.NET is a server-side technology Web Applications are built using Web Forms. ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user interface. They mirror typical HTML widgets like text boxes or buttons. If these controls do not fit your needs, you are free to create your own user controls. Web Forms are designed to make building web-based applications as easy as building Visual Basic applications
ASP.NET 3.5 Architecture ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio provide a uniform way to combine the various features of this Architecture.
30
LINQ Language-Integrated Query (LINQ) is a set of features introduced in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic. LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. Visual Studio includes LINQ provider assemblies that enable the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML documents.
ADO.NET ENTITY FRAMEWORK ADO.NET Entity Framework abstracts the relational (logical) schema of the data that is stored in a database and presents its conceptual schema to the application. For example, in the database, entries about a customer and their information can be stored in the Customerstable, their orders in theOrders table and their contact information in yet another Contactstable. For an application to deal with this database, it has to know which information is in which table, i.e., the relational schema of the data is hardcoded into the application.
31
USER INTERFACE SCREENSHOT
1Report Screen
2 Login Screen
3Visual Report
Home Screen
5 Hotel Profile Screen
6Check in Screen
32
CODING(VB.NET) A coding standard is a set of guidelines, rules and regulations on how to write code. Usually a coding standard includes guide lines on how to name variables, how to indent the code, how to place parenthesis and keywords etc. The idea is to be consistent in programming so that, in case of multiple people working on the same code, it becomes easier for one to understand what others have done.
Public Class CheckIn Dim daRoomFlag As New DBDataSetTableAdapters. RoomflagTableAdapter Dim daCus As New DBDataSetTableAdapters.TblCustomerTableAdapter Dim NewCheckinRow As DBDataSet .TblCheckInRow Dim daCheckIn As New DBDataSetTableAdapters.TblCheckInTableAdapter Private Sub TblCustomerBindingNavigatorSaveItem_Click( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles TblCustomerBindingNavigatorSaveItem.Click Me.Validate() Me.TblCustomerBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll( Me.DBDataSet) End Sub Private Sub CheckIn_Load( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles MyBase.Load 'TODO: This line of code loads data into the 'DBDataSet.hotelname' table. You can move, or remove it, as needed.
33
' ClearText() Me.HotelnameTableAdapter.Fill( Me.DBDataSet.hotelname) 'TODO: This line of code loads data into the 'DBDataSet1.tblPrice' table. You can move, or remove it, as needed. Me.TblPriceTableAdapter.Fill( Me.DBDataSet1.tblPrice) 'TODO: This line of code loads data into the 'DBDataSet1.tblPrice' table. You can move, or remove it, as needed. Me.TblPriceTableAdapter.Fill( Me.DBDataSeRoomInfo.tblPrice) CheckInDateDateTimePicker.Value = Date.Now Me.DataTableRoomNoComboTableAdapter.FillRoomNoCombo( Me.DBDataSet.DataTabl eRoomNoCombo, ComboBoxRoomType.Text) 'TODO: This line of code loads data into the 'DBDataSet.TblCheckIn' table. You can move, or remove it, as needed. 'Me.TblCheckInTableAdapter.Fill(Me.DBDataSet.TblCheckIn) 'TODO: This line of code loads data into the 'DBDataSet.TblCustomer' table. You can move, or remove it, as needed. Me.TblCustomerTableAdapter.Fill( Me.DBDataSet.TblCustomer) TblCustomerBindingNavigator.AddNewItem.PerformClick() End Sub Sub TextBoxNotEmpty( ByVal txbox As TextBox ) Dim msg As String = "" If txbox.Text.Trim.Length = 0 Then msg = My.Settings.NotEmptyTextBox Me.ErrorProvider1.SetError(txbox, msg) End Sub Sub TextBoxIsNumeric( ByVal txbox As TextBox ) Dim msg As String = "" If Not IsNumeric(txbox.Text) Then msg = My.Settings.MustBeNumber Me.ErrorProvider1.SetError(txbox, msg) End Sub Private Sub GroupBox4_Enter( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles GroupBox4.Enter End Sub Private Sub Label1_Click( ByVal System. EventArgs )
sender
As
System.Object ,
ByVal
e
As
Private Sub Button2_Click( ByVal sender As System.Object , ByVal e System. EventArgs ) Me.Close() End Sub Private Sub setflag()
As
End Sub
daRoomFlag.Update( "True" , RoomNoComboBox.SelectedValue)
34
End Sub Private Sub Button1_Click( ByVal sender As System.Object , System. EventArgs ) 'TblCustomerBindingNavigatorSaveItem.PerformClick() End Sub
ByVal e
Private Sub CheckInDateDateTimePicker_ValueChanged( ByVal System.Object , ByVal e As System. EventArgs ) CheckInDateDateTimePicker.ValueChanged
As
sender As Handles
End Sub Private Sub CheckOutDateDateTimePicker_ValueChanged( ByVal System.Object , ByVal e As System. EventArgs ) CheckOutDateDateTimePicker.ValueChanged
sender As Handles
End Sub Private Sub No_of_NightTextBox_GotFocus( ByVal sender As Object , ByVal e As System. EventArgs ) Handles No_of_NightTextBox.GotFocus End Sub Private Sub No_of_NightTextBox_KeyPress( ByVal sender As Object , ByVal e As System.Windows.Forms. KeyPressEventArgs ) Handles No_of_NightTextBox.KeyPress If Not ( Char.IsNumber(e.KeyChar) Or e.KeyChar = vbBack) Then e.Handled = True End If End Sub Private Sub No_of_NightTextBox_KeyUp( ByVal sender As Object , ByVal e As System.Windows.Forms. KeyEventArgs ) Handles No_of_NightTextBox.KeyUp End Sub Private Sub No_of_NightTextBox_LostFocus( ByVal sender As Object , ByVal e As System. EventArgs ) Handles No_of_NightTextBox.LostFocus ' CalcDue() End Sub Private Sub No_of_NightTextBox_MouseEnter( ByVal sender As Object , ByVal e As System. EventArgs ) Handles No_of_NightTextBox.MouseEnter No_of_NightTextBox.SelectAll() End Sub Private Sub No_of_NightTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles No_of_NightTextBox.TextChanged
35
CalcTotal() If String.IsNullOrEmpty(No_of_NightTextBox.Text) Then AdvanceTextBox.Enabled = False Else CalcDue() End If calcCheckout()
End Sub Private Sub FillToolStripButton_Click( ByVal sender As System.Object , ByVal e As System. EventArgs ) End Sub Private Sub FillToolStrip_ItemClicked( ByVal sender As System.Object , ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs ) End Sub Private Sub calcCheckout() If No_of_NightTextBox.Text > "" Then CheckOutDateDateTimePicker.Value = CheckInDateDateTimePicker.Value.AddDays( CType(No_of_NightTextBox.Text, Double )) Else CheckOutDateDateTimePicker.Value = Now End If End Sub Private Sub AdvanceTextBox_KeyPress( ByVal sender As Object , ByVal e As System.Windows.Forms. KeyPressEventArgs ) Handles AdvanceTextBox.KeyPress If Not ( Char.IsNumber(e.KeyChar) Or e.KeyChar = vbBack) Then e.Handled = True End If End Sub Private Sub AdvanceTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles AdvanceTextBox.TextChanged CalcDue() End Sub Private Sub CalcTotal()
36
If No_of_NightTextBox.Text > "" Then Dim SubTotal As Double = (No_of_NightTextBox.Text * UnitPriceTextBox.Text) TotalTextBox.Text = SubTotal - (SubTotal) * DiscountTextBox.Text / 100 Else TotalTextBox.Text = "" End If End Sub Private Sub CalcDue() Try If AdvanceTextBox.Text > "" Then AdvanceTextBox.Enabled = True DueTextBox.Text = TotalTextBox.Text - AdvanceTextBox.Text Else AdvanceTextBox.Enabled = True DueTextBox.Text = TotalTextBox.Text End If Catch ex As Exception MessageBox .Show( "Enter No Night To Stay" ) End Try End Sub Private Sub Button3_Click( ByVal sender As System.Object , ByVal e System. EventArgs ) TblCustomerBindingNavigator.AddNewItem.PerformClick() End Sub
As
Private Sub UnitPriceTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles UnitPriceTextBox.TextChanged CalcTotal() End Sub Private Sub ComboBoxRoomType_SelectedValueChanged( ByVal sender As Object , ByVal e As System. EventArgs ) Handles ComboBoxRoomType.SelectedValueChanged Me.RoomInfoTableAdapter.Fill( Me.DBDataSeRoomInfo.RoomInfo, ComboBoxRoomType.Text) End Sub Private Sub DiscountTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles DiscountTextBox.TextChanged End Sub Private Sub TotalTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles TotalTextBox.TextChanged CalcDue() End Sub Private Sub SaveCustomer() 37
daCus.Insert(CusNameTextBox.Text, ComboBoxGender.SelectedItem, AgeTextBox.Text, CardNoTextBox.Text, Mobile_NoTextBox.Text, AddressTextBox.Text, CityTextBox.Text, StateTextBox.Text, CountryTextBox.Text) End Sub Private Sub SaveCheckIn() daCheckIn.Insert(CusIDTextBox.Text, CheckInDateDateTimePicker.Value, CheckOutDateDateTimePicker.Value, No_of_NightTextBox.Text, ComboBoxRoomType.Text, RoomNoComboBox.Text, FloorTextBox.Text, UnitPriceTextBox.Text, DiscountTextBox.Text, TotalTextBox.Text, AdvanceTextBox.Text, DueTextBox.Text)
CusNameTextBox.Text,
End Sub Private Sub advpaid() If AdvanceTextBox.Text > "" Then Else AdvanceTextBox.Text = 0 End If End Sub Private Sub ButtonNewCheckin_Click( ByVal sender As System.Object , ByVal e As System. EventArgs ) ButtonCheckin.Enabled = True TblCustomerBindingNavigator.AddNewItem.PerformClick() CusNameTextBox.Focus() Me.RoomInfoTableAdapter.Fill( Me.DBDataSeRoomInfo.RoomInfo, ComboBoxRoomType.Text) ClearText() ButtonNewCheckin.Enabled = False End Sub Private Sub ComboBoxRoomType_SelectedIndexChanged( ByVal System.Object , ByVal e As System. EventArgs ) ComboBoxRoomType.SelectedIndexChanged 38
sender As Handles
End Sub Private Sub ClearText() No_of_NightTextBox.Text = 0 TotalTextBox.Text = 0.0 AdvanceTextBox.Text = 0.0 DueTextBox.Text = 0.0 End Sub Private Sub Button1_Click_1( ByVal sender As System.Object , ByVal e As System. EventArgs ) setflag() End Sub Private Sub KryptonButton1_Click( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles KryptonButton1.Click Me.Close() End Sub Private Sub KryptonButton2_Click( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles ButtonNewCheckin.Click ButtonCheckin.Enabled = True TblCustomerBindingNavigator.AddNewItem.PerformClick() CusNameTextBox.Focus() Me.RoomInfoTableAdapter.Fill( Me.DBDataSeRoomInfo.RoomInfo, ComboBoxRoomType.Text) ClearText() ButtonNewCheckin.Enabled = False End Sub Private Sub Button1_Click_2( ByVal sender As System.Object , ByVal e As System. EventArgs ) End Sub Private Sub KryptonButton2_Click_1( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles ButtonCheckin.Click Me.ValidateChildren() Try Dim InvalidInput As Boolean = False Dim ctrl As Control For Each ctrl In Me.Controls If ErrorProvider1.GetError(ctrl) <> "" Then InvalidInput = True Exit For End If
39
Next If InvalidInput = True Then MessageBox .Show( "Please Enter Required MessageBoxButtons.OK, MessageBoxIcon.Information) Else 'Enter here to Execute after Validation
Field" ,
"Invalid
Input" ,
SaveCustomer() SaveCheckIn() setflag() MessageBox .Show( "CheckIn Successfully Done" , "Status" , MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1) ButtonCheckin.Enabled = False ButtonNewCheckin.Enabled = True ButtonNewCheckin.Focus() End If Catch ex As Exception MessageBox .Show( "Fill Required Field Indicated By Red Button" , "CheckIn Satus" , MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1) CusNameTextBox.Focus() End Try End Sub Private Sub AgeTextBox_KeyPress( ByVal sender As Object , ByVal e As System.Windows.Forms. KeyPressEventArgs ) Handles AgeTextBox.KeyPress If Not ( Char.IsNumber(e.KeyChar) Or e.KeyChar = vbBack) Then e.Handled = True End If End Sub Private Sub AgeTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles AgeTextBox.TextChanged End Sub Private Sub Mobile_NoTextBox_KeyPress( ByVal sender As Object , ByVal e As System.Windows.Forms. KeyPressEventArgs ) Handles Mobile_NoTextBox.KeyPress If Not ( Char.IsNumber(e.KeyChar) Or e.KeyChar = vbBack) Then e.Handled = True End If End Sub Private Sub Mobile_NoTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles Mobile_NoTextBox.TextChanged End Sub Private Sub CusNameTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles CusNameTextBox.TextChanged ComboBoxGender.SelectedIndex = 0 End Sub
40
Private Sub CusNameTextBox_Validating( ByVal sender As Object , ByVal e As System.ComponentModel.CancelEventArgs ) Handles CusNameTextBox.Validating Dim txbox As TextBox = DirectCast (sender, TextBox ) TextBoxNotEmpty(txbox) End Sub Private Sub AddressTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles AddressTextBox.TextChanged End Sub Private Sub AddressTextBox_Validating( ByVal sender As Object , ByVal e As System.ComponentModel.CancelEventArgs ) Handles AddressTextBox.Validating Dim txbox As TextBox = DirectCast (sender, TextBox ) TextBoxNotEmpty(txbox) End Sub Private Sub CityTextBox_TextChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles CityTextBox.TextChanged End Sub Private Sub CityTextBox_Validating( ByVal sender As Object , ByVal e As System.ComponentModel.CancelEventArgs ) Handles CityTextBox.Validating Dim txbox As TextBox = DirectCast (sender, TextBox ) TextBoxNotEmpty(txbox) End Sub Private Sub No_of_NightTextBox_Validating( ByVal sender As Object , ByVal e As System.ComponentModel.CancelEventArgs ) Handles No_of_NightTextBox.Validating Dim txbox As TextBox = DirectCast (sender, TextBox ) Dim txtBox As TextBox = DirectCast (sender, TextBox ) If txtBox.Text.Length = 0 Then Me.ErrorProvider1.SetError(txtBox, "Enter No of Days to Stay" ) Else Me.ErrorProvider1.SetError(txtBox, "" ) End If End Sub Private Sub AdvanceTextBox_Validating( ByVal sender As Object , ByVal e As System.ComponentModel.CancelEventArgs ) Handles AdvanceTextBox.Validating If String.IsNullOrEmpty(AdvanceTextBox.Text)Then Me.ErrorProvider1.SetError(AdvanceTextBox,"Please Make Prepaid" ) Else Me.ErrorProvider1.SetError(AdvanceTextBox,"" ) End If End Sub Private Sub ComboBoxGender_SelectedIndexChanged( ByVal sender As System.Object , ByVal e As System. EventArgs ) Handles ComboBoxGender.SelectedIndexChanged End Sub End Class 41
Scope of Future Application
This project can be used in the hotel after adding some more useful modules in the project for which hotel are providing services. Utmost care and back-up procedures must be established to ensure 100% successful implementation of the computerized hotel system. In case of system failure, the organization should be in a position to process the transaction with another organization or if the worst comes to the worst, it should be in a position to complete it manually.
Scope of Improvement Now a day’s hotels are providing many other facilities, this project can also be improved with the improvement in the Hotels. Utmost care and back-up procedures must be established to ensure 100% successful implementation of the computerized banking system. In case of system failure, the organization should be in a position to process the transaction with another organization or if the worst comes to the worst, it should be in a position to complete it manually.
42