jatinder final report

110
HOME DESIGN HAVEN A Major Project Report submitted in partial fulfillment of the Requirements for the award of the degree Of Bachelor of Technology In COMPUTER SCIENCE AND ENGINEERING UNDER GUIDENCE OF Er. Ajit Singh By Name of Student (Jatinder kaur) Class –B.TECH (CSE) Univ Roll No.100960334980 1

Upload: mt-ra

Post on 13-May-2017

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Jatinder Final Report

HOME DESIGN HAVEN

A Major Project Report

submitted in partial fulfillment of theRequirements for the award of the degree

Of

Bachelor of Technology

InCOMPUTER SCIENCE AND ENGINEERING

UNDER GUIDENCE OFEr. Ajit Singh

ByName of Student (Jatinder kaur)

Class –B.TECH (CSE)Univ Roll No.100960334980

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERINGSURYA SCHOOL OF ENGINEERING AND TECHNOLOGY,BAPROR

April, 2014

1

Page 2: Jatinder Final Report

CERTIFICATE

I hereby certify that the work which is being presented in the B.Tech. Major

Project Report entitled “HOME DESIGN HAVEN”, in partial fulfilment of the

requirements for the award of the Bachelor of Technology in Computer Science &

Engineering and submitted to the Department of Computer Science & Engineering of

Surya World Institutions of Academic Excellence Rajpura PB is an authentic record of

my own work carried out during a period from January 2014 to April 2014 under the

supervision of ER. Ajit singh, CSE Department.

The matter presented in this project has not been submitted by me for the award

of any other degree elsewhere.

Signature of Candidate

Jatinder kaur

R.No. 100960334980

This is to certify that the above statement made by the candidate is

correct to the knowledge

Signature of Supervisor(s)

Date: 17 April 2014

HeadDepartment of Computer Science & EngineeringSurya World Institutions of Academic Excellence , Bapror , Rajpura

2

Page 3: Jatinder Final Report

CANDIDATE'S DECLARATION CERTIFICATE

I hereby certify that the work which is being presented in the report entitled “Home Design Haven” (Online Shopping by “Jatinder kaur” in partial fulfillment of requirements for the award of degree of B.Tech. (Computer science) submitted to Punjab Technical University, Department of Computer Science & Engineering at Surya College of Engineering and Technology, Rajpura under PUNJAB TECHNICAL UNIVERSITY, JALANDHAR is an authentic record of my own work carried out during a period from January 2014 to April 2014 under the supervision of Er. Ajit singh.

Signature of the Student(Jatinder kaur)

This is to certify that the above statement made by the candidate is correct to the best of my/our knowledge.

3

Page 4: Jatinder Final Report

ACKNOWLEDGMENT

I am highly grateful to the Reenu Sharma, HOD CSE, Surya College of Engineering & Technology, Rajpura, for minor project.

I would like to expresses my gratitude to other faculty members of Computer Science & Engineering department of SSET, Rajpura for providing academic inputs, guidance & encouragement throughout this period.

The help rendered by Jatinder kaur, Supervisor (Er.Ajit singh) for experimentation is greatly acknowledged.

Finally, I express my indebtedness to all who have directly or indirectly contributed to the successful completion of my industrial training.

JATINDER

4

Page 5: Jatinder Final Report

Abstract of Project

The project “Home Design Haven.Com” is a part of our 6 month degree course as per under the norms and regulations of the Punjab Technical University, Jalandhar. Home Design Haven.Com is an online shopping website. It is a website which is used to sell items room’s product like livingroom, dinningroom, bedroom, washroom, kidsroom, kitchen product, window and stairs and see interior and exterior designs etc. Online shopping is the process whereby consumers directly buy goods, services etc. from a seller interactively in real-time without an intermediary service over the internet.

This project aims to provide shopping cart solutions to all types of customers over the internet world. User should register first before going to buy any item using this Website. Web forms included in this web application are Admin Panel which includes pages like Add New Product, Update Product, Delete Product, Manage Home Page, and Manage Orders. Another Web Forms are Home, Product, Gallery, About Us, Contact Us, My Cart, Login, Buyer Details, Display Products, Forgot Password, User Registration, and Shipping.

This system is all about the converting the shopping system from manual to online. Customer can buy products online after login to the site. Administrator can add product to database. Administrator can edit or delete the products from the database. This project is aimed at developing a Web application that depicts online Shopping of electronic items. Using this software, companies can improve the efficiency of their services. Online Shopping is one of the applications to improve the marketing of the company’s products. This web application involves all the features of the online shopping.

5

Page 6: Jatinder Final Report

LIST OF TABLES

TABLE NO TABLE NAME PAGE NO

TABLE 1 TYPES OF VARIABLES

17

TABLE 2 ACCESSIBILITIES 20

TABLE 3 CLASSES 34

TABLE 4 CLASSES 34

6

Page 7: Jatinder Final Report

LIST OF FIGURES

FIG NO. FIG NAME PAGE NO.

1.1 The .Net Framework 12

1.2 Output for Simple Program in C# 15

1.3 Output for A Program to build a Pyramid 19

1.4 Output for A Program for Exception Handling 25

1.5 Output for A Program for Threading 26

1.6 New project Dialog Box 27

1.7 A new Windows Application 28

1.8 A new Form 28

1.9 Solution Explorer 29

1.10 Debugging 32

1.11 Traditional Data Access Architecture 33

1.12 ADO.NET Disconnected Data Access Architecture 33

2.1 SDLC Phases 56

2.2 Level 0 DFD 56

2.3 Level 1 DFD 57

2.4 Shopping Proccess 58

2.5 Home 59

2.6 Product Page 60

2.7 Testimonial 61

2.8 Gallery 62

7

Page 8: Jatinder Final Report

2.9 Product Description 63

2.10 Login/Register 64

2.11 Welcome User 65

2.12 Cart 66

2.13 Buy Now 67

2.14 Buyer Details 68

2.15 Order 69

2.16 About Us 70

2.17 Contact Us 71

2.18 Admin Login 72

2.19 Add New Product 73

2.20 Update Product 74

2.21 Delete Product 75

2.22 Manage Orders 76

2.23 Manage Home 77

2.24 Forgot Password 78

2.25 Product Table 79

2.26 Cart Table 80

2.27 Register Table 81

2.28 Orders Table 82

8

Page 9: Jatinder Final Report

INDEX

SNO CONTENT PAGE NO

1 ) TRAINING REPORT 11

1.1 .NET FRAME WORK 11

1.2 ADVANTAGES OF .NET FRAMEWORK

12

1.3 DISADVANTAGES OF .NETFRAMEWORK

13

1.4 C# LANGUAGE 13

1.5 A SIMPLE C# PROGRAM 14

1.6 A CONSOLE APPLICATION 16

1.7 WINDOW APPLICATION 26

1.8 ASP.NET 36

2) ABOUT PROJECT 47

2.1 INTRODUCTION 47

2.2 PURPOSE 48

2.3 OBJECTIVE 49

2.4 PROJECT DESCRIPTION 50

2.5 ASSUMPTIONS &DEPENDENCY 50

2.6 MODULES 50

2.7 SDLC 51

9

Page 10: Jatinder Final Report

2.8 DATA FLOW DIAGRAM 55

2.9 PROCCESS DETAILS 58

2.10 DESIGN OF THE SITE 59

2.11 DATABASE 79

3) PROBLEM REPORT 83

3.1 LIST OF PROBLEMS FACED DURING THE PROJECT

83

3.2 SOLUTION TO THE PROBLEMS 84

3.3 FUTURE SCOPE 84

4) REFERENCE 86

10

Page 11: Jatinder Final Report

CHAPTER 1-TRAINING REPORT1 .1 .NET Framework .NET is essentially a framework for software development. It is similar in nature to any other software development framework (J2EE etc) in that it provides a set of runtime containers/capabilities, and a rich set of pre-built functionality in the form of class libraries and APIs.

The .NET Framework is an environment for building, deploying, and running Web Services and other applications.

.Net is the Microsoft Web services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services.

.Net-connected solutions enable businesses to integrate their systems more rapidly and in a more agile manner and help them realize the promise of information anytime, anywhere, on any device. The Microsoft platform includes everything a business needs to develop and deploy a Web service-connected IT architecture: servers to host Web services, development tools to create them, applications to use them, and a worldwide network of more than 35,000 Microsoft Certified Partner organizations to provide any help you need. 

The .NET Framework is divided into two main components:

The .NET Framework Class Library The Common Language Runtime

The .NET Framework Class Library consists of segments of pre-written code called classes that provide many of the functions that you need for developing .NET applications. For instance, the Windows Forms classes are used for developing Windows Forms applications. The ASP.NET classes are used for developing Web Forms

11

Page 12: Jatinder Final Report

applications. And other classes let you work with databases, manage security, access files, and perform many other functions.

Although it’s not apparent in this figure, the classes in the .NET Framework Class Library are organized in a hierarchical structure. Within this structure, related classes are organized into groups called namespaces. Each namespace contains the classes used to support a particular function. For example, the System.Windows.Forms namespace contains the classes used to create forms and the System.Data namespace contains the classes you use to access data.

The Common Language Runtime, or CLR, provides the services that are needed for executing any application that’s developed with one of the .NET languages. This is possible because all of the .NET languages compile to a common intermediate language.

The CLR also provides the Common Type System that defines the data types that are used by all the .NET languages. That way, you can use more than one of the .NET languages as you develop a single application without worrying about incompatible data types.

12

Page 13: Jatinder Final Report

Fig: 1.1 The .Net Framework

1.2 Advantages of .Net Framework1. Multi Language Platform (C, C++, C# ,J#, F#).2. Supports both windows and web applications.3. Code reusability.4. Drag and drop facility.5. Easy to write code.

1.3 Disadvantages of .Net Framework1. Platform dependent.2. Only Microsoft windows can support .Net. Linux and Mac do not support.Net or any of its applications.

1.4 C# (sharp) languagez

C# (pronounced “See Sharp”) is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, and Java programmers. C# is standardized by ECMA International as the ECMA-334 standard and by ISO/IEC as the ISO/IEC 23270 standard. Microsoft’s C# compiler for the .NET Framework is a conforming implementation of both of these standards. C# is an object-oriented language, but C# further includes support for component-oriented programming. Contemporary software design increasingly relies on software components in the form of self-contained and self-describing packages of functionality. Key to such components is that they present a programming model with properties, methods, and events; they have attributes that provide declarative information about the component; and they incorporate their own documentation. C# provides language constructs to directly support these concepts, making C# a very natural language in which to create and use software components.

Several C# features aid in the construction of robust and durable applications:

Garbage collection: Automatically reclaims memory occupied by unused objects;

Exception handling Provides a structured and extensible approach to error detection and recovery

Type-safe13

Page 14: Jatinder Final Report

Design of the language makes it impossible to have uninitialized variables, to index arrays beyond their bounds, or to perform unchecked type casts.

C# has a unified type system . All C# types, including primitive types such as int and double , inherit from a single root object type. Thus, all types share a set of common operations, and values of any type can be stored, transported, and operated upon in a consistentmanner. Furthermore, C# supports both user-defined reference types and value types, allowing dynamic allocation of objects as well as in-line storage of lightweight structures.To ensure that C# programs and libraries can evolve over time in a compatible manner, much emphasis has been placed on versioning in C#’s design. Many programming languages pay little attention to this issue, and, as a result, programs written in those languages break more often than necessary when newer versions of dependent libraries are introduced.Aspects of C#’s design that were directly influenced by versioning considerations include the separate virtual and override modifiers, the rules for method overload resolution, and support for explicit interface member declarations.

1.5 A Simple C# Programusing System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace ConsoleApplication1{ class Program { static void Main(string[] args) { string a; Console.WriteLine("Enter your name :"); a = Convert.ToString(Console.ReadLine()); Console.WriteLine("HELLO " + a); Console.ReadLine(); } }}

14

Page 15: Jatinder Final Report

OUTPUT :

Fig: 1.2 Output for Simple Program in C#

The "using" DirectiveThe first line of the above program is using a directive, which declares that the current file can use members of the indicated namespace without using the member's fully qualified name. Without this directive, all references to the identifier "Console" would have to be preceded by "System" and a period, because Console is a member of the System namespace All datatypes in .NET must be declared as a member of a namespace.

Namespace DeclarationThe line that reads "namespace ConsoleApplication1 ", declares that anything declared within the curly braces is a member of the " ConsoleApplication1" namespace. Class Definition

15

Page 16: Jatinder Final Report

The code within the namespace declaration defines a public class named "Program" that has a single static method named "Main". The method is the entry point of the application .

Body of the Main MethodThe body of the method is a series of statements seperated by semicolons. The body make use of two methods of the Console class, ReadLine and WriteLine. The ReadLine method accepts one line of keyboard input from the user, and returns the entered text as a string. The WriteLine method writes text to the screenThe final line of the method is a bit of a hack that ensures that the program stays running until the user hits the "Enter" key.

1.6 A Console Application A console application is an application that runs in a console window same as a C and C++ program. It doesn’t have any graphical user interface. Console Applications will have character based interface.  To work with console applications in .NET you have to use a class called Console that is available within the namespace  System, which is the root namespace.

1.6.1 Console Application in C#To read a line of text from the console window, you use the Console.ReadLine() method. This will read an input stream from the console window and return the input string when user presses the EnterKey.

There are also two methods for writing to the console, which are used extensivelyConsole.Write() — Writes the specified value to the console window.Console.WriteLine() — This does the same, but adds a newline character at the end of the output.

1.6.2 VariablesThere are two kinds of types in C#: value types and reference types. Variables of value types directly contain their data whereas variables of reference types store references to their data, the latter being known as objects. With reference types, it is possible for two variables to reference the same object and thus possible for operations on one variable to affect the object referenced by the other variable.

Type of Variable Possible Contents

Value type A value of that exact type16

Page 17: Jatinder Final Report

Object A null reference, a reference to an object of any reference type, or a reference to a boxed value of any value type

Class type A null reference, a reference to an instance of that class type, or a reference to an instance of a class derived from that class type

Interface type A null reference, a reference to an instance of a class type that implements that interface type, or a reference to a boxed value of a value type that implements that interface type

Array type A null reference, a reference to an instance of that array type, or a reference to an instance of a compatible array type

Delegate type A null reference or a reference to an instance of that delegate type

Table 1-TYPES OF VARIABLES

1.6.3 S tatements The actions of a program are expressed using statements. C# supports several different kinds of statements, a number of which are defined in terms of embedded statements. A block permits multiple statements to be written in contexts where a single statement is allowed. A block consists of a list of statements written between the delimiters { and }.

Declaration statements are used to declare local variables and constants. Expression statements are used to evaluate expressions. Expressions that can be used

as statements include method invocations, object allocations using the new operator, assignments using = and the compound assignment operators, and increment and decrement operations using the ++ and -- operators.

Selection statements are used to select one of a number of possible statements for execution based on the value of some expression. In this group are the if and switch statements.

Iteration statements are used to repeatedly execute an embedded statement. In this group are the while, do, for, and for each statements.

Jump statements are used to transfer control. In this group are the break, continue, goto, throw, and return statements.

The try-catch statement is used to catch exceptions that occur during execution of a block, and the try-finally statement is used to specify finalization code that is always executed, whether an exception occurred or not.

17

Page 18: Jatinder Final Report

1.6.4 A Program to build a Pyramidusing System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace Pyramid{ class Program { static void Main(string[] args) { int i, j, k; for (i = 1; i <= 10; i++) { for (k = 10; k >=i; k--) { Console.Write(" "); } for (j = 1; j <= i; j++) { Console.Write(j + " "); } Console.WriteLine(); } Console.ReadLine(); } }}

18

Page 19: Jatinder Final Report

Output:

Fig: 1.3 Output for A Program to build a Pyramid

1.6.5 Classes and objectsClasses are the most fundamental of C#’s types. A class is a data structure that combines state (fields) and actions (methods and other function members) in a single unit. A class provides a definition for dynamically created instances of the class, also known as objects. Classes support inheritance and polymorphism, mechanisms whereby derived classes can extend and specialize base classes.

New classes are created using class declarations. A class declaration starts with a header that specifies the attributes and modifiers of the class, the name of the class, the base class (if any), and the interfaces implemented by the class. The header is followed by the class body, which consists of a list of member declarations written between the delimiters { and }.

The following is a declaration of a simple class named Point:public class Point

19

Page 20: Jatinder Final Report

{public int x, y;

public Point(int x, int y) {this.x = x;this.y = y;}}

AccessibilityEach member of a class has an associated accessibility, which controls the regions of program text that are able to access the member. There are five possible forms of accessibility.

These are summarized in the following table.

Accessibility Meaning

Public Access not limited

Protected Access limited to this class and classes derived from this class

Internal Access limited to this program

protected internal Access limited to this program and classes derived from this class

Private Access limited to this class

Table 2-ACCESSIBILITY

1.6.6 Methods

20

Page 21: Jatinder Final Report

A method is a member that implements a computation or action that can be performed by an object or class. Static methods are accessed through the class. Instance methods are accessed through instances of the class.

Methods have a (possibly empty) list of parameters, which represent values or variable references passed to the method, and a return type, which specifies the type of the value computed and returned by the method. A method’s return type is void if it does not return a value.

P a r ameters Parameters are used to pass values or variable references to methods. The parameters of a method get their actual values from the arguments that are specified when the method is invoked. There are four kinds of parameters: value parameters, reference parameters, out-put parameters, and parameter arrays.

A value parameter is used for input parameter passing. A value parameter corresponds to a local variable that gets its initial value from the argument that was passed for the parameter. Modifications to a value parameter do not affect the argument that was passed for the parameter.

A reference parameter is used for both input and output parameter passing. The argument passed for a reference parameter must be a variable, and during execution of the method, the reference parameter represents the same storage location as the argument variable. A reference parameter is declared with the ref modifier. The following example shows the use of ref parameters.Static FunctionsStatic functions are the classes which are defined using keyword static. There are no dynamic values in static functions. These classes are no need to define any object these can be called directly by the class name.

Syntax for static function: Public static void sum(){Int a=20, int b=10;Int c= a+b;Console.writeline(c);}

1.6.7 Inheritance

21

Page 22: Jatinder Final Report

Classes can inherit from another class. This is accomplished by putting a colon after the class name when declaring the class, and naming the class to inherit from—the base class—after the colon, as follows:C#public class A{ public A() { }}

public class B : A{ public B() { }}

The new class—the derived class—then gains all the non-private data and behavior of the base class in addition to any other data or behaviors it defines for itself. The new class then has two effective types: the type of the new class and the type of the class it inherits.

In the example above, class B is effectively both B and A. When you access a B object, you can use the cast operation to convert it to an A object. The B object is not changed by the cast, but your view of the B object becomes restricted to A's data and behaviors. After casting a B to an A, that A can be cast back to a B. Not all instances of A can be cast to B—just those that are actually instances of B. If you access class B as a B type, you get both the class A and class B data and behaviors. The ability for an object to represent more than one type is called polymorphism

1.6.8 ConstructorsC# supports both instance and static constructors. An instance constructor is a member that implements the actions required to initialize an instance of a class. A static constructor is a member that implements the actions required to initialize a class itself when it is first loaded.

A constructor is declared like a method with no return type and the same name as the con- taining class. If a constructor declaration includes a static modifier, it declares a static constructor. Otherwise, it declares an instance constructor.

Syntax for constructors:Public classname(){

22

Page 23: Jatinder Final Report

//body of constructor;}

1.6.9 DestructorsA destructor is a member that implements the actions required to destruct an instance of a class. Destructors cannot have parameters, they cannot have accessibility modifiers, and they cannot be invoked explicitly. The destructor for an instance is invoked automatically during garbage collection.

The garbage collector is allowed wide latitude in deciding when to collect objects and run destructors. Specifically, the timing of destructor invocations is not deterministic, and destructors may be executed on any thread. For these and other reasons, classes should implement destructors only when no other solutions are feasible.

1.6.10 Ar r ays An array is a data structure that contains a number of variables that are accessed through computed indices. The variables contained in an array, also called the elements of the array, are all of the same type, and this type is called the element type of the array.Array types are reference types, and the declaration of an array variable simply sets aside space for a reference to an array instance. Actual array instances are created dynamically at runtime using the new operator. The new operation specifies the length of the new array instance, which is then fixed for the lifetime of the instance.

Syntax for declaration of array:Int [] a= new int [5];

1.6.11 InterfacesAn interface defines a contract that can be implemented by classes and structs. An interface can contain methods, properties, events, and indexers. An interfaces does not provide implementations of the members it defines—it merely specifies the members that must be supplied by classes or structs that implement the interface.

1.6.12 Exception handlingThe C# language's exception handling features help you deal with any unexpected or exceptional situations that occur when a program is running. Exception handling uses the try, catch, and finally keywords to try actions that may not succeed, to handle failures when you decide that it is reasonable to do so, and to clean up resources afterward. Exceptions can be generated by the common language runtime (CLR), by

23

Page 24: Jatinder Final Report

the .NET Framework or any third-party libraries, or by application code. Exceptions are created by using the throw keyword.Exceptions have the following properties:

Exceptions are types that all ultimately derive from System. Exception. Use a try block around the statements that might throw exceptions. Once an exception occurs in the try block, the flow of control jumps to the first

associated exception handler that is present anywhere in the call stack. In C#, the catch keyword is used to define an exception handler.

If no exception handler for a given exception is present, the program stops executing with an error message.

Do not catch an exception unless you can handle it and leave the application in a known state. If you catch System. Exception, re throw it using the throw keyword at the end of the catch block.

If a catch block defines an exception variable, you can use it to obtain more information about the type of exception that occurred.

Exceptions can be explicitly generated by a program by using the throw keyword.

Exception objects contain detailed information about the error, such as the state of the call stack and a text description of the error.

Code in a finally block is executed even if an exception is thrown. Use a finally block to release resources, for example to close any streams or files that were opened in the try block.

A program for Exception Handling:using System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace Exception_Handling{ class Program { static void Main(string[] args) { try { int a = 1; int b = 0;

24

Page 25: Jatinder Final Report

int c = a / b; Console.WriteLine(c); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadLine(); } }}

Output:

Fig: 1.4 Output for A Program for Exception Handling

1.6.13 ThreadingA thread is a sequence of instructions executed within the context of a process. Multi Threading is achieved when a  program uses multiple execution threads allowing each thread to share the CPU concurrently depending on the priority assigned to these threads. This helps in the optimum usage of System Resources. Our application shows how multiple threads (in our case two) run on different level of priorities. We will discuss the whole program part by part.

A Program for threadingusing System;

25

Page 26: Jatinder Final Report

using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;

namespace Threading{ class Program { static void Main(string[] args) { for (int i = 1; i < 11; i++) { Thread.Sleep(1000); Console.WriteLine(i); } Console.ReadLine(); } }}

Output:

Fig: 1.5 Output for A Program for Threading

26

Page 27: Jatinder Final Report

1.7 Windows applicationWindows Forms (WinForms) is the name given to the graphical application programming interface (API) included as a part of Microsoft .NET Framework, providing access to native Microsoft Windows interface elements by wrapping the extant Windows API in managed code.While it is seen as a replacement for the earlier and more complexC++ based Microsoft Foundation Class Library, it does not offer a paradigm comparable to Model–View–Controller.

Some after-market and third party libraries have been created to provide this functionality. The most widely used of these is the User Interface Process Application Block, which is released by the Microsoft patterns & practices group as a free download that includes the source code for quick start examples.

1.7.1 To create a C# Windows applicationThe Form is blank at first. You then add control to your form, things like buttons, text boxes, menus, check boxes, radio buttons, etc. To get your first look at a Windows Form, do the following.

If you still have your Console Application open from the previous section, click File from the menu bar at the top of Visual C# Express. From the File menu, click on Close Solution.

To create your first Windows form project, click the File menu again. This time, select New Projectfrom the menu. When you do, you'll see the New Project dialogue box again:

27

Page 28: Jatinder Final Report

Fig: 1.6 New project Dialog BoxIn all versions, select Windows Forms Application (or Windows Application in earlier versions) from the available templates. Keep the Name on the default of WindowsFormsApplication1 and then click OK.

When you click OK, a new Windows Application project will be created for you:

Fig: 1.7 A new Windows Application

The obvious difference from the Console Application you created in the previous section is the blank Form in the main window. Notice the Toolbox, though, on the left hand

28

Page 29: Jatinder Final Report

side. We'll be adding controls from the Toolbox to that blank Form1 you can see in the image above.

If you can't see the Toolbox, you may just see the Tab, as in the following image:

Fig: 1.8 A new FormIf your screen looks like the one above, move your mouse over to the Toolbox tab. It will expand to look like the first one. If you want to permanently display the Toolbox, click on the pin symbol:

Notice the Solution Explorer on the right side of your screen. (If you can't see the Solution Explorer, click its entry on the View menu at the top of Visual C# Express.) If you compare it with the Solution Explorer when you created your Console Application, you'll see there's only one difference - the Form.

    Fig: 1.9 Solution Explorer

We still have the Properties, the References and the Program.cs file. Double click the Program.cs file to open it, and you'll see some familiar code:And here's the code from the Console Application:

29

Page 30: Jatinder Final Report

Both have the same using lines, a namespace, a class called Program, and a Main Method.

The Main Method is the entry point for your programme. The code between the curly brackets of Main will get executed when the programme first starts. The last line in the WindowsApplication1 code above is the one that Runs Form1 when the Application starts.

You can do other things here. For example, suppose you had a programme that connects to a server. If it finds a connection then it loads some information from a database. In the Main Method, you could check that the server connection is OK. If it's not, display a second form; if it's OK, then display the first form.But don't worry if all that code has you scratching your head. The thing to bear in mind here is that a method called Main starts your programme. And Program.cs in the Solution Explorer on the right is where the code for Main lives.But we won't be writing code in the Program.cs file, so we can close it. Have a look near the top of the coding window, and you'll some tabs:

Right click the Program.cs tab and select Close from the menu that appears. You should now see your form again (you may have a Start tab as well. You can close this, if you want).

The menu has options for View Code and View Designer. The Designer is the Form you can see at the moment. Click View Code from the menu to see the following

30

Page 31: Jatinder Final Report

window appear (you can also press the F7 key on your keyboard in earlier versions, and CTRL + ALT + 0 in version 2012):

The code has a lot more using statements than before. Don't worry about these for now. They just mean "using some code that's already been written".The code also says partial class Form1. It's partial because some code is hidden from you. To see the rest of it (which we don't need to alter), click the plus symbol next to Form1.cs in the Solution Explorer:

Now double click Form1.Designer.cs. You'll see the following code:

Again, you see partial class Form1, which is the rest of the code. Click the plus symbol next toWindows Form Designer generated code. You'll see the following:

31

Page 32: Jatinder Final Report

InitializeComponent is code (a Method) that is automatically generated for you when you create a new Windows Application project. As you add things like buttons and text boxes to your form, more code will be added here for you.

But you don't need to do anything in this window, so you can right click the Form1.Designer.cs tab at the top, and click Close from the menu.Click back on the Form1.cs tab at the top to see you form again. If the tab is not there, right click Form1.cs in the Solution Explorer on the right. From the menu, select View Designer. Here's what you should be looking at:

It's in Designer view that we'll be adding things like buttons and text boxes to our form. But you can run this programme as it is. From the Debug menu at the top, click Start Debugging (Or you can just press the F5 key on your keyboard.)When you click Start Debugging, Visual C# will Build the programme first, and then run it, if it can. If it can't run your programme you'll see error messages.But you should see your form running on top of Visual Studio. It will have its own Red X, and it's own minimize and maximize buttons. Click the Red X to close your programme, and to return to Visual C# Express.

From now on, when we say Run your programme, this is what we mean: either press F5, or clickDebug > Start Debugging.

Fig: 1.10 Debugging

1 .7.2 Database Databases are designed to offer an organized mechanism for storing, managing and retrieving information. They do so through the use of tables. If you’re familiar with

32

Page 33: Jatinder Final Report

spreadsheets like Microsoft Excel, you’re probably already accustomed to storing data in tabular form. It’s not much of a stretch to make the leap from spreadsheets to databases.

1 .7.3 Database Tables Just like Excel tables, database tables consist of columns and rows. Each column contains a different type of attribute and each row corresponds to a single record. For example, imagine that we were building a database table that contained names and telephone numbers. We’d probably set up columns named “First Name”, “Last Name” and “Telephone Number.” Then we’d simply start adding rows underneath those columns that contained the data we’re planning to store. If we were building a table of contact information for our business that has 50 employees, we’d wind up with a table that contains 50 rows.

1.7.4 Introducing ADO.NETMost of today's applications need to interact with database systems to persist, edit or view data. In .NET, data access services are provided through ADO.NET components. ADO.NET is an object oriented framework that allows you to interact with database systems. We usually interact with database systems through SQL queries or stored procedures. The best thing about ADO.NET is that it is extremely flexible and efficient. ADO.NET also introduces the concept of disconnected data architecture. In traditional data access components, you made a connection to the database system and then interacted with it through SQL queries using the connection. The application stays connected to the DB system even when it is not using DB services. This commonly wastes valuable and expensive database resources, as most of the time applications only query and view the persistent data. ADO.NET solves this problem by managing a local buffer of persistent data called a data set. Your application automatically connects to the database server when it needs to run a query and then disconnects immediately after getting the result back and storing it in the dataset. This design of ADO.NET is called disconnected data architecture and is very much similar to the connectionless services of HTTP on the internet. It should be noted that ADO.NET also provides connection oriented traditional data access services.

Another important aspect of disconnected architecture is that it maintains a local repository of data in the dataset object. The dataset object stores the tables, their relationships and their different constraints. The user can perform operations like update, insert and delete on this local dataset. The changes made to the dataset are applied to the actual database as a batch when needed. This greatly reduces network traffic and results in better performance.

33

Page 34: Jatinder Final Report

Fig: 1.11 Traditional Data Access Architecture

Fig: 1.12 ADO.NET Disconnected Data Access Architecture

Different components of ADO.NET Before going into the details of implementing data access applications using ADO.NET, it is important to understand its different supporting components or classes. All of the generic classes for data access are contained in the System.Data namespace.

Class Description

DataSet The DataSet is a local buffer of tables or a collection of disconnected recordsets

DataTable A DataTable is used to contain data in tabular form using rows and columns.

DataRow Represents a single record or row in a DataTable

DataColumn Represents a column or field of a DataTable

DataRelation Represents the relationship between different tables in a DataSet.

Constraint Represents the constraints or limitations that apply to a particular field or column.

TABLE 3- CLASSES

34

Page 35: Jatinder Final Report

ADO.NET also contains some database specific classes. This means that different database system providers may provide classes (or drivers) optimized for their particular database system. Microsoft itself has provided the specialized and optimized classes for their SQL server database system. The names of these classes start with 'Sql' and are contained in the System.Data.SqlClient namespace.

Class Description

SqlConnection, OleDbConnection Represents a connection to the database system

SqlCommand, OleDbCommand Represents SQL a query

SqlDataAdapter, OleDbDataAdapter

A class that connects to the database system, fetches the records and fills the DataSet

SqlDataReader, OleDbDataReader

A stream that reads data from the database in a connected design

SqlParameter, OleDbParameter Represents a parameter to a stored procedure

TABLE 4-CLASSES

Accessing Data using ADO.NETData access using ADO.NET involves the following steps:

Defining the connection string for the database server Defining the connection (SqlConnection or OleDbConnection) to the database

using a connection string Defining the command (SqlCommand or OleDbCommand) or command string

that contains the query Defining the Data Adapter (SqlDataAdapter or OleDbDataAdapter) using the

command string and the connection object Creating a new DataSet object If the SQL command is SELECT, filling the DataSet object with the results of

the query through the Data Adapter Reading the records from the DataTables in the DataSets using the DataRow and

DataColumn objects If the SQL command is UPDATE, INSERT or DELETE. The dataset will be

updated through the data adapter Accepting to save the changes in the DataSet to the database

35

Page 36: Jatinder Final Report

Since we are demonstrating an application that uses both SQL Server and Access databases we need to include the following namespaces in our application:Imports System.DataImports System.Data.OleDb

1 .7.5 SQL Most large-scale databases use the structured query language(SQL) to facilitate user and administrator interactions. This language offers a flexible interface for databases of all shapes and sizes. The first important point to make is that database transactions are made in SQL, whether you realize it or not. Nowadays, there are a large number of graphical user interfaces (GUIs) that simplify database administration tasks. If you're a SQL Server user, you may be familiar with tools like Enterprise Manager.

There are also quite a few third-party applications that interact with different databases (in fact, many of these can work with multiple database platforms simultaneously.) Did you ever wonder how these applications work? That’s right! They use SQL! The front-end translates your mouse clicks and text entries into SQL and then “speaks” to the database in the universal language of SQL.

1.7.6 Defining the connection stringThe connection string defines which database server you are using, where it resides, your user name and password and optionally the database name.

1.7.7 Defining a Connection A connection is defined using the connection string. This object is used by the Data Adapter to connect to and disconnect from the database. For SQL Server, a connection is created like this: Dim conn As New SqlConnection(connectionString)

1.7.8 Defining the Data AdapterWe need to define the Data Adapter (SqlDataAdapter or OleDbDataAdapter). The Data Adapter stores your command (query) and connection. Using the connection and query the DaraAdapter connects to the database when asked, fetches the result of the query and stores it in a local dataset. Dim dataAdapter As New SqlDataAdapter(commandString, conn)

1.7.9 Creating and filling the DataSetFinally, we need to create an instance of the DataSet. As we mentioned earlier, a DataSet is a local and offline container of data. The DataSet object is created simply as: Dim ds As New DataSet()

1.8 ASP.Net36

Page 37: Jatinder Final Report

ASP.NET is a web platform that provides all the services that you require to build enterprise-class server-based web applications. ASP.NET is built on the .NET Framework, so all .NET Framework features are available to ASP.NET applications. Your applications can be written in any language that is compatible with the common language runtime (CLR), including Visual Basic and C#.To create ASP.NET web applications, you can use Visual Studio. In addition, a free standalone product—Visual Studio Express for Web—is available that includes the core set of web design features from Visual Studio. User controls in ASP.NET can be written in different languages, including C++ and Java. When a browser requests an ASP.NET file, the ASP.NET engine reads the file, compiles and executes the scripts in the file, and returns the result to the browser as plain HTML.

ASP.NET   4.5 Provides links to topics that describe the version of ASP.NET that is part of the .NET Framework 4.5 and links that describe how to create web applications by using Visual Studio 2012 and Visual Studio Express 2012 for Web.

ASP.NET   4 Provides links to topics that describe the version of ASP.NET that is part of the .NET Framework 4 and links that describe how to create web applications by using Visual Studio 2010 and Visual Web Developer 2010 Express.

ASP.NET   3.5 Provides a link to topics that describe the version of ASP.NET that is part of the .NET Framework 3.5 and that describe how to create web applications by using Visual Studio 2008 and Visual Web Developer 2008 Express Edition.

1 .8.1 Web Server Controls ASP.NET Web server controls are objects on ASP.NET Web pages that run when the page is requested and render markup to a browser. Many Web server controls are similar to familiar HTML elements, such as buttons and text boxes. Other controls encompass complex behavior, such as a calendar controls, and controls that manage data connections. Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

AdRotatorThe AdRotator control is used to display a sequence of ad images. This control uses an XML file to store the ad information. The XML file must begin and end with an <Advertisements> tag. Inside the <Advertisements> tag there may be several <Ad> tags which defines each ad.

37

Page 38: Jatinder Final Report

<html><body>

<form runat="server"><asp:AdRotator AdvertisementFile="Ad1.xml"runat="server" OnAdCreated="change_url"target="_blank" /></form>

<p><a href="ad1.xml" target="_blank">View XML file</a></p>

</body></html>

ButtonThe Button control is used to display a push button. The push button may be a submit button or a command button. By default, this control is a submit button. A submit button does not have a command name and it posts the Web page back to the server when it is clicked. It is possible to write an event handler to control the actions performed when the submit button is clicked. A command button has a command name and allows you to create multiple Button controls on a page. It is possible to write an event handler to control the actions performed when the command button is clicked.<html><body>

<form runat="server"><asp:Button id="button1" Text="Click me!" runat="server" OnClick="submit" /></form>

</body></html>

DropDownListThe DropDownList control is used to create a drop-down list.Each selectable item in a DropDownList control is defined by a ListItem element!<html><body>

<form runat="server"><asp:DropDownList id="drop1" runat="server"><asp:ListItem>Item 1</asp:ListItem><asp:ListItem>Item 2</asp:ListItem><asp:ListItem>Item 3</asp:ListItem><asp:ListItem>Item 4</asp:ListItem><asp:ListItem>Item 5</asp:ListItem>

38

Page 39: Jatinder Final Report

<asp:ListItem>Item 6</asp:ListItem></asp:DropDownList><asp:Button Text="Submit" OnClick="submit" runat="server"/><p><asp:label id="mess" runat="server"/></p></form>

</body></html>

HyperLinkThe HyperLink control is used to create a hyperlink.<html><body>

<form runat="server"><asp:HyperLinkImageUrl="/banners/w6.gif"NavigateUrl="http://www.w3schools.com"Text="Visit W3Schools!"Target="_blank"runat="server" /></form>

</body></html>

ImageThe Image control is used to display an image.<html><body>

<form runat="server"><asp:Imagerunat="server"AlternateText="Image not available"ImageUrl="/banners/w6.gif"/></form>

</body></html>

ImageButtonThe ImageButton control is used to display a clickable image.

39

Page 40: Jatinder Final Report

<html><body>

<form runat="server"><p>Click on the image:</p><asp:ImageButtonrunat="server"ImageUrl="smiley.gif"OnClick="getCoordinates"/><p><asp:label id="mess" runat="server"/></p></form>

</body></html>

1 .8.2 Validation Server Controls Validation server controls are a collection of controls that allow you to validate an associated input server control, such as a TextBox, and display a custom message when validation fails. Each validation control performs a specific type of validation. For example, you can validate against a specific value or a range of values by using the CompareValidator and RangeValidatorcontrols, respectively. You can even define your own validation criteria by using the CustomValidator control. Since the error message is displayed in the validation control, you can control where the message is displayed on the Web page by placing the validation control at the desired location. You can also display a summary of the results from all validation controls on the page by using the ValidationSummary control. These are:-RequiredFieldValidator :- Ensures that the user does not skip an entry. Required entry.

CompareValidator :- Compares a user's entry against a constant value, against the value of another control (using a comparison operator such as less than, equal, or greater than), or for a specific data type.

RangeValidator :- Checks that a user's entry is between specified lower and upper boundaries. You can check ranges within pairs of numbers, alphabetic characters, and dates

RegularExpressionValidator :- Checks that the entry matches a pattern defined by a regular expression. This type of validation enables you to check for predictable sequences of characters, such as those in e-mail addresses, telephone numbers, postal codes, and so on.

40

Page 41: Jatinder Final Report

CustomValidator :- Checks the user's entry using validation logic that you write yourself. This type of validation enables you to check for values derived at run time.

1.8.3 Login Server ControlsThe Login ControlThe Login control displays a user interface for user authentication. The Login control contains text boxes for the user name and password and a check box that allows users to indicate whether they want the server to store their identity using ASP.NET membership and automatically be authenticated the next time they visit the site.The Login control has properties for customized display, for customized messages, and for links to other pages where users can change their password or recover a forgotten password. The Login control can be used as a standalone control on a main or home page, or you can use it on a dedicated login page.If you use the Login control with ASP.NET membership, you do not need to write code to perform authentication.

The LoginView ControlThe LoginView control allows you to display different information to anonymous and logged-in users. The control displays one of two templates: the  Anonymous Template or the LoggedIn Template. In the templates, you can add markup and controls that display information appropriate for anonymous users and authenticated users, respectively.

The LoginStatus ControlThe LoginStatus control displays a login link for users who are not authenticated and a logout link for users who are authenticated. The login link takes the user to a login page. The logout link resets the current user's identity to be an anonymous user.You can customize the appearance of the LoginStatus control by setting the  LoginText  and  LoginImageUrl  properties.

The LoginName ControlThe LoginName control displays a user's login name if the user has logged in using ASP.NET membership. Alternatively, if your site uses integrated Windows authentication, the control displays the user's Windows account name.

The PasswordRecovery ControlThe PasswordRecovery control allows user passwords to be retrieved based on the e-mail address that was used when the account was created.The  Password Recovery control sends an e-mail message containing a password to the user. You can configure ASP.NET membership to store passwords using non-reversible encryption. In that case, the PasswordRecovery control generates a new password instead of sending the original password to the user.You can also configure membership to include a

41

Page 42: Jatinder Final Report

security question that the user must answer to recover a password. If you do, the PasswordRecoverycontrol asks the question and checks the answer before recovering the password. The PasswordRecovery control requires that your application can forward e-mail message to a Simple Mail Transfer Protocol (SMTP) server. You can customize the text and format of the e-mail message sent to the user by setting the MailDefinition property.

The CreateUserWizard ControlThe CreateUserWizard control collects information from potential users. By default, the CreateUserWizard control adds the new user to the ASP.NET membership system.The CreateUserWizard control gathers the following user information:User namePasswordConfirmation of passwordE-mail addressSecurity questionSecurity answerThis information is used to authenticate users and recover user passwords, if necessary.

The ChangePassword ControlThe ChangePassword control allows users to change their password. The user must first supply the original password and then create and confirm the new password. If the original password is correct, the user password is changed to the new password. The control also includes support for sending an e-mail message about the new password.

1.8.4 Data-Bound Web Server ControlsData-bound Web server controls are controls that can be bound to a data source control to make it easy to display and modify data in your Web application. Data-bound Web server controls are composite controls that combine other ASP.NET Web controls.Such as Label and TextBox controls, into a single layout. For example, a data-bound control such as a DetailsView control can bind to a set of results such as a table of employees containing each employee's name, address, job title, and so on.

GridView ControlThe GridView control is the successor to the DataGrid control available in earlier versions of ASP.NET. Along with the added ability to take advantage of the capabilities of data source controls, the GridView control offers improvements such as the ability to define multiple primary key fields, improved user interface customization using bound fields and templates, and a new model for handling or canceling events.

DetailsView Control42

Page 43: Jatinder Final Report

The DetailsView control renders a single record at a time as a table and provides the capability to page through multiple records, as well as to insert, update, and delete records. The DetailsView control is often used in master-detail scenarios where the selected record in a master control such as aGridView control determines the record displayed by the DetailsViewcontrol.

DataList ControlThe DataList control renders data as table and enables you to display data records in different layouts, such as ordering them in columns or rows. You can configure the DataList control to enable users to edit or delete a record in the table. (The DataList control does not take advantage of the capabilities of data source controls for modifying data; you must supply this code yourself.) The DataList control differs from the Repeater control in that theDataList control explicitly places items in an HTML table, where as theRepeater control does not.

1.8.5 Master PageASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

Advantages of Master Pages Master pages provide functionality that developers have traditionally created by copying existing code, text, and control elements repeatedly; using framesets; using include files for common elements; using ASP.NET user controls; and so on. Advantages of master pages include the following:

They allow you to centralize the common functionality of your pages so that you can make updates in just one place.

They make it easy to create one set of controls and code and apply the results to a set of pages. For example, you can use controls on the master page to create a menu that applies to all pages.

They give you fine-grained control over the layout of the final page by allowing you to control how the placeholder controls are rendered.

They provide an object model that allows you to customize the master page from individual content pages.

1.8.6 How Master Pages Work Master pages actually consist of two pieces, the master page itself and one or more content pages.

43

Page 44: Jatinder Final Report

Master PagesA master page is an ASP.NET file with the extension .master (for example, MySite.master) with a predefined layout that can include static text, HTML elements, and server controls. The master page is identified by a special@   Master  directive that replaces the @   Page  directive that is used for ordinary .aspx pages. The directive looks like the following.

<%@ Master Language="C#" %>

The @ Master directive can contain most of the same directives that a@   Control  directive can contain. For example, the following master-page directive includes the name of a code-behind file, and assigns a class name to the master page.<%@ Master Language="C#" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

In addition to the @ Master directive, the master page also contains all of the top-level HTML elements for a page, such as html, head, and form. For example, on a master page you might use an HTML table for the layout, animg element for your company logo, static text for the copyright notice, and server controls to create standard navigation for your site. You can use any HTML and any ASP.NET elements as part of your master page.

Replaceable Content PlaceholdersIn addition to static text and controls that will appear on all pages, the master page also includes one or more ContentPlaceHolder controls. These placeholder controls define regions where replaceable content will appear. In turn, the replaceable content is defined in content pages. After you have defined the ContentPlaceHolder controls, a master page might look like the following.

<%@ Master Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server" > <title>Master page title</title></head><body> <form id="form1" runat="server"> <table>

44

Page 45: Jatinder Final Report

<tr> <td><asp:contentplaceholder id="Main" runat="server" /></td> <td><asp:contentplaceholder id="Footer" runat="server" /></td> </tr> </table> </form></body></html>

Content PagesYou define the content for the master page's placeholder controls by creating individual content pages, which are ASP.NET pages (.aspx files and, optionally, code-behind files) that are bound to a specific master page. The binding is established in the content page's @ Page directive by including aMasterPageFile attribute that points to the master page to be used. For example, a content page might have the following @ Page directive, which binds it to the Master1.master page.

<%@ Page Language="C#" MasterPageFile="~/MasterPages/Master1.master" Title="Content Page"%>

In the content page, you create the content by adding Content controls and mapping them to ContentPlaceHolder controls on the master page. For example, the master page might have content placeholders called Main andFooter. In the content page, you can create two Content controls, one that is mapped to the ContentPlaceHolder control Main and the other mapped to the ContentPlaceHolder control Footer, as shown in the following figure.

Replacing placeholder contentAfter creating Content controls, you add text and controls to them. In a content page, anything that is not inside the Content controls (except script blocks for server code) results in an error. You can perform any tasks in a content page that you do in an ASP.NET page. For example, you can generate content for a Content control using server controls and database queries or other dynamic mechanisms.

<% @ Page Language="C#" MasterPageFile="~/Master.master" Title="Content Page 1" %><asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server"> Main content.</asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="Footer" Runat="Server" >

45

Page 46: Jatinder Final Report

Footer content.</asp:content>

The @ Page directive binds the content page to a specific master page, and it defines a title for the page that will be merged into the master page. Note that the content page contains no other markup outside of theContent controls. (The master page must contain a head element with the attribute runat="server" so that the title setting can be merged at run time.)

You can create multiple master pages to define different layouts for different parts of your site, and a different set of content pages for each master page.

1 .8.7 Session When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the application and when you close it. However, on the internet there is one problem: the web server does not know who you are and what you do, because the HTTP address doesn't maintain state.ASP solves this problem by creating a unique cookie for each user. The cookie is sent to the user's computer and it contains information that identifies the user. This interface is called the Session object.

The Session object stores information about, or change settings for a user session.Variables stored in a Session object hold information about one single user, and are available to all pages in one application. Common information stored in session variables are name, id, and preferences. The server creates a new Session object for each new user, and destroys the Session object when the session expires.When does a Session Start?

A session starts when: A new user requests an ASP file, and the Global.asa file includes a

Session_OnStart procedure A value is stored in a Session variable A user requests an ASP file, and the Global.asa file uses the <object> tag to

instantiate an object with session scope

When does a Session End?A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes.If you want to set a timeout interval that is shorter or longer than the default, use the Timeout property.

46

Page 47: Jatinder Final Report

The example below sets a timeout interval of 5 minutes:<%Session.Timeout=5%>

Use the Abandon method to end a session immediately:

<%Session.Abandon%>

47

Page 48: Jatinder Final Report

CHAPTER 2-ABOUT PROJECT HOME DESIGN HAVEN

2 . 1 Introduction Engineeredsolution.com.au is an online shopping website. It is a website which is used to sell items like Mobiles, Laptops, Cameras, Televisions, Electronic Appliances such as washing machines, refrigerators, air conditioners, pen drives etc. Online shopping is the process whereby consumers directly buy goods, services etc. from a seller interactively in real-time without an intermediary service over the internet. Online shopping is the process of buying goods and services from merchants who sell on the Internet. Since the emergence of the World Wide Web, merchants have sought to sell their products to people who surf the Internet. Shoppers can visit web stores from the comfort of their homes and shop as they sit in front of the computer. Consumers buy a variety of items from online stores. In fact, people can purchase just about anything from companies that provide their products online. Books, clothing, household appliances, toys, hardware, software, and health insurance are just some of the hundreds of products consumers can buy from an online store. Many people choose to conduct shopping online because of the convenience. For example, when a person shops at a brick-and-mortar store, she has to drive to the store, find a parking place, and walk throughout the store until she locates the products she needs. After finding the items she wants to purchase, she may often need to stand in long lines at the cash register.

Despite the convenience of online shopping, not everyone chooses to purchase items and services online. Some people like the idea of physically going to a store and experiencing the shopping process. They like to touch the merchandise, try on clothing, and be around other people. Online shopping doesn't permit shoppers to touch products or 8 have any social interaction. It also doesn't allow them to take the merchandise home the same day they buy it.

Online shopping allows you to browse through endless possibilities, and even offers merchandise that's unavailable in stores. If you're searching for a niche product that may not be distributed locally, you're sure to find what you're looking for on the internet. What's even more useful is the ability to compare items, similar or not, online. You can search through multiple stores at the same time, comparing material quality, sizes and pricing simultaneously.

Shopping via the internet eliminates the need to sift through a store's products with potential buys like pants, shirts, belts and shoes all slung over one arm. Online shopping also eliminates the catchy, yet irritating music, as well as the hundreds, if not thousands, of other like-minded individuals who seem to have decided to shop on the same day.

48

Page 49: Jatinder Final Report

Say 'goodbye' to the days when you stood in line waiting, and waiting, and waiting some more for a store clerk to finally check out your items. Online shopping transactions occur instantly-saving you time to get your other errands done! Additionally, unlike a store, online shopping has friendly customer service representatives available 24 hours a day, 7 days a week to assist you with locating, purchasing and shipping your merchandise.

This system is all about the converting the shopping system from manual to online. Customer can buy products online after login to the site. Administrator is adding product to database. Administrator can edit or delete the products from the database. After buying and making payment the products are send to customers address that he

has given. Customer can write feedback for the product or services. Admin can see daily sell and feedback given by customer. Administrator is adding the delivery report to the database.

Both admin and customer can see the delivery report

2.2 PurposeOnline shopping tries to enhance access to care and improve the continuity and efficiency of services. Depending on the specific setting and locale, case managers are responsible for a variety of tasks, ranging from linking clients to services to actually providing intensive shopping and delivery services themselves.Many people choose to conduct shopping online because of the convenience. For example, when a person shops at a brick-and-mortar store, he has to drive to the store, find a parking place, and walk throughout the store until he locates the products he needs. After finding the items he wants to purchase, he may often need to stand in long lines at the cash register.

Hardware Requirements Processer: Intel P4 CPU 1.60GHZ Memory: 2GB or above of RAM Hard Disk: 40 GB or above Monitor: Preferably Color Printer: HP LaserJet 2010 Series

Software Requirements Front end: VISUAL STUDIO 2012 (ASP.NET) O.S.: Windows 2007. Back end: Microsoft SQL Server 2008

2.3 Objective49

Page 50: Jatinder Final Report

The objective of our project is to develop a GUI (Graphical User Interface) based software i.e. platform independent & user friendly and which can be fit easily. This software helps customer to find different products, their features, and new updates easily. It is designed such a way that one can view all the updates of the product from any place through online. The software will help in easy maintaining and updating products in the website for the administrator. Also quick and easy comparison of different products for the customers.

To shop while in the comfort of your own home, without having to step out of the door. Sell at lower rate due to less over head. Provide home delivery free of cost. To be able to easily save money and compare prices from website to website. Online resellers tent to sell at a lower price due to less overhead expenses.

Features included in our software are:-

Platform Independent As our software is coded in ASP.Net so it is platform independent i.e. it can work on any operating system whether it is any version of Microsoft windows (98, XP, Vista (all versions), 7).

Reduced data redundancy As we are using DBMS (Database Management System) in the back end of our software, redundancy rate is less as compared to file system so it will overcome the problems of data duplicacy.

Fast Execution As our software is GUI based and it contains many new features which will make the execution faster than any other pre-existing software’s.  

Cost Efficient Due to the removal of data redundancy from the software, duplicity of data is eliminated and wastage of memory is also overcome. As we know that storage devices are cost consuming so by saving space we are saving money and providing cost effective software.

Security Our software includes better security levels with login window.

2.4 Project Description50

Page 51: Jatinder Final Report

This project aims to provide shopping cart solutions to all types of customers over the internet world. This application developed for electronics goods stores and computer hardware. User should register first before going to buy any item using this shopping cart system. Web forms included in this web application are same as all shopping cart projects, those are new user registration, search laptops or other items, select items, make purchase using their cards.This project is aimed at developing a Web application that depicts online Shopping of electronic items. Using this software, companies can improve the efficiency of their services. Online Shopping is one of the applications to improve the marketing of the company’s products. This web application involves all the features of the online shopping.

Front end: Microsoft Visual Studio 2012(ASP.NET)

Back end: Microsoft SQL Server 2008

Language used: C#

2.5 Assumptions and Dependencies The product does require back-end database server Microsoft SQL Server 2008 for storing the username and password for different types of user of the system as well as various databases regarding various insurance information. Assumptions:

User must be trained for basic computer functionalities. User must have the basic knowledge of English The system must be able to respond to database software within reasonable time.

2.6 ModulesThe modules used in this software are as follows:

Login: This module has a drop down list box from where we have to selectADMIN or USER. The ADMIN has all the rights in the software including updating the status of his site. The other fields in login are username and password. If the username and password are correct then it is directed to next page.

New user: This module is for the users who do not have their account. Here user is allowed to create an account to login. The account creation is done by filling the registration form with user details such as name, phone, email etc.

51

Page 52: Jatinder Final Report

Product: This module has information regarding the mobiles such as its name, model, color, price information; its features etc.The ADMIN has the authority to Add, Delete, and Update etc. The USER can only view the Mobile, add to cart only those in the stock etc.

Accessories: This module consists of various available accessories of the Mobile with its name and picture, price information etc.

Search: This module helps the customer to ease his search based on his budget or interest. The search can be done on different categories like mobile model name, model number, color, price etc

Cart: User can select any number of Mobile and add to the cart. He can also remove from the cart if he dislikes it later.

Payment: This module describes the payment done by the customer. The payment information can include information like the model purchased, quantity, mode of payment (cash, loan) etc.

Stocks: This gives the details regarding the products available for sale.

2.7 System Development Life cycle (SDLC)System is an organized collection of independent tasks and processes that is designed to work together in order to accomplish specific objectives. The processes and tasks typically receive input(s) from and provide output(s) to other processes and tasks and even other systems.  The tasks and processes may or may not be supported by automation.

SDLC refers to a methodology for developing systems. The SDLC methodology may be condensed to include only those activities that are appropriate for a particular project, whether the system is automated or manual, whether it is a new system, or an enhancement to existing systems. The SDLC methodology tracks a project from an idea developed by the user, through a feasibility study, systems analysis and design, programming, implementation and analysis. Documentation developed during the project development is used in the future when the system is re-assessed for its enhancement, modification, or deletion.

2.7.1 SDLC PhasesPhases in SDLC are Planning, Analysis, Design, Implementation and Maintenance. The System Development Life Cycle is an application of the system approach to the task of the developing and using a computer based system. As such, the system life cycle is a methodology, but its pattern is being influenced by the need to develop system more

52

Page 53: Jatinder Final Report

quickly. More responsive system development can be achieved by refining the life cycle and using the computer based development tools.

SYSTEM DEVELOPMENT LIFE CYCLE PHASES

Fig -3.1

2.7.2 Recognition of NeedThe problem must be known before it can be solved. This leads to preliminary survey or an initial investigation by the system analyst to determine the requirements of the user and the organization. Thus, during the need analysis phase , the focus of the development team is on the completion of the following three tasks

Defining the problem and deciding whether to proceed or not. Analyzing the current system in depth and determining the requirements which

are to be met by the new or modified application. The knowledge regarding the current system is gathered through:

Data Flow Diagrams. Flow Charts. Entity-Relationship Diagrams Structured English.

Thus the need of analysis phase focuses on what the system does and not on how the features will be implemented .

2.7.3 Feasibility StudyIs the project technically, operationally, financially, feasible? The feasibility study is used to determine if the project should go ahead. If the project proceeds, the feasibility to produce a project plan budget estimates for the future stages of the development.

53

Feasibility

Analysis

Design

Implement

Maintenance

Test

Page 54: Jatinder Final Report

Technical FeasibilityWe also consider some technical points about development of software.

1. We see whether the software is reliable or not. 2. Whether it will work for long time or not.3. What language is used and what OS is used for development of software?4. Does it provide security or not?5. Software is reusable or not.6. Software is flexible or not.7.

Economic FeasibilityFor any system if the expected benefits equals to expected costs, the system can be judged to be economically feasible. In economic feasibility, cost benefit analysis is done in which expected costs and benefits are evaluated. In economic feasibility, the most important is cost-benefit analysis. As the name suggests, it is an analysis of the costs to be incurred in the system and benefits derived from the system.

Behavioral Feasibility Before starting the project development, the project team must also analyze the working environment of their project. They should find whether their project is feasible for running under these conditions. After the analysis of the environment of operation of this project, we found that the project is feasible to run under its working conditions. The designs are translated into code computer program by using a conventional programming language. Inevitable system will need maintenances – hopefully we haven’t done anything wrong but the people will demand extra things to be added or existing things to be changed over time. This paradigm is the oldest and most widely used approach to system development. In other words, if you are unsure whether your solution will deliver the outcome you want, then a Project Feasibility Study will help gain that clarity. During the Feasibility Study, a variety of 'assessment' methods are undertaken. The outcome of the Feasibility Study is a confirmed solution for implementation.

Development RiskCan the system elements be designed so that necessary function and performance are achieved within the constraints during analysis?Once the answers to these questions are clear, the team can move on to the next step of development. We have decided to use the PHP language as our platform of development after checking its compatibility with our implementation needs. The reason for choosing PHP as our platform was its flexible compatibility with our concept of development.

54

Page 55: Jatinder Final Report

TechnologyHas the relevant technology progressed to a state that will support the system? Are the system developers capable enough to meet the objectives of the undertaken project?

2.7.4 AnalysisGather the requirements for the system at this stage including a detailed study of the users. System Analysis is an explicit formal inquiry carried out to help someone who can identify a better Course of action and make a better decision than he might otherwise have made.

Systems analysis usually has some combination of the following: identification and re-identification) of Objectives and constraints, and alternative courses of action; examination of the probable consequences of the alternatives in terms of costs, benefits and risks presentation of the results in a comparative framework so that the decision maker can make a right choice among the alternatives. The typical use of systems analysis is to take decisions on issues of national or corporate plans and programs, resource use and protection policies, research and development in technology, regional and urban development, educational systems, and the and other social services. Clearly, the nature of these problems requires an interdisciplinary approach. A system analysis that concentrates on comparison and ranking of alternatives on basis of their known characteristics is referred to as decision analysis.

2.7.5 Design This focuses on high level design (what programs are we going to need and how they are going to interact), low level design (how the individual programs are going to work), interface design (what are the interfaces going to look like), and data design (what data are we going to need). The primary objective of the design phase is to create a design that satisfies the agreed application requirements. The requirements prototype that was developed earlier during the analysis phase is gradually improved and extended to include all the specified functions of the application. Also, the planning of the system documentation process should be started. The design must be translated into a machine-readable form.

2.7.6 Code Generation.The design that must be translated into a machine-readable form. The code generation step performs this task. If the design is performed in a detailed manner, code generation

can be accomplished without much complication. Programming tools like compilers, interpreters, debuggers etc. are used to generate the code. Different high level programming languages like C, C++, are used for coding. When code generation occurs

55

Page 56: Jatinder Final Report

at runtime, as in just-in-time compilation (JIT), it is important that the entire process be efficient with respect to space and time. For example, when regular expressions are interpreted and used to generate code at runtime, a non-deterministic finite state machine is often generated instead of a deterministic one, because usually the former can be created more quickly and occupies less memory space than the latter. Despite its generally generating less efficient code, JIT code generation can take advantage of profiling information that is available only at runtime.

2.7.7 TestingOnce the code is generated, the software program testing begins. Different testing methodologies are available to remove the bugs that were committed during the previous phases. The system is tested. Normally programs are written as a series of individual modules – these should subject to separate and detailed test. The system is then tested as a whole- the separate modules are brought together and tested as a complete system.

2.8 Data Flow DiagramA Data Flow Diagram (DFD) is a graphical representation of the "flow" of data through an Information System. A data flow diagram can also be used for the visualization of Data Processing. It is common practice for a designer to draw a context-level DFD first which shows the interaction between the system and outside entities. This context-level DFD is then "exploded" to show more detail of the system being modeled.A DFD represents flow of data through a system. Data flow diagrams are commonly used during problem analysis. It views a system as a function that transforms the input into desired output. A DFD shows movement of data through the different transformations or processes in the system.Dataflow diagrams can be used to provide the end user with a physical idea of where the data they input ultimately has an effect upon the structure of the whole system from order to dispatch to restock how any system is developed can be determined through a dataflow diagram. The appropriate register saved in database and maintained by appropriate authorities.

Data Flow Diagram Notation

Function

56

Page 57: Jatinder Final Report

File/Database

Input/output

Flow

Level 0 DFD

Input Output

Fig 2.2

Level 1 DFD

57

Admin/User SystemDatabase

Page 58: Jatinder Final Report

Fig-2.3

2.9 PROCESS DETAILS

58

Page 59: Jatinder Final Report

ShoppingProcess.

Fig-2.4

2.10 Design of the Site.59

Page 60: Jatinder Final Report

2.10.1 Homepage

Fig: 2.5 Home

This is the Home page. This is the starting page of the website.

60

Page 61: Jatinder Final Report

2 .10.2 Product Page

Fig: 2.6 Product Page

This is products page . It displays the products selected by the user from the menu.

61

Page 62: Jatinder Final Report

2 .10.3 Testimonial

Fig: 2 .7 Testimonial

This is the testimonial page..In which we select the product into dropdown list and show the images of that product.. When we click on any of the product’s image it goes to next page and we can give comment for that product..

62

Page 63: Jatinder Final Report

2 .10.4 Gallery

Fig: 2.8 Gallery

This is the gallery page . it picks the images randomly from the database .

63

Page 64: Jatinder Final Report

2 .10.5 Product Description

Fig: 2.9 Product Description

This is the product description page. When you click on a product link this page appears which gives you the description of the selected product

64

Page 65: Jatinder Final Report

2 .10.6 Login/Register User

Fig: 2.10 Login/Register

This is the Login Or Register page for user. If you are already a user then login otherwise to buy a product you should register first.

65

Page 66: Jatinder Final Report

2 .10.7 Welcome User

Fig: 2.11 Welcome User

This form appears when you Login and it displays the Product previously selected by the user .

66

Page 67: Jatinder Final Report

2.10.8 Cart

Fig: 2.12 Cart

This is the cart in which the products selected by the user are added. These are not purchased by the user.

67

Page 68: Jatinder Final Report

2.10.9 Buy Now

Fig: 2.13 Buy Now

This Page Displays the product model, its Quantity and price of the product selected by the user for purchase.

68

Page 69: Jatinder Final Report

2.10.10 Buyer Details

Fig: 2.14 Buyer Details

This page is to get the details of the user so that a product can be delivered on the correct address.

69

Page 70: Jatinder Final Report

2.10.11 Order

Fig: 2.15 Order

This page occurs when the order is placed and automatically the order number is generated for the user. And this is to thank the user for making purchase from our site.

70

Page 71: Jatinder Final Report

2.10.12 About Us

Fig: 2.16 About Us

This is the About Us Page .It is used to display the information about the firm / website.

71

Page 72: Jatinder Final Report

2.10.13 Contact Us

Fig: 2.17 Contact Us

Contact us page is used by the user to contact the administrator of the website.

72

Page 73: Jatinder Final Report

2.10.14 Admin Login

Fig: 2.18 Admin Login

This is the Admin Login Page. Admin can login using this page and make the required change in the Website.

73

Page 74: Jatinder Final Report

2.10.15 Add New Product

Fig: 2.19 Add New Product

This is the Page used by the Admin to Add new items.

74

Page 75: Jatinder Final Report

2.10.16 Update Product

Fig: 2.20 Update Product

This is the Admin Update Product page. Admin can update any details of the product.

75

Page 76: Jatinder Final Report

2.10.17 Delete Product

Fig: 2.21 Delete Product

This is delete Product Page. It is used by the Administrator to delete any product.

76

Page 77: Jatinder Final Report

2.10.18 Manage Orders

Fig: 2.22 Manage Orders This page show the user all the orders Placed by the different users.

77

Page 78: Jatinder Final Report

2.10.19 Manage Home

Fig: 2.23 Manage Home

Using this page administrator can change the text or photographs displayed on the home page.

78

Page 79: Jatinder Final Report

2.10.20 Forgot Password

Fig: 2.24 Forgot Password This is the Forgot Password Page. If admin forgot its password he can enter his id and his password will be send to the email address provided by him during registration.

79

Page 80: Jatinder Final Report

2 .1 1 Database

This project contains Four tables:-

2 . 11.1 Products This table is to store the products those are on sale.

Pid int (Primary Key) Category Varchar SubCategory Varchar typesofproduct Varchar product Varchar name Varchar Quantity Varchar Price int image int description Varchar

Fig: 2.25 Product Table

80

Page 81: Jatinder Final Report

2.11.2 Cart This table contains the products added by a user in his/her cart.

Pid int pname varchar quantity int E-mail varchar Price int

Fig: 2.26 Cart Table

81

Page 82: Jatinder Final Report

2.11.3 Register This table is to store the specifications of the registered user.

fname varchar mname varchar lname varchar E-mail varchar(primary key) Paddress varchar Caddress varchar Mobile int Password varchar City varchar State varchar Country varchar Pincode int

Fig: 2.27 Register Table

82

Page 83: Jatinder Final Report

2.11.4 OrdersThis table stores all the orders made by all the users.

Pid int Email varchar Address varchar Price big int Order_Id int Cno. Big int Order_date datetime Fname varchar City varchar State varchar Country varchar Pincode int Shipping Address varchar

Fig: 2.28Order Table

CHAPTER 3- PROBLEM REPORT83

Page 84: Jatinder Final Report

Project Name: HOME DESIGN HAVEN

3.1 List of Problems that were faced during the Project:Some of the important problems regarding the working and debugging of project has been listed below:

1. Deciding the Scope of the project: In the starting we were not sure about the scope and reach of the project of this scale. E-commerce is one of the most trending and popular field in today’s world.

2. Requirement Gathering and Analysis: This phase was very difficult to work on as it involved the collection of the different products with their Technical Specifications, Images, Price Status included in the E-commerce. So we had to spend a lot of time on the stats collection and then gathering the requirements from the other e-commerce websites so that this project fulfills the demands of the user.

3. Designing:This phase is the most important and the difficult part of this project and we faced many problems while working on this phase like:

The basic layout of the site. What needs to be kept in mind while designing the site? Embedding of java script in the HTML and CSS pages was easy but the difficult part

was to check if the code works properly. DFD’s and other structured diagrams had to be made in such a way that they can depict

the structure and work flow of the whole project. At every point, we had to keep in mind the requirements and had to check that if they are

not getting violated at any point.

3.1.1 Problems faced during the implementation of the Features and Services:

1. E-mail services (Automatic)2. Fetching user’s address in Cash of delivery. 3. Editing the details of the product in admin panel.4. Connecting the Cash of delivery table with View Order in Admin.5. In fetching the name of the bid winner.

All these features made us face various problems,

84

Page 85: Jatinder Final Report

3.1.2 Some problems were also faced during the unit testing of the modules and web pages:

1. Due to increasing errors, we had to simplify our code at every point.2. Unit testing of every page and module was a very time-consuming and a tedious task.3.

3.2 Solutions to the problems stated above:Following are the Solutions of the various problems:

1. Scope of the project:Because E-commerce is very common these days, inspired by ebay.com, I added another feature of Auction to interact more users to this website. E-commerce is the only platform that provides user with more ease of access & comfort to sit at home & shop for their family, friends & themselves. Scope of this project was decided for the old aged & handicapped people who cannot step out of their place.

2. Requirement gathering & Analysis:Solution to this problem was to find the already existing websites that provide the information regarding the latest products. Google.com was of great help in getting all the proper images & specifications of the Products.

3. Designing: Problem that was faced in this phase is structured designing technique. We made DFD’s, flow charts, etc. to analyze the core design of the project and then we decided the layout that was needed to be implemented on the site.So this is why we followed the ITERATIVE WATERFALL MODEL to design and develop this project. Due to, generation of reports after every module we were focused on the requirements and objectives of the project.

3.3 Future ScopeThis product has great future scope. Online shopping Internet software developed on and for the Windows and later versions environments and Linux OS. This project also provides security with the use of Login-id and Password, so that any unauthorized users can not use your account. The only Authorized that will have proper access authority can access the software. This system will reduce the manual operation required to maintain all the records of booking information. And also generates the various reports for analysis. Main concept of the project is to enter transaction reports and to maintain customer records. Hence this software can be used to maintain record easily. Online shops make comparison and research of products and prices possible. Online stores also give you the ability to share information and reviews with other shoppers who have firsthand experience with a product or retailer.

85

Page 86: Jatinder Final Report

The project only lays out a basic architecture of e-commerce like ebay.com with basic functionalities. There’s a lot to improve and a lot of enhancements to be integrated in this project. Some of the important enhancements are suggested and listed below:

1. SMS integration.2. Customer should be given reward points for frequent purchase.3. Display the timer on the Bidding Products.4. Name of the bid winners should be shown to the users.5. Number of items left in the stock for the particular product.

According to the findings of this Project i.e. E-commerce, we can conclude the following:

E-commerce is a field which is growing day by day & it is becoming a very popular field.

The scope of this project has been decided on the basis of the requirements of the users for whom this project has been developed.

86

Page 87: Jatinder Final Report

4 REFERENCE

Books:1. The C# Programming language by Peter Glode.2. .Net by Chris Nahr.3. Daily Diary.

Websites:1. http://en.wikiversity.org 2. http://www.codeproject.com 3. http://www.slideshare.net 4. http://www.wikipidiea.com 5. http://www.ebay.com 6. http://www.flipkart.com 7. http://www.gliffy.com

87