You are on page 1of 72

Hotel Room Booking

1. Introduction
Hotel Room Booking is an offline hotel software and a hotel reservation software that
helps you manage reservations, bookings, room stays, room planning, guests,
accounts, agents, pricing plans, basically front office and back office hotel
operations.

Working with online services instead of installing the management system in stand
alone computer gives you quick and relevant advantages, first it is free, second you
do not need to install any system in your computer and last you do not need to worry
about software or hardware maintenance. The only thing which is required is the
internet connectivity which is very easy to find out now days. One of the most
interesting things about the online application is that the information availability.
Information about whatever thing you want you can get it at the click of a button. In
our Hotel Room Booking, the information maintained will be updated one. So the
customer will get the latest information about the pricing, status of the room, they
even can plan on about the number of days of staying in the hotel. One can also get
the information about what kind of food one gets in the hotel.

1.1 Problem Definition:

This system involves the management of small and medium sized hotel properties. It
will allow check-ins, check-outs, reservations, employee information handling,
product and supplier information handling. A user accesses the system by entering
his/her user name and password which were previously defined by the hotel
owner/manager. The clerk uses the system through a Graphical User Interface
(GUI).

1.2 Objectives and Scope of the project

The aim of the project is to design software which manages all the activities of the
hotels and rooms. It is a hotel record keeping system and user can easily see the hotel
information and other details

Department of Computer Science Page 1


Hotel Room Booking

1.3 Theoretical Background about the Technology


The multi-language capability of the .NET Framework and Visual Studio .NET
enables developers to use their existing programming skills to build all types of
applications and XML Web services. The .NET framework supports new versions of
Microsoft’s old favorites Visual Basic and C++ (as VB.NET and Managed C++), but
there are also a number of new additions to the family.

Visual Basic .NET has been updated to include many new and improved language
features that make it a powerful object-oriented programming language. These
features include inheritance, interfaces, and overloading, among others. Visual Basic
also now supports structured exception handling, custom attributes and also supports
multi-threading.

Visual Basic .NET is also CLS compliant, which means that any CLS-compliant
language can use the classes, objects, and components you create in Visual Basic
.NET. Managed Extensions for C++ and attributed programming are just some of the
enhancements made to the C++ language. Managed Extensions simplify the task of
migrating existing C++ applications to the new .NET Framework.

C# is Microsoft’s new language. It’s a C-style language that is essentially “C++ for
Rapid Application Development”. Unlike other languages, its specification is just the
grammar of the language. It has no standard library of its own, and instead has been
designed with the intention of using the .NET libraries as its own.

Active State has created Visual Perl and Visual Python, which enable .NET-aware
applications to be built in either Perl or Python. Both products can be integrated into
the Visual Studio .NET environment. Visual Perl includes support for Active State’s
Perl Dev Kit.

Department of Computer Science Page 2


Hotel Room Booking

INTRODUCTION TO .NET FRAMEWORK

The Microsoft .NET Framework is a software technology that is available with


several Microsoft Windows operating systems. It includes a large library of pre-coded
solutions to common programming problems and a virtual machine that manages the
execution of programs written specifically for the framework. The .NET Framework
is a key Microsoft offering and is intended to be used by most new applications
created for the Windows platform.

The pre-coded solutions that form the framework's Base Class Library cover a
large range of programming needs in a number of areas, including user interface, data
access, database connectivity, cryptography, web application development, numeric
algorithms, and network communications. The class library is used by programmers,
who combine it with their own code to produce applications.

Programs written for the .NET Framework execute in a software environment that
manages the program's runtime requirements. Also part of the .NET Framework, this
runtime environment is known as the Common Language Runtime (CLR). The CLR
provides the appearance of an application virtual machine so that programmers need
not consider the capabilities of the specific CPU that will execute the program. The
CLR also provides other important services such as security, memory management,
and exception handling. The class library and the CLR together compose the .NET
Framework.

Principal design features


Interoperability

Because interaction between new and older applications is commonly required, the
.NET Framework provides means to access functionality that is implemented in
programs that execute outside the .NET environment. Access to COM components is
provided in the System.Runtime.InteropServices and System.EnterpriseServices
namespaces of the framework; access to other functionality is provided using the
P/Invoke feature.

Department of Computer Science Page 3


Hotel Room Booking

Common Runtime Engine

The Common Language Runtime (CLR) is the virtual machine component of the
.NET framework. All .NET programs execute under the supervision of the CLR,
guaranteeing certain properties and behaviors in the areas of memory management,
security, and exception handling.

Base Class Library

The Base Class Library (BCL), part of the Framework Class Library (FCL), is a
library of functionality available to all languages using the .NET Framework. The
BCL provides classes which encapsulate a number of common functions, including
file reading and writing, graphic rendering, database interaction and XML document
manipulation.

Simplified Deployment

Installation of computer software must be carefully managed to ensure that it does not
interfere with previously installed software, and that it conforms to security
requirements. The .NET framework includes design features and tools that help
address these requirements.

Security

The design is meant to address some of the vulnerabilities, such as buffer overflows,
that have been exploited by malicious software. Additionally, .NET provides a
common security model for all applications.

Portability

The design of the .NET Framework allows it to theoretically be platform agnostic,


and thus cross-platform compatible. That is, a program written to use the framework
should run without change on any type of system for which the framework is
implemented. Microsoft's commercial implementations of the framework cover

Department of Computer Science Page 4


Hotel Room Booking

Windows, Windows CE, and the Xbox 360. In addition, Microsoft submits the
specifications for the Common Language Infrastructure (which includes the core class
libraries, Common Type System, and the Common Intermediate Language), the C#
language, and the C++/CLI language to both ECMA and the ISO, making them
available as open standards. This makes it possible for third parties to create
compatible implementations of the framework and its languages on other platforms.

Architecture

Visual overview of the Common Language Infrastructure (CLI)

Common Language Infrastructure

The core aspects of the .NET framework lie within the Common Language
Infrastructure, or CLI. The purpose of the CLI is to provide a language-neutral
platform for application development and execution, including functions for exception
handling, garbage collection, security, and interoperability. Microsoft's
implementation of the CLI is called the Common Language Runtime or CLR.

Assemblies

The intermediate CIL code is housed in .NET assemblies. As mandated by


specification, assemblies are stored in the Portable Executable (PE) format, common
on the Windows platform for all DLL and EXE files. The assembly consists of one or

Department of Computer Science Page 5


Hotel Room Booking

more files, one of which must contain the manifest, which has the metadata for the
assembly. The complete name of an assembly (not to be confused with the filename
on disk) contains its simple text name, version number, culture, and public key token.
The public key token is a unique hash generated when the assembly is compiled, thus
two assemblies with the same public key token are guaranteed to be identical from the
point of view of the framework. A private key can also be specified known only to the
creator of the assembly and can be used for strong naming and to guarantee that the
assembly is from the same author when a new version of the assembly is compiled
(required to add an assembly to the Global Assembly Cache).

Metadata

All CLI is self-describing through .NET metadata. The CLR checks the metadata to
ensure that the correct method is called. Metadata is usually generated by language
compilers but developers can create their own metadata through custom attributes.
Metadata contains information about the assembly, and is also used to implement the
reflective programming capabilities of .NET Framework.

Security

.NET has its own security mechanism with two general features: Code Access
Security (CAS), and validation and verification. Code Access Security is based on
evidence that is associated with a specific assembly. Typically the evidence is the
source of the assembly (whether it is installed on the local machine or has been
downloaded from the intranet or Internet). Code Access Security uses evidence to
determine the permissions granted to the code. Other code can demand that calling
code is granted a specified permission. The demand causes the CLR to perform a call
stack walk: every assembly of each method in the call stack is checked for the
required permission; if any assembly is not granted the permission a security
exception is thrown.

Department of Computer Science Page 6


Hotel Room Booking

When an assembly is loaded the CLR performs various tests. Two such tests are
validation and verification. During validation the CLR checks that the assembly
contains valid metadata and CIL, and whether the internal tables are correct.
Verification is not so exact. The verification mechanism checks to see if the code does
anything that is 'unsafe'. The algorithm used is quite conservative; hence occasionally
code that is 'safe' does not pass. Unsafe code will only be executed if the assembly has
the 'skip verification' permission, which generally means code that is installed on the
local machine.

.NET Framework uses appdomains as a mechanism for isolating code running in a


process. Appdomains can be created and code loaded into or unloaded from them
independent of other appdomains. This helps increase the fault tolerance of the
application, as faults or crashes in one appdomain do not affect rest of the application.
Appdomains can also be configured independently with different security privileges.
This can help increase the security of the application by isolating potentially unsafe
code. The developer, however, has to split the application into sub domains; it is not
done by the CLR.

Department of Computer Science Page 7


Hotel Room Booking

Class library

Namespaces in the BCL


System
System. CodeDom
System. Collections
System. Diagnostics
System. Globalization
System. IO
System. Resources
System. Text
System.Text.RegularExpressions

Microsoft .NET Framework includes a set of standard class libraries. The class
library is organized in a hierarchy of namespaces. Most of the built in APIs are part of
either System.* or Microsoft.* namespaces. It encapsulates a large number of
common functions, such as file reading and writing, graphic rendering, database
interaction, and XML document manipulation, among others. The .NET class libraries
are available to all .NET languages. The .NET Framework class library is divided into
two parts: the Base Class Library and the Framework Class Library.

The Base Class Library (BCL) includes a small subset of the entire class library and
is the core set of classes that serve as the basic API of the Common Language
Runtime. The classes in mscorlib.dll and some of the classes in System.dll and
System.core.dll are considered to be a part of the BCL. The BCL classes are available
in both .NET Framework as well as its alternative implementations including .NET
Compact Framework, Microsoft Silverlight and Mono.

The Framework Class Library (FCL) is a superset of the BCL classes and refers to
the entire class library that ships with .NET Framework. It includes an expanded set
of libraries, including WinForms, ADO.NET, ASP.NET, Language Integrated Query,
Windows Presentation Foundation, Windows Communication Foundation among
others. The FCL is much larger in scope than standard libraries for languages like C+
+, and comparable in scope to the standard libraries of Java.

Memory management

Department of Computer Science Page 8


Hotel Room Booking

The .NET Framework CLR frees the developer from the burden of managing memory
(allocating and freeing up when done); instead it does the memory management itself.
To this end, the memory allocated to instantiations of .NET types (objects) is done
contiguously from the managed heap, a pool of memory managed by the CLR. As
long as there exists a reference to an object, which might be either a direct reference
to an object or via a graph of objects, the object is considered to be in use by the CLR.
When there is no reference to an object, and it cannot be reached or used, it becomes
garbage. However, it still holds on to the memory allocated to it. .NET Framework
includes a garbage collector which runs periodically, on a separate thread from the
application's thread, that enumerates all the unusable objects and reclaims the memory
allocated to them.

The .NET Garbage Collector (GC) is a non-deterministic, compacting, mark-and-


sweep garbage collector. The GC runs only when a certain amount of memory has
been used or there is enough pressure for memory on the system. Since it is not
guaranteed when the conditions to reclaim memory are reached, the GC runs are non-
deterministic. Each .NET application has a set of roots, which are pointers to objects
on the managed heap (managed objects). These include references to static objects
and objects defined as local variables or method parameters currently in scope, as well
as objects referred to by CPU registers. When the GC runs, it pauses the application,
and for each object referred to in the root, it recursively enumerates all the objects
reachable from the root objects and marks them as reachable. It uses .NET metadata
and reflection to discover the objects encapsulated by an object, and then recursively
walk them. It then enumerates all the objects on the heap (which were initially
allocated contiguously) using reflection. All objects not marked as reachable are
garbage. This is the mark phase. Since the memory held by garbage is not of any
consequence, it is considered free space. However, this leaves chunks of free space
between objects which were initially contiguous. The objects are then compacted
together, by using memcpy to copy them over to the free space to make them
contiguous again. Any reference to an object invalidated by moving the object is
updated to reflect the new location by the GC. The application is resumed after the
garbage collection is over.

Department of Computer Science Page 9


Hotel Room Booking

The GC used by .NET Framework is actually generational. Objects are assigned a


generation; newly created objects belong to Generation 0. The objects that survive a
garbage collection are tagged as Generation 1, and the Generation 1 objects that
survive another collection are Generation 2 objects. The .NET Framework uses up to
Generation 2 objects. Higher generation objects are garbage collected less frequently
than lower generation objects. This helps increase the efficiency of garbage
collection, as older objects tend to have a larger lifetime than newer objects. Thus, by
removing older (and thus more likely to survive a collection) objects from the scope
of a collection run, fewer objects need to be checked and compacted.

Versions

Microsoft started development on the .NET Framework in the late 1990s originally
under the name of Next Generation Windows Services (NGWS). By late 2000 the
first beta versions of .NET 1.0 were released.
The .NET Framework stack.

Department of Computer Science Page 10


Hotel Room Booking

Client Application Development

Client applications are the closest to a traditional style of application in


Windows-based programming. These are the types of applications that display
windows or forms on the desktop, enabling a user to perform a task. Client
applications include applications such as word processors and spreadsheets, as well as
custom business applications such as data-entry tools, reporting tools, and so on.
Client applications usually employ windows, menus, buttons, and other GUI
elements, and they likely access local resources such as the file system and
peripherals such as printers. Another kind of client application is the traditional
ActiveX control (now replaced by the managed Windows Forms control) deployed
over the Internet as a Web page. This application is much like other client
applications: it is executed natively, has access to local resources, and includes
graphical elements.

In the past, developers created such applications using C/C++ in


conjunction with the Microsoft Foundation Classes (MFC) or with a rapid application
development (RAD) environment such as Microsoft® Visual Basic®. The .NET
Framework incorporates aspects of these existing products into a single, consistent
development environment that drastically simplifies the development of client
applications.

The Windows Forms classes contained in the .NET Framework are


designed to be used for GUI development. You can easily create command windows,
buttons, menus, toolbars, and other screen elements with the flexibility necessary to
accommodate shifting business needs.

For example, the .NET Framework provides simple properties to adjust


visual attributes associated with forms. In some cases the underlying operating system
does not support changing these attributes directly, and in these cases the .NET
Framework automatically recreates the forms. This is one of many ways in which
the .NET Framework integrates the developer interface, making coding simpler and
more consistent.

Department of Computer Science Page 11


Hotel Room Booking

Server Application Development

Server-side applications in the managed world are implemented through


runtime hosts. Unmanaged applications host the common language runtime, which
allows your custom managed code to control the behavior of the server.

This model provides you with all the features of the common language
runtime and class library while gaining the performance and scalability of the host
server.

Server-side managed code

ASP.NET is the hosting environment that enables developers to use


the .NET Framework to target Web-based applications. However, ASP.NET is more
than just a runtime host; it is a complete architecture for developing Web sites and
Internet-distributed objects using managed code. Both Web Forms and XML Web
services use IIS and ASP.NET as the publishing mechanism for applications, and both
have a collection of supporting classes in the .NET

Department of Computer Science Page 12


Hotel Room Booking

C#.NET

The Relationship of C# to .NET

C# is a new programming language, and is significant in two respects:

 It is specifically designed and targeted for use with Microsoft's .NET


Framework (a feature rich platform for the development, deployment, and
execution of distributed applications).

 It is a language based upon the modern object-oriented design methodology,


and when designing it Microsoft has been able to learn from the experience of
all the other similar languages that have been around over the 20 years or so
since object-oriented principles came to prominence

One important thing to make clear is that C# is a language in its own right.
Although it is designed to generate code that targets the .NET environment, it is not
itself part of .NET. There are some features that are supported by .NET but not by C#,
and you might be surprised to learn that there are actually features of the C# language
that are not supported by .NET like Operator Overloading.

However, since the C# language is intended for use with .NET, it is important for
us to have an understanding of this Framework if we wish to develop applications in
C# effectively. So, in this chapter

The Common Language Runtime:

Central to the .NET framework is its run-time execution environment, known


as the Common Language Runtime (CLR) or the .NET runtime. Code running
under the control of the CLR is often termed managed code.

Department of Computer Science Page 13


Hotel Room Booking

However, before it can be executed by the CLR, any source code that we develop (in
C# or some other language) needs to be compiled. Compilation occurs in two steps
in .NET:

1. Compilation of source code to Microsoft Intermediate Language (MS-IL)

2. Compilation of IL to platform-specific code by the CLR

At first sight this might seem a rather long-winded compilation process. Actually,
this two-stage compilation process is very important, because the existence of the
Microsoft Intermediate Language (managed code) is the key to providing many of the
benefits of .NET. Let's see why.

Advantages of Managed Code

Microsoft Intermediate Language (often shortened to "Intermediate


Language", or "IL") shares with Java byte code the idea that it is a low-level language
with a simple syntax (based on numeric codes rather than text), which can be very
quickly translated into native machine code. Having this well-defined
Universal syntax for code has significant advantages.

Platform Independence

First, it means that the same file containing byte code instructions can be
placed on any platform; at runtime the final stage of compilation can then be easily
accomplished so that the code will run on that particular platform. In other words, by
compiling to Intermediate Language we obtain platform independence for .NET, in
much the same way as compiling to Java byte code gives Java platform independence.

You should note that the platform independence of .NET is only theoretical at
present because, at the time of writing, .NET is only available for Windows.
However, porting .NET to other platforms is being explored (see for example the

Department of Computer Science Page 14


Hotel Room Booking

Mono project, an effort to create an open source implementation of .NET, at


http://www.go-mono.com/).

Performance Improvement

Although we previously made comparisons with Java, IL is actually a bit more


ambitious than Java byte code. Significantly, IL is always Just-In-Time compiled,
whereas Java byte code was often interpreted. One of the disadvantages of Java was
that, on execution, the process of translating from Java byte code to native executable
resulted in a loss of performance (apart from in more recent cases, here Java is JIT-
compiled on certain platforms).

Instead of compiling the entire application in one go (which could lead to a


slow start-up time), the JIT compiler simply compiles each portion of code as it is
called (just-in-time). When code has been compiled once, the resultant native
executable is stored until the application exits, so that it does not need to be
recompiled the next time that portion of code is run. Microsoft argues that this process
is more efficient than compiling the entire application code at the start, because of the
likelihood those large portions of any application code will not actually be executed in
any given run. Using the JIT compiler, such code will never get compiled.

This explains why we can expect that execution of managed IL code will be
almost as fast as executing native machine code. What it doesn't explain is why
Microsoft expects that we will get a performance improvement. The reason given for
this is that, since the final stage of compilation takes place at run time, the JIT
compiler will know exactly what processor type the program will run on. This means
that it can optimize the final executable code to take advantage of any features or
particular machine code instructions offered by that particular processor.

Traditional compilers will optimize the code, but they can only perform
optimizations that will be independent of the particular processor that the code will
run on. This is because traditional compilers compile to native executable before the
software is shipped. This means that the compiler doesn't know what type of
processor the code will run on beyond basic generalities, such as that it will be an

Department of Computer Science Page 15


Hotel Room Booking

x86-compatible processor or an Alpha processor. Visual Studio 6, for example,


optimizes for a generic Pentium machine, so the code that it generates cannot take
advantages of hardware features of Pentium III processors. On the other hand, the JIT
compiler can do all the optimizations that Visual Studio 6 can, and in addition to that
it will optimize for the particular processor the code is running on.

Language Interoperability

How the use of IL enables platform independence, and how JIT compilation
should improve performance. However, IL also facilitates language interoperability.
Simply put, you can compile to IL from one language, and this compiled code should
then be interoperable with code that has been compiled to IL from another language.

Intermediate Language

From what we learned in the previous section, Intermediate Language


obviously plays a fundamental role in the .NET Framework. As C# developers, we
now understand that our C# code will be compiled into Intermediate Language before
it is executed (indeed, the C# compiler only compiles to managed code). It makes
sense, then, that we should now take a closer look at the main characteristics of IL,
since any language that targets .NET would logically need to support the main
characteristics of IL too.

Here are the important features of the Intermediate Language:

 Object-orientation and use of interfaces


 Strong distinction between value and reference types
 Strong data typing
 Error handling through the use of exceptions
 Use of attributes
Support of Object Orientation and Interfaces

Department of Computer Science Page 16


Hotel Room Booking

The language independence of .NET does have some practical limits. In


particular, IL, however it is designed, is inevitably going to implement some
particular programming methodology, which means that languages targeting it are
going to have to be compatible with that methodology. The particular route that
Microsoft has chosen to follow for IL is that of classic object-oriented programming,
with single implementation inheritance of classes.

Besides classic object-oriented programming, Intermediate Language also


brings in the idea of interfaces, which saw their first implementation under Windows
with COM. .NET interfaces are not the same as COM interfaces; they do not need to
support any of the COM infrastructure (for example, they are not derived from I
Unknown, and they do not have associated GUIDs). However, they do share with
COM interfaces the idea that they provide a contract, and classes that implement a
given interface must provide implementations of the methods and properties specified
by that interface.

Object Orientation and Language Interoperability

Working with .NET means compiling to the Intermediate Language, and that
in turn means that you will need to be programming using traditional object-oriented
methodologies. That alone is not, however, sufficient to give us language
interoperability. After all, C++ and Java both use the same object-oriented paradigms,
but they are still not regarded as interoperable. We need to look a little more closely at
the concept of language interoperability.

An associated problem was that, when debugging, you would still have to
independently debug components written in different languages. It was not possible to
step between languages in the debugger. So what we really mean by language
interoperability is that classes written in one language should be able to talk directly
to classes written in another language. In particular:

 A class written in one language can inherit from a class written in


another language

Department of Computer Science Page 17


Hotel Room Booking

 The class can contain an instance of another class, no matter what the
languages of the two classes are
 An object can directly call methods against another object written in
another language
 Objects (or references to objects) can be passed around between
methods
 When calling methods between languages we can step between the
method calls in the
Debugger, even where this means stepping between source code
written in different languages

This is all quite an ambitious aim, but amazingly, .NET and the Intermediate
Language have achieved it. For the case of stepping between methods in the
debugger, this facility is really offered by the Visual Studio .NET IDE rather than
from the CLR itself.

Strong Data Type

One very important aspect of IL is that it is based on exceptionally strong


data typing. What we mean by that is that all variables are clearly marked as being of
a particular, specific data type (there is no room in IL, for example, for the Variant
data type recognized by Visual Basic and scripting languages). In particular, IL does
not normally permit any operations that result in ambiguous data types.

For instance, VB developers will be used to being able to pass variables


around without worrying too much about their types, because VB automatically
performs type conversion. C++ developers will be used to routinely casting pointers
between different types. Being able to perform this kind of operation can be great for
performance, but it breaks type safety. Hence, it is permitted only in very specific
circumstances in some of the languages that compile to managed code. Indeed,
pointers (as opposed to references) are only permitted in marked blocks of code in C#,
and not at all in VB (although they are allowed as normal in managed C++). Using

Department of Computer Science Page 18


Hotel Room Booking

pointers in your code will immediately cause it to fail the memory type safety checks
performed by the CLR.

You should note that some languages compatible with .NET, such as
VB.NET, still allow some laxity in typing, but that is only possible because the
compilers behind the scenes ensure the type safety is enforced in the emitted IL.

Although enforcing type safety might initially appear to hurt performance, in


many cases this is far outweighed by the benefits gained from the services provided
by .NET that rely on type safety. Such services include:

 Language Interoperability

 Garbage Collection

 Security

 Application Domains

Common Type System (CTS)

This data type problem is solved in .NET through the use of the Common
Type System (CTS). The CTS defines the predefined data types that are available in
IL, so that all languages that target the .NET framework will produce compiled code
that is ultimately based on these types.
The CTS doesn't merely specify primitive data types, but a rich hierarchy of
types, which includes well-defined points in the hierarchy at which code is permitted
to define its own types. The hierarchical structure of the Common Type System
reflects the single-inheritance object-oriented methodology of IL, and looks like this:

Department of Computer Science Page 19


Hotel Room Booking

Common Language Specification (CLS)

The Common Language Specification works with the Common Type System
to ensure language interoperability. The CLS is a set of minimum standards that all
compilers targeting .NET must support. Since IL is a very rich language, writers of
most compilers will prefer to restrict the capabilities of a given compiler to only
support a subset of the facilities offered by IL and the CTS. That is fine, as long as the
compiler supports everything that is defined in the CLS.

Garbage Collection

The garbage collector is .NET's answer to memory management, and in


particular to the question of what to do about reclaiming memory that running
applications ask for. Up until now there have been two techniques used on Windows
platform for deal locating memory that processes have dynamically requested from
the system:

 Make the application code do it all manually

Department of Computer Science Page 20


Hotel Room Booking

 Make objects maintain reference counts

The .NET runtime relies on the garbage collector instead. This is a program whose
purpose is to clean up memory. The idea is that all dynamically requested memory is
allocated on the heap (that is true for all languages, although in the case of .NET, the
CLR maintains its own managed heap for .NET applications to use). Every so often,
when .NET detects that the managed heap for a given process is becoming full and
therefore needs tidying up, it calls the garbage collector. The garbage collector runs
through variables currently in scope in your code, examining references to objects
stored on the heap to identify which ones are accessible from your code – that is to
say which objects have references that refer to them. Any objects that are not referred
to are deemed to be no longer accessible from your code and can therefore be
removed. Java uses a similar system of garbage collection to this.
Security

.NET can really excel in terms of complementing the security mechanisms


provided by Windows because it can offer code-based security, whereas Windows
only really offers role-based security.

Role-based security is based on the identity of the account under which the
process is running, in other words, who owns and is running the process. Code-based
security on the other hand is based on what the code actually does and on how much
the code is trusted. Thanks to the strong type safety of IL, the CLR is able to inspect
code before running it in order to determine required security permissions. .NET also
offers a mechanism by which code can indicate in advance what security permissions
it will require to run.

The importance of code-based security is that it reduces the risks associated


with running code of dubious origin (such as code that you've downloaded from the
Internet). For example, even if code is running under the administrator account, it is
possible to use code-based security to indicate that that code should still not be
permitted to perform certain types of operation that the administrator account would
normally be allowed to do, such as read or write to environment variables, read or
write to the registry, or to access the .NET reflection features.

Department of Computer Science Page 21


Hotel Room Booking

.Net Framework Classes

The .NET base classes are a massive collection of managed code classes that
have been written by Microsoft, and which allow you to do almost any of the tasks
that were previously available through the Windows API. These classes follow the
same object model as used by IL, based on single inheritance. This means that you
can either instantiate objects of whichever .NET base class is appropriate, or you can
derive your own classes from them.

The great thing about the .NET base classes is that they have been designed to
be very intuitive and easy to use. For example, to start a thread, you call the Start ()
method of the Thread class. To disable a Textbox, you set the Enabled property of a
Textbox object to false. This approach will be familiar to Visual Basic and Java
developers, whose respective libraries are just as easy to use. It may however come as
a great relief to C++ developers, who for years have had to cope with such API
functions as GetDIBits (), RegisterWndClassEx (), and IsEqualIID (), as well as a
whole plethora of functions that required Windows handles to be passed around.

Name Spaces

Namespaces are the way that .NET avoids name clashes between classes.
They are designed, for example, to avoid the situation in which you define a class to
represent a customer, name your class Customer, and then someone else does the
same thing (quite a likely scenario – the proportion of businesses that have customers
seems to be quite high).

A namespace is no more than a grouping of data types, but it has the effect
that the names of all data types within a namespace automatically get prefixed with
the name of the namespace. It is also possible to nest namespaces within each other.
For example, most of the general-purpose .NET base classes are in a namespace

Department of Computer Science Page 22


Hotel Room Booking

called System. The base class Array is in this namespace, so its full name is System.
Array.

If a namespace is explicitly supplied, then the type will be added to a nameless


global namespace.
Creating .Net Application using C#

C# can be used to create console applications: text-only applications that run


in a DOS window. You'll probably use console applications when unit testing class
libraries, and for creating Unix/Linux daemon processes. However, more often you'll
use C# to create applications that use many of the technologies associated with .NET.
In this section, we'll give you an overview of the different types of application that
you can write in C#.

Creating Windows Forms

Although C# and .NET are particularly suited to web development, they still
offer splendid support for so-called "fat client" apps, applications that have to be
installed on the end-user's machine where most of the processing takes place. This
support is from Windows Forms.

A Windows Form is the .NET answer to a VB 6 Form. To design a graphical


window interface, you just drag controls from a toolbox onto a Windows Form. To
determine the window's behavior, you write event-handling routines for the form's
controls. A Windows Form project compiles to an EXE that must be installed
alongside the .NET runtime on the end user's computer. Like other .NET project
types, Windows Form projects are supported by both VB.NET and C#.

Windows Control

Although Web Forms and Windows Forms are developed in much the same
way, you use different kinds of controls to populate them. Web Forms use Web
Controls, and Windows Forms use Windows Controls.

Department of Computer Science Page 23


Hotel Room Booking

A Windows Control is a lot like an ActiveX control. After a Window control is


implemented, it compiles to a DLL that must be installed on the client's machine. In
fact, the .NET SDK provides a utility that creates a wrapper for ActiveX controls, so
that they can be placed on Windows Forms. As is the case with Web Controls,
Windows Control creation involves deriving from a particular class,
System.Windows.Forms.Control.
Windows Services

A Windows Service (originally called an NT Service) is a program that is


designed to run in the background in Windows NT/2000/XP (but not Windows 9x).
Services are useful where you want a program to be running continuously and ready
to respond to events without having been explicitly started by the user. A good
example would be the World Wide Web Service on web servers, which
Listens out for web requests from clients.

It is very easy to write services in C#. There are .NET Framework base classes
available in the System.ServiceProcess namespace that handle many of the boilerplate
tasks associated with services, and in addition, Visual Studio .NET allows you to
create a C# Windows Service project, which starts you out with the Framework C#
source code for a basic Windows service.

2. System analysis
2.1 Introduction

2.2 Existing system:

Current system is a manual one in which traveler and business people who travel a lot
to different places has to submit their request for the room booking by calling or after going to
the hotel which is not a best way of doing room booking, here time will be wattage and if
room is not available then lot of problem will arise.travellers has to follow up regularly with
hotel personnel to know the status of their requests which is time consuming and hectic.

Disadvantages:

Department of Computer Science Page 24


Hotel Room Booking

1. Room available cannot be known untill you reach the hotel


2. The room booking is manually hence it is very hectic from the hotel
management also as they have to see the register every time a request comes
for the room booking
3. The existing system is not dynamic wher room booking is done on internet
4. Travelling is needed which cost a lot of money.

2.3 Proposed System:

The proposed system of the room booking is online, where a traveller need not
to go the hotel for the purpose of the room booking it can be done with the help of a
click of button if you have the internet connection. Room availability of the different
hotels with the cost is known very easily and no time is wastage for ther travelling
purpose.

Advantages:

1. The application gives the facility to view the status of the rooms without
visiting the hotels
2. Time is saved as it is done online form travelers home
3. The application gives easy interface which allows a common user also to
understand the flow of the procedure
4. The application is secured and scalable.

2.4 Methodology Used and apply to the project


Introduction:
Software development life cycle (Spiral Model)

The spiral model, originally proposed by Boehm [BOE88], is evolutionary software


process model that couples the iterative nature of prototyping with the controlled and
systematic aspects of the linear sequential model. It provides the potential for rapid
development of incremental versions of the software. Using the spiral model, software
is developed in a series of incremental releases. During early iterations, the
incremental release might be a paper model or prototype. During later iterations,
increasingly more complete versions of the engineered system are produced. A spiral
model is divided into a number of framework activities, also called taskregions.6

Department of Computer Science Page 25


Hotel Room Booking

typically, there are between three and six task regions. Below figure depicts a spiral
model that contains six task regions:

Customer communication—tasks required to establish effective communication


between developer and customer.

Planning—tasks required to define resources, timelines, and other project


related information.

Risk analysis—tasks required to assess both technical and management risks.

Engineering—tasks required to build one or more representations of the application.

Construction and release—tasks required to construct, test, install, and provide user
support (e.g., documentation and training

Customer evaluation—tasks required to obtain customer feedback based on


evaluation of the software representations created during the engineering stage.

The spiral model is a realistic approach to the development of large-scale


systems and software. Because software evolves as the process progresses, the
developer and customer better understand and react to risks at each evolutionary level.
The spiral model uses prototyping as a risk reduction mechanism but, more important,
enables the developer to apply the prototyping approach at any stage in the evolution
of the product. It maintains the systematic stepwise approach suggested by the classic
life cycle but incorporates it into an iterative framework that more realistically reflects
the real world.

Department of Computer Science Page 26


Hotel Room Booking

The spiral model demands a direct consideration of technical risks at all stages
of the project and, if properly applied, should reduce risks before they become
problematic. But like other paradigms, the spiral model is not a panacea. It may be
difficult to convince customers (particularly in contract situations) that the
evolutionary approach is controllable. It demands considerable risk assessment
expertise and relies on this expertise for success. If a major risk is not uncovered and
managed, problems will undoubtedly occur. Finally, the model has not been used as
widely as the linear sequential or prototyping paradigms. It will take a number of
years before efficacy of this important paradigm can be determined with absolute
certainty.

Advantages of Spiral model:

 High amount of risk analysis hence, avoidance of Risk is enhanced.


 Good for large and mission-critical projects.
 Strong approval and documentation control.
 Additional Functionality can be added at a later date.
 Software is produced early in the software life cycle.

Department of Computer Science Page 27


Hotel Room Booking

2.5 FEASIBILITY STUDY

Department of Computer Science Page 28


Hotel Room Booking

Preliminary investigation examine project feasibility, the likelihood the system


will be useful to the organization. The main objective of the feasibility study is to test
the Technical, Operational and Economical feasibility for adding new modules and
debugging old running system. All system is feasible if they are unlimited resources
and infinite time. There are aspects in the feasibility study portion of the preliminary
investigation:

 Technical Feasibility
 Operational Feasibility
 Economical Feasibility

TECHNICAL FEASIBILITY

Technical Feasibility centers on the existing computer system hardware,


software, etc. and to some extent how it can support the proposed addition. This
involves financial considerations to accommodate technical enhancements. Technical
support is also a reason for the success of the project. The techniques needed for the
system should be available and it must be reasonable to use. Technical Feasibility is
mainly concerned with the study of function, performance, and constraints that may
affect the ability to achieve the system. By conducting an efficient technical
feasibility we need to ensure that the project works to solve the existing problem area.

Since the project is designed with ASP.NET with C# as Front end and SQL
Server 2000 as Back end, it is easy to install in all the systems wherever needed. It is
more efficient, easy and user-friendly to understand by almost everyone. Huge
amount of data can be handled efficiently using SQL Server as back end. Hence this
project has good technical feasibility

OPERATIONAL FEASIBILITY

Department of Computer Science Page 29


Hotel Room Booking

People are inherently instant to change and computers have been known to facilitate
change. An estimate should be made to how strong a reaction the user staff is likely to
have towards the development of the computerized system.

The staff is accustomed to computerized systems. These kinds of systems are


becoming more common day by day for evaluation of the software engineers.
Hence,this system is operationally feasible. As this system is technically,
economically and operationally feasible, this system is judged feasible.

ECONOMICAL FEASIBILITY

The role of interface design is to reconcile the differences that prevail among
the software engineer’s design model, the designed system meet the end user
requirement with economical way at minimal cost within the affordable price by
encouraging more of proposed system. Economic feasibility is concerned with
comparing the development cost with the income/benefit derived from the developed
system. In this we need to derive how this project will help the management to take
effective decisions.

Economic Feasibility is mainly concerned with the cost incurred in the


implementation of the software. Since this project is developed using ASP.NET with
C# and SQL Server which is more commonly available and even the cost involved in
the installation process is not high.
Similarly it is easy to recruit persons for operating the software since almost all the
people are aware of ASP.NET with C# and SQL Server. Even if we want to train the
persons in these area the cost involved in training is also very less. Hence this project
has good economic feasibility.
The system once developed must be used efficiently. Otherwise there is no
meaning for developing the system. For this a careful study of the existing system
and its drawbacks are needed. The user should be able to distinguish the existing one
and proposed one, so that one must be able to appreciate the characteristics of the
proposed system, the manual one is not highly reliable and also is considerably fast.
The proposed system is efficient, reliable and also quickly responding.

Department of Computer Science Page 30


Hotel Room Booking

3. Software Requirement Specification

3.1 Hardware Specification:

 Processor : Pentium
 Main Memory : 4 RAM
 Hard Disk Drive : 500 GB
 Monitor :15’’ Preferably Color Monitor
 Keyboard : Standard Multimedia keyboard
 Mouse : Optical Mouse

3.2 Software Specification:

 Operating System : Windows 7 onwards


 Technology : Visual Studio 2010

Department of Computer Science Page 31


Hotel Room Booking

 Front End : Asp.net


 Back-End : SQL Server 2008 R2 and above

Descriptions Used To the Projects


Front end: Asp.net and C Sharp
Back End: SQL Server 2008 R2

ASP.NET is an open-source server-side web application framework


designed for web development to produce dynamic web pages. It was
developed by Microsoft to allow programmers to build dynamic web
sites, web applications and web services.

4. System Design

4.1 Introduction

Module and Modules Descriptions

1. Clients:
2. Rooms
3. Status
4. Order processing with tables
5. Enquiry details
6. Employee Details
7. Login Modules

Hotel Room Booking

Department of Computer Science Page 32


Hotel Room Booking

1. Clients module: The advantage with the keeping details of the customer is to care
of the customers who visit the hotel often. So all the details like address and
anything that is related to the customer can be kept in the database permanently.
2. Rooms Module: The details like single room or double room and weather rooms
are vacant or not can be kept in the database. It is very important to maintain the
details of availability of the rooms, because some times in good season its become
very hard to maintain the records of availability of the rooms. We also keep how
many single and double rooms are available at present instance.
3. Order Processing Module: The details like orders that has been placed by the
customer as per the tables can be recorded in the database. Order processing table
will maintain the records like which table has asked for what type of food and this
can be useful to see availability of the items.
4. Enquiry Details Module : Contains the details like rooms are vacant or not as per
the date can be viewed by the customer. This table contains all the enquire which
the customer has posed. The table will help in answering the online like questions
to the customer through phone or through emails.
5. Employee Details: The details like servers and waiters can be placed in this
module. The employee table contains the bio data of the employee, we can also
keep the salary details the shift timings.

6. Login: Authentication module. This module is used for the security reason for the
software.

Department of Computer Science Page 33


Hotel Room Booking

4.3 Data Flow Diagram

DATA FLOW DIAGRAMS

A data flow diagram is graphical tool used to describe and analyze movement
of data through a system. These are the central tool and the basis from which the
other components are developed. The transformation of data from input to output,
through processed, may be described logically and independently of physical
components associated with the system. These are known as the logical data flow
diagrams. The physical data flow diagrams show the actual implements and
movement of data between people, departments and workstations. A full description
of a system actually consists of a set of data flow diagrams. Using two familiar
notations Yourdon, Gane and Sarson notation develops the data flow diagrams. Each
component in a DFD is labeled with a descriptive name. Process is further identified

Department of Computer Science Page 34


Hotel Room Booking

with a number that will be used for identification purpose. The development of
DFD’S is done in several levels. Each process in lower level diagrams can be broken
down into a more detailed DFD in the next level. The lop-level diagram is often
called context diagram. It consists a single process bit, which plays vital role in
studying the current system. The process in the context level diagram is exploded
into other process at the first level DFD.

The idea behind the explosion of a process into more process is that understanding at
one level of detail is exploded into greater detail at the next level. This is done until
further explosion is necessary and an adequate amount of detail is described for
analyst to understand the process.

Larry Constantine first developed the DFD as a way of expressing system


requirements in a graphical from, this lead to the modular design.

A DFD is also known as a “bubble Chart” has the purpose of clarifying system
requirements and identifying major transformations that will become programs in
system design. So it is the starting point of the design to the lowest level of detail. A
DFD consists of a series of bubbles joined by data flows in the system.

DFD SYMBOLS:

In the DFD, there are four symbols

1. A square defines a source(originator) or destination of system data


2. An arrow identifies data flow. It is the pipeline through which the information
flows
3. A circle or a bubble represents a process that transforms incoming data flow into
outgoing data flows.
4. An open rectangle is a data store, data at rest or a temporary repository of data

Department of Computer Science Page 35


Hotel Room Booking

Process that transforms data flow.

Source or Destination of data

Data flow

Data Store

4.4 Data Base Design and Dictionary

Booking Table

Department of Computer Science Page 36


Hotel Room Booking

Offers Table

Restaurant Table

User Table

Department of Computer Science Page 37


Hotel Room Booking

4.5 Entity Relationship Diagram

Department of Computer Science Page 38


Hotel Room Booking

4.6 System Modeling Using UML

4.6.1 Introduction

Department of Computer Science Page 39


Hotel Room Booking

4.6.2 Class Diagram

Department of Computer Science Page 40


Hotel Room Booking

4.6.3 Object Diagram

4.6.4 Use Case Diagram

Department of Computer Science Page 41


Hotel Room Booking

4.6.5 Activity Diagram

Department of Computer Science Page 42


Hotel Room Booking

Department of Computer Science Page 43


Hotel Room Booking

5. System Implementations
5.1 Introduction
5.2 Web Design and Screen Shorts

Department of Computer Science Page 44


Hotel Room Booking

Department of Computer Science Page 45


Hotel Room Booking

Department of Computer Science Page 46


Hotel Room Booking

Department of Computer Science Page 47


Hotel Room Booking

Department of Computer Science Page 48


Hotel Room Booking

Department of Computer Science Page 49


Hotel Room Booking

Department of Computer Science Page 50


Hotel Room Booking

Department of Computer Science Page 51


Hotel Room Booking

6. Sample coding
Source Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
a
{
text-decoration: none;
font-size: 18px;
font-weight: bolder;
}
a:hover
{
text-decoration: underline;
}
</style>
</head>
<body background="Images/Colorful (15)14.jpg">
<form id="form1" runat="server">
<div>
<table cellpadding="10" width="100%" style="border-color: Green;
border-style: groove;
border-width: 6px; font-size: 25px; font-weight: bolder; color:
Red;">
<tr>
<td>
HOTEL ROOM BOOKING
</td>
</tr>
</table>
<hr size="10" color="purple" />
<table cellpadding="10px" cellspacing="5px" width="100%" border="2"
align="center">
<tr bgcolor="#CCFFFF">

<td align="center">
<a href="users.aspx">users</a>
</td>
<td align="center">
<a href="Booking.aspx">booking</a>
</td>
<td align="center">
<a href="offers.aspx">offers</a>
</td>
<td align="center">
<a href="RestaurantsInfo.aspx">Restaurants</a>
</td>
<td align="center">
<a href="StatusInfo.aspx">Status</a>
</td>
<td align="center">
<a href="admin/home.aspx">Admin</a>
</td>

Department of Computer Science Page 52


Hotel Room Booking

</tr>
</table>
<br />
<br />
<br />
<table cellpadding="10" width="70%" align="right" style="border-width:
4px; border-style: double;
border-color: Green;" bgcolor="#eeeeee">
<tr>
<td>
Hotel Room Booking is an offline hotel software and a hotel
reservation software
that helps you manage reservations, bookings, room stays,
room planning, guests,
accounts, agents, pricing plans, basically front office and
back office hotel operations.
Working with online services instead of installing the
management system in stand
alone computer gives you quick and relevant advantages,
first it is free, second
you do not need to install any system in your computer and
last you do not need
to worry about software or hardware maintenance. The only
thing which is required
is the internet connectivity which is very easy to find out
now days. One of the
most interesting things about the online application is
that the information availability.
Information about whatever thing you want you can get it at
the click of a button.
In our Hotel Room Booking, the information maintained will
be updated one. So the
customer will get the latest information about the pricing,
status of the room,
they even can plan on about the number of days of staying
in the hotel. One can
also get the information about what kind of food one gets
in the hotel.
</td>
</tr>
</table>
<img src="Images/banner_travel_right.gif" width="28%" height="30%" />
<img src="Images/Travel-agents.gif" width="28%" height="30%" />
</div>
</form>
</body>
</html>

Booking:

Department of Computer Science Page 53


Hotel Room Booking

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="booking.aspx.cs"


Inherits="Booking" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor="#f9fcff">
<form id="form1" runat="server">
<div>
<table cellpadding="10" width="100%" style="border-color: Green; border-style: groove;
border-width: 6px; font-size: 25px; font-weight: bolder; color: Red;">
<tr>
<td>
HOTEL ROOM BOOKING</td>
</tr>
</table>
<hr size="10" color="purple" />
<p align="right">
<a href="home.aspx">HOME</a></p>
<br />
<br />
<table cellpadding="10px" border="2" align="center">
<tr>
<td bgcolor="White">
<asp:DetailsView ID="DetailsView1" runat="server" Height="52px" Width="279px"
AutoGenerateRows="False"
CellPadding="4" DataKeyNames="bookingid" DataSourceID="SqlDataSource2"
ForeColor="#333333"
GridLines="None">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<Fields>
<asp:BoundField DataField="bookingid" HeaderText="bookingid"
InsertVisible="False"
ReadOnly="True" SortExpression="bookingid" />
<asp:BoundField DataField="username" HeaderText="username"
SortExpression="username" />
<asp:BoundField DataField="HotelName" HeaderText="HotelName"
SortExpression="HotelName" />
<asp:BoundField DataField="FromDate" HeaderText="FromDate"
SortExpression="FromDate" />
<asp:BoundField DataField="TillDate" HeaderText="TillDate"
SortExpression="TillDate" />
<asp:BoundField DataField="DateofBooking" HeaderText="DateofBooking"
SortExpression="DateofBooking" />
<asp:BoundField DataField="amount" HeaderText="amount"
SortExpression="amount" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

Department of Computer Science Page 54


Hotel Room Booking

</asp:DetailsView>
</td>
</tr>
<tr>
<td>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [booking] WHERE [bookingid] = @bookingid"
InsertCommand="INSERT INTO [booking] ([username], [HotelName], [FromDate], [TillDate],
[DateofBooking], [amount]) VALUES (@username, @HotelName, @FromDate, @TillDate,
@DateofBooking, @amount)"
SelectCommand="SELECT * FROM [booking]"

UpdateCommand="UPDATE [booking] SET [username] = @username, [HotelName] =


@HotelName, [FromDate] = @FromDate, [TillDate] = @TillDate, [DateofBooking] =
@DateofBooking, [amount] = @amount WHERE [bookingid] = @bookingid">
<DeleteParameters>
<asp:Parameter Name="bookingid" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="username" Type="String" />
<asp:Parameter Name="HotelName" Type="String" />
<asp:Parameter Name="FromDate" Type="String" />
<asp:Parameter Name="TillDate" Type="String" />
<asp:Parameter Name="DateofBooking" Type="String" />
<asp:Parameter Name="amount" Type="Double" />
<asp:Parameter Name="bookingid" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="username" Type="String" />
<asp:Parameter Name="HotelName" Type="String" />
<asp:Parameter Name="FromDate" Type="String" />
<asp:Parameter Name="TillDate" Type="String" />
<asp:Parameter Name="DateofBooking" Type="String" />
<asp:Parameter Name="amount" Type="Double" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

AdminRestarants:

Department of Computer Science Page 55


Hotel Room Booking

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RestaurantsInfo.aspx.cs"


Inherits="RestaurantsInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="10" width="100%" style="border-color: Green; border-style: groove;
border-width: 6px; font-size: 25px; font-weight: bolder; color: Red;">
<tr>
<td>
REASTAURANTS INFORMATION SYSTEM
</td>
</tr>
</table>
<hr size="10" color="purple" />
<p align="right">
<a href="home.aspx">HOME</a></p>
<br />
<br />

<table cellpadding="10" align="right">


<tr>
<td>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataKeyNames="RestaurantId" DataSourceID="SqlDataSource1">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<RowStyle BackColor="White" ForeColor="#330099" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowSelectButton="True" />
<asp:BoundField DataField="RestaurantId" HeaderText="RestaurantId"
ReadOnly="True" SortExpression="RestaurantId" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Place" HeaderText="Place" SortExpression="Place" />
<asp:BoundField DataField="Address" HeaderText="Address"
SortExpression="Address" />
<asp:BoundField DataField="Cnumber" HeaderText="Cnumber"
SortExpression="Cnumber" />
<asp:BoundField DataField="EmailId" HeaderText="EmailId"
SortExpression="EmailId" />
<asp:BoundField DataField="Features" HeaderText="Features"
SortExpression="Features" />
</Columns>
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Resturants] WHERE [RestaurantId] =
@RestaurantId"

Department of Computer Science Page 56


Hotel Room Booking

InsertCommand="INSERT INTO [Resturants] ([RestaurantId], [Name], [Place],


[Address], [Cnumber], [EmailId], [Features]) VALUES (@RestaurantId, @Name, @Place, @Address,
@Cnumber, @EmailId, @Features)"
SelectCommand="SELECT * FROM [Resturants]"
UpdateCommand="UPDATE [Resturants] SET [Name] = @Name, [Place] = @Place,
[Address] = @Address, [Cnumber] = @Cnumber, [EmailId] = @EmailId, [Features] = @Features
WHERE [RestaurantId] = @RestaurantId">
<DeleteParameters>
<asp:Parameter Name="RestaurantId" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Place" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="Cnumber" Type="String" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="Features" Type="String" />
<asp:Parameter Name="RestaurantId" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="RestaurantId" Type="Int32" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Place" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="Cnumber" Type="String" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="Features" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<asp:DetailsView runat="server" Width="206px" Height="49px"
AutoGenerateRows="False" BackColor="#CCCCCC" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2"
DataKeyNames="RestaurantId" DataSourceID="SqlDataSource2" ForeColor="Black"
oniteminserted="Unnamed1_ItemInserted">
<FooterStyle BackColor="#CCCCCC" />
<RowStyle BackColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<Fields>
<asp:BoundField DataField="RestaurantId" HeaderText="RestaurantId"
ReadOnly="True" SortExpression="RestaurantId" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Place" HeaderText="Place" SortExpression="Place" />
<asp:BoundField DataField="Address" HeaderText="Address"
SortExpression="Address" />
<asp:BoundField DataField="Cnumber" HeaderText="Cnumber"
SortExpression="Cnumber" />
<asp:BoundField DataField="EmailId" HeaderText="EmailId"
SortExpression="EmailId" />
<asp:BoundField DataField="Features" HeaderText="Features"
SortExpression="Features" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"

Department of Computer Science Page 57


Hotel Room Booking

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"


DeleteCommand="DELETE FROM [Resturants] WHERE [RestaurantId] =
@RestaurantId"
InsertCommand="INSERT INTO [Resturants] ([RestaurantId], [Name], [Place],
[Address], [Cnumber], [EmailId], [Features]) VALUES (@RestaurantId, @Name, @Place, @Address,
@Cnumber, @EmailId, @Features)"
SelectCommand="SELECT * FROM [Resturants] WHERE ([RestaurantId] =
@RestaurantId)"
UpdateCommand="UPDATE [Resturants] SET [Name] = @Name, [Place] = @Place,
[Address] = @Address, [Cnumber] = @Cnumber, [EmailId] = @EmailId, [Features] = @Features
WHERE [RestaurantId] = @RestaurantId">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="RestaurantId"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="RestaurantId" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Place" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="Cnumber" Type="String" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="Features" Type="String" />
<asp:Parameter Name="RestaurantId" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="RestaurantId" Type="Int32" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Place" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="Cnumber" Type="String" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="Features" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

Adminstatus:

Department of Computer Science Page 58


Hotel Room Booking

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StatusInfo.aspx.cs"


Inherits="StatusInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="10" width="100%" style="border-color: Green; border-style: groove;
border-width: 6px; font-size: 25px; font-weight: bolder; color: Red;">
<tr>
<td>
GET STATUS INFORMATION
</td>
</tr>
</table>
<hr size="10" color="purple" />
<p align="right">
<a href="home.aspx">HOME</a></p>
<br />
<br />
<table cellpadding="10px" align="center" style="border-color: Green; border-style: double;
border-width: 4px;">
<tr>
<td>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None"
BorderWidth="1px"
CellPadding="4" DataKeyNames="SNo" DataSourceID="SqlDataSource1"
Height="169px"
Width="385px">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<RowStyle BackColor="White" ForeColor="#330099" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowSelectButton="True" />
<asp:BoundField DataField="SNo" HeaderText="SNo" InsertVisible="False"
ReadOnly="True" SortExpression="SNo" />
<asp:BoundField DataField="BookId" HeaderText="BookId"
SortExpression="BookId" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
</Columns>
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center"
/>
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399"
/>
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Status] WHERE [SNo] = @SNo"

Department of Computer Science Page 59


Hotel Room Booking

InsertCommand="INSERT INTO [Status] ([BookId], [Status], [RoomNo]) VALUES


(@BookId, @Status, @RoomNo)"
SelectCommand="SELECT * FROM [Status]"

UpdateCommand="UPDATE [Status] SET [BookId] = @BookId, [Status] = @Status,


[RoomNo] = @RoomNo WHERE [SNo] = @SNo">
<DeleteParameters>
<asp:Parameter Name="SNo" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="BookId" Type="Int32" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="SNo" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="BookId" Type="Int32" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<asp:DetailsView ID="DetailsView1" runat="server" Height="104px" Width="193px"
AutoGenerateRows="False" BackColor="#CCCCCC" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2"
DataKeyNames="SNo" DataSourceID="SqlDataSource2" ForeColor="Black"
oniteminserted="DetailsView1_ItemInserted">
<FooterStyle BackColor="#CCCCCC" />
<RowStyle BackColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<Fields>
<asp:BoundField DataField="SNo" HeaderText="SNo" InsertVisible="False"
ReadOnly="True" SortExpression="SNo" />
<asp:BoundField DataField="BookId" HeaderText="BookId"
SortExpression="BookId" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Status] WHERE [SNo] = @SNo"
InsertCommand="INSERT INTO [Status] ([BookId], [Status], [RoomNo]) VALUES
(@BookId, @Status, @RoomNo)"
SelectCommand="SELECT * FROM [Status] WHERE ([SNo] = @SNo)"

UpdateCommand="UPDATE [Status] SET [BookId] = @BookId, [Status] = @Status,


[RoomNo] = @RoomNo WHERE [SNo] = @SNo">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="SNo"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>

Department of Computer Science Page 60


Hotel Room Booking

<DeleteParameters>
<asp:Parameter Name="SNo" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="BookId" Type="Int32" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="SNo" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="BookId" Type="Int32" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

Department of Computer Science Page 61


Hotel Room Booking

Sample Coding C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class StatusInfo : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void DetailsView1_ItemInserted(object sender,
DetailsViewInsertedEventArgs e)
{
GridView1.DataBind();
}
}

Department of Computer Science Page 62


Hotel Room Booking

7. System Testing
SYSTEM TESTING AND IMPLEMENTATION

INTRODUCTION

Software testing is a critical element of software quality assurance and


represents the ultimate review of specification, design and coding. In fact, testing is
the one step in the software engineering process that could be viewed as destructive
rather than constructive.

A strategy for software testing integrates software test case design methods
into a well-planned series of steps that result in the successful construction of
software. Testing is the set of activities that can be planned in advance and conducted
systematically. The underlying motivation of program testing is to affirm software
quality with methods that can economically and effectively apply to both strategic to
both large and small-scale systems.

STRATEGIC APPROACH TO SOFTWARE TESTING

The software engineering process can be viewed as a spiral. Initially system


engineering defines the role of software and leads to software requirement analysis
where the information domain, functions, behavior, performance, constraints and
validation criteria for software are established. Moving inward along the spiral, we
come to design and finally to coding. To develop computer software we spiral in
along streamlines that decrease the level of abstraction on each turn.

A strategy for software testing may also be viewed in the context of the spiral.
Unit testing begins at the vertex of the spiral and concentrates on each unit of the
software as implemented in source code. Testing progress by moving outward along
the spiral to integration testing, where the focus is on the design and the construction
of the software architecture. Talking another turn on outward on the spiral we
encounter validation testing where requirements established as part of software
requirements analysis are validated against the software that has been constructed.
Finally we arrive at system testing, where the software and other system elements are
tested as a whole.

Department of Computer Science Page 63


Hotel Room Booking

UNIT TESTING

MODULE TESTING

Component Testing SUB-SYSTEM TESING

SYSTEM TESTING
Integration Testing

ACCEPTANCE TESTING

User Testing

Department of Computer Science Page 64


Hotel Room Booking

8.3. UNIT TESTING

Unit testing focuses verification effort on the smallest unit of software design,
the module. The unit testing we have is white box oriented and some modules the
steps are conducted in parallel.

1. WHITE BOX TESTING


This type of testing ensures that

 All independent paths have been exercised at least once


 All logical decisions have been exercised on their true and false sides
 All loops are executed at their boundaries and within their operational bounds
 All internal data structures have been exercised to assure their validity.
To follow the concept of white box testing we have tested each form .we have
created independently to verify that Data flow is correct, All conditions are exercised
to check their validity, All loops are executed on their boundaries.

2. BASIC PATH TESTING

Established technique of flow graph with Cyclomatic complexity was used to derive
test cases for all the functions. The main steps in deriving test cases were:

Use the design of the code and draw correspondent flow graph.

Determine the Cyclomatic complexity of resultant flow graph, using formula:

V(G)=E-N+2 or

V(G)=P+1 or

V (G) =Number Of Regions

Where V (G) is Cyclomatic complexity,

E is the number of edges,

N is the number of flow graph nodes,

P is the number of predicate nodes.

Department of Computer Science Page 65


Hotel Room Booking

Determine the basis of set of linearly independent paths.

3. CONDITIONAL TESTING

In this part of the testing each of the conditions were tested to both true and
false aspects. And all the resulting paths were tested. So that each path that may be
generate on particular condition is traced to uncover any possible errors.

4. DATA FLOW TESTING

This type of testing selects the path of the program according to the location of
definition and use of variables. This kind of testing was used only when some local
variable were declared. The definition-use chain method was used in this type of
testing. These were particularly useful in nested statements.

5. LOOP TESTING

In this type of testing all the loops are tested to all the limits possible. The
following exercise was adopted for all loops:
 All the loops were tested at their limits, just above them and just below them.
 All the loops were skipped at least once.
 For nested loops test the inner most loop first and then work outwards.
 For concatenated loops the values of dependent loops were set with the help of
connected loop.
 Unstructured loops were resolved into nested loops or concatenated loops and
tested as above.

Department of Computer Science Page 66


Hotel Room Booking

8. Results and Report


1.Name of the Test Case: Admin Login Page

Test Pass
Test Case Expected
Case / Actual Results
Description Results
# Fail
It should be
It has opened
open login
Click on login proper login
01 page without Pass
button page, by clicking
missing any
the login button
themes
Click on login It has showing
It should be
button without error message
ask for enter
02 giving Pass for “enter
username &
username & username &
password
password password”
Enter It has displayed
It should be
username error message
03 ask for enter Pass
without for “enter
password
password password”
Enter It has displayed
It should be
password error message
04 ask for enter Pass
without for “enter
username
username username”

It should be
It has displayed
show
Enter invalid error message
message for
05 username & Pass for “please enter
invalid
password valid username
username &
& password”
password

Enter valid It should be


It has redirected
06 username & redirect to Pass
to other page
password other page

Department of Computer Science Page 67


Hotel Room Booking

2.Name of the Test Case: Registration Page

Test
Test Case Expected Pass /
Case Actual Results
Description Results Fail
#
It has tallied
It should tally with the values
with the values in the database
Click on
01 in the database Pass and showed it’s
check button
and show it’s correct by
correct or not. clicking check
button.
Click on
It has showing
check button It should ask
error message
02 without for enter all Pass
for “enter all
filling few the details.
data”
fields
It should ask
It has displayed
for Email id
Enter wrong error message
03 incorrect after Pass
email id that “Enter valid
clicking check
Email”
button.
It should ask
It has displayed
Enter Same for Username
error message
04 User name exist after Pass
that “This user
twice clicking check
already exist”.
button.
Click on
submit It has displayed
It should ask
button error message
05 for enter all Pass
without for “enter all
details.
entering all details”.
details.
It has saved all
It should save
Click on the data and
all the data
submit showed the
and show
06 button Pass message
Member
entering all “Member
registered
details. registered
successfully.
successfully”.

Department of Computer Science Page 68


Hotel Room Booking

9. System Maintains
We have to maintain the software until the software handover to the client. within
the estimation of cost only we have to over the project according to the user
requirements. Software maintenance is widely accepted part of SDLC now a days. It
stands for all the modifications and updating done after the delivery of software
product. There are number of reasons, why modifications are required, some of them
are briefly mentioned below:

 Market Conditions - Policies, which changes over the time, such as taxation
and newly introduced constraints like, how to maintain bookkeeping, may
trigger need for modification.

 Client Requirements - Over the time, customer may ask for new features or
functions in the software.

 Host Modifications - If any of the hardware and/or platform (such as


operating system) of the target host changes, software changes are needed to
keep adaptability.

 Organization Changes - If there is any business level change at client end,


such as reduction of organization strength, acquiring another company,
organization venturing into new business, need to modify in the original
software may arise.

Department of Computer Science Page 69


Hotel Room Booking

10. Conclusion

The system of the room booking is online; where a traveler needs not to go the hotel
for the purpose of the room booking it can be done with the help of a click of button if
you have the internet connection. Room availability of the different hotels with the
cost is known very easily and no time is wastage for their travelling purpose.

Department of Computer Science Page 70


Hotel Room Booking

11. Facture Enhancement

The hotel management web application of computer technology has more features,
which gives a lot of advances facilities. The tool should be able to manage all the rooms and
hotel customers details maintain effectively and ensure that payment cycle goes on smoothly
and they are completed on time. While accepting customer details, all necessary validations
should be performed.

Department of Computer Science Page 71


Hotel Room Booking

References
http://www.wikepedia.com

http://aps.net

http://www.google.co.in

Department of Computer Science Page 72

You might also like