Top Banner
PROJECT REPORT IN ASP.NET ON E-Advertisement Submitted in partial fulfillment of the requirements. For the award of the certificate of Summer Training In ASP.NET Submitted by: Amish Batra(0631503107) Romit Chhabra(0841503107) Dushyant Sharma(0881503107) IT- 5 th Semester Maharaja Surajmal Institute Of Technology 1
95
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: e Advertisement

PROJECT REPORT

IN

ASP.NET

ON

E-Advertisement

Submitted in partial fulfillment of the requirements.

For the award of the certificate of

Summer Training

In ASP.NET

Submitted by:

Amish Batra(0631503107)

Romit Chhabra(0841503107)

Dushyant Sharma(0881503107)

IT- 5th Semester

Maharaja Surajmal Institute Of Technology

1

Page 2: e Advertisement

INDEX

1.) Abstract2.) .Net3.) Asp.net4.) .Net Framework5.) .Net vs. Java6.) Companies using asp.net7.) Why we have used Asp.net in this project?8.) Project Objective9.) Introduction10.) System Analysis11.) Requirements to achieve the goal12.) Software engineering paradigms applied13.) Testing14.) Analysis Modeling15.) Source Code16.) Output17.) Conclusion18.) System Requirements19.) Bibliography

2

Page 3: e Advertisement

ABSTRACT

The website e-advertisement runs on the pc having visual studio. This website is about

advertising on the net in which one can chose/advertise a specific brand or a choice from

different brands can be made. It provides a facility in which one can advertise one or more

items or can just browse & leave the site. This website has been made compatible for all age

groups of people from all kinds of fields. The website is updated on the regular basis

according to the needs of people. Exciting offers are provided to maintain the charm amongst

the people.

3

Page 4: e Advertisement

.NET

Microsoft .NET is Microsoft's new Internet strategy.

.NET was originally called NGWS.

NGWS - Next Generation Windows Services

Before the official announcement of .NET, the term NGWS was used for Microsoft's plans for

producing an "Internet-based platform of Next Generation Windows Services". 

The Microsoft .NET strategy was presented by Microsoft officials to the rest of the world in

June 2000:

.NET is Microsoft's new Internet and Web strategy

.NET is NOT a new operating system

.NET is a new Internet and Web based infrastructure

.NET delivers software as Web Services

.NET is a framework for universal services

.NET is a server centric computing model

.NET will run in any browser on any platform

.NET is based on the newest Web standards.

4

Page 5: e Advertisement

The .NET plan includes a new version of the Windows operating system, a new version

of Office, and a variety of new development software for programmers to build Web-

based applications.

The background for .NET is part of Microsoft's new strategy to keep Windows the

dominant operating system in the market, as computing begins to move away from

desktop computers toward Internet enabled devices, such as hand-held computers and

cell phones.

The most visual components of the new .NET framework are the new Internet

Information Server 6.0, with ASP.NET and ADO.NET support, Visual Studio.NET

software tools to build Web-based software, and new XML support in the SQL Server

2000 database. 

Bill Gates is supervising the .NET project

5

Page 6: e Advertisement

ASP.NET

ASP.NET is a web application framework developed and marketed by Microsoft, that

programmers can use to build dynamic web sites, web applications and web services. It was

first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to

Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common

Language Runtime (CLR), allowing programmers to write ASP.NET code using any

supported .NET language. ASP.NET can be used to create anything from small, personal

websites through to large, enterprise-class web applications.

Extension

Microsoft has released some extension frameworks that plug into ASP.NET and extend its

functionality. Some of them are:

ASP.NET AJAX

An extension with both client-side as well as server-side components for writing ASP.NET

pages that incorporate AJAX functionality.

6

Page 7: e Advertisement

ASP.NET AJAX is built-into ASP.NET 3.5. It is also available as a separate download for

ASP.NET 2.0.

With ASP.NET AJAX you can:

Create next-generation interfaces with reusable AJAX components.

Enhance existing pages using powerful AJAX controls with support for all modern

browsers.

Access remote services and data from the browser without tons of complicated script.

Take advantage of the improved efficiency and ease of use in Visual Studio 2008, with

its built-in support for ASP.NET AJAX, improved JavaScript support, and a new Web

page designer interface.

ASP.NET MVC Framework

An extension to author ASP.NET pages using the MVC arc.

7

Page 8: e Advertisement

.NET FRAMEWORK

The .NET Framework is the infrastructure for the new Microsoft .NET Platform. 

The .NET Framework is a common environment for building, deploying, and running

Web Services and Web Applications.

The .NET Framework contains common class libraries - like ADO.NET, ASP.NET and

Windows Forms - to provide advanced standard services that can be integrated into a

variety of computer systems.

The .NET Framework is language neutral. Currently it supports C++, C#, Visual

Basic, JScript (The Microsoft version of JavaScript) and COBOL. Third-party languages

- like Eiffel, Perl, Python, Smalltalk, and others - will also be available for building

future .NET Framework applications.

The new Visual Studio.NET is a common development environment for the new .NET

Framework. It provides a feature-rich application execution environment, simplified

development and easy integration between a number of different development

languages.

8

Page 10: e Advertisement

1) .NET Framework 1.0

This is the first release of the .NET Framework, released on 13 February 2002 and available

for Windows 98, NT 4.0, 2000, and XP. Mainstream support by Microsoft for this version

ended 10 July 2007, and extended support ends 14 July 2009.

2) .NET Framework 1.1

This is the first major .NET Framework upgrade. It is available on its own as a redistributable

package or in a software development kit, and was published on 3 April 2003. It is also part of

the second release of Microsoft Visual Studio .NET (released as Visual Studio .NET 2003).

This is the first version of the .NET Framework to be included as part of the Windows

operating system, shipping with Windows Server 2003. Mainstream support for .NET

Framework 1.1 ended on 14 October 2008, and extended support ends on 8 October 2013.

Since .NET 1.1 is a component of Windows Server 2003, extended support for .NET 1.1 on

Server 2003 will run out with that of the OS - currently 30 June 2013.

Changes in 1.1 on comparison with 1.0

Built-in support for mobile ASP.NET controls. Previously available as an add-on

for .NET Framework, now part of the framework.

Security changes - enable Windows Forms assemblies to execute in a semi-trusted

manner from the Internet, and enable Code Access Security in ASP.NET applications.

Built-in support for ODBC and Oracle databases. Previously available as an add-on

for .NET Framework 1.0, now part of the framework.

.NET Compact Framework - a version of the .NET Framework for small devices.

Internet Protocol version 6 (IPv6) support.

10

Page 11: e Advertisement

3) .NET Framework 2.0

Released with Visual Studio 2005, Microsoft SQL Server 2005, and BizTalk 2006.

The 2.0 Redistributable Package can be downloaded for free from Microsoft, and was

published on 2006-01-22.

The 2.0 Software Development Kit (SDK) can be downloaded for free from Microsoft.

It is included as part of Visual Studio 2005 and Microsoft SQL Server 2005.

Version 2.0 is the last version with support for Windows 2000, Windows 98 and Windows

Me.

It shipped with Windows Server 2003 R2 (not installed by default).

Changes in 2.0 on comparison with 1.1

Numerous API changes.

A new hosting API for native applications wishing to host an instance of the .NET

runtime. The new API gives a fine grain control on the behavior of the runtime with

regards to multithreading, memory allocation, assembly loading and more (detailed

reference). It was initially developed to efficiently host the runtime in Microsoft SQL

Server, which implements its own scheduler and memory manager.

Full 64-bit support for both the x64 and the IA64 hardware platforms.

Language support for generics built directly into the .NET CLR.

Many additional and improved ASP.NET web controls.

11

Page 12: e Advertisement

New data controls with declarative data binding.

New personalization features for ASP.NET, such as support for themes, skins and

webparts.

.NET Micro Framework - a version of the .NET Framework related to the Smart

Personal Objects Technology initiative.

4) .NET Framework 3.0

.NET Framework 3.0, formerly called WinFX, includes a new set of managed code APIs

that are an integral part of Windows Vista and Windows Server 2008 operating systems. It is

also available for Windows XP SP2 and Windows Server 2003 as a download. There are no

major architectural changes included with this release; .NET Framework 3.0 uses the

Common Language Runtime of .NET Framework 2.0. Unlike the previous major .NET

releases there was no .NET Compact Framework release made as a counterpart of this

version.

.NET Framework 3.0 consists of four major new components:

Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user

interface subsystem and API based on XML and vector graphics, which uses 3D

computer graphics hardware and Direct3D technologies. See WPF SDK for developer

articles and documentation on WPF.

Windows Communication Foundation (WCF), formerly code-named Indigo; a

service-oriented messaging system which allows programs to interoperate locally or

remotely similar to web services.

12

Page 13: e Advertisement

Windows Workflow Foundation (WF) allows for building of task automation and

integrated transactions using workflows.

Windows CardSpace , formerly code-named InfoCard; a software component which

securely stores a person's digital identities and provides a unified interface for choosing

the identity for a particular transaction, such as logging in to a website.

5) .NET Framework 3.5

Version 3.5 of the .NET Framework was released on 19 November 2007, but it is not included

with Windows Server 2008. As with .NET Framework 3.0, version 3.5 uses the CLR of

version 2.0. In addition, it installs .NET Framework 2.0 SP1 and .NET Framework 3.0

SP1, which adds some methods and properties to the BCL classes in version 2.0 which are

required for version 3.5 features such as Language Integrated Query (LINQ). These changes

do not affect applications written for version 2.0, however.

As with previous versions, a new .NET Compact Framework 3.5 was released in tandem

with this update in order to provide support for additional features on Windows Mobile and

Windows Embedded CE devices.

The source code of the Base Class Library in this version has been partially released (for

debugging reference only) under the Microsoft Reference Source License.

Changes since version 3.0

New language features in C# 3.0 and VB.NET 9.0 compiler

Adds support for expression trees and lambda methods

13

Page 14: e Advertisement

Extension methods

Expression trees to represent high-level source code at runtime.

Anonymous types with static type inference

Language Integrated Query (LINQ) along with its various providers

LINQ to Objects

LINQ to XML

LINQ to SQL

Paging support for ADO.NET

ADO.NET synchronization API to synchronize local caches and server side datastores

Asynchronous network I/O API

Peer-to-peer networking stack, including a managed PNRP resolver

Managed wrappers for Windows Management Instrumentation and Active Directory

APIs

Enhanced WCF and WF runtimes, which let WCF work with POX and JSON data, and

also expose WF workflows as WCF services. WCF services can be made stateful using

the WF persistence model.

Support for HTTP pipelining and syndication feeds.

ASP.NET AJAX is included

14

Page 15: e Advertisement

New System.CodeDom namespace.

Service Pack 1

The .NET Framework 3.5 Service Pack 1 was released on August 11, 2008. This release adds

new functionality and provides performance improvements in certain conditions, especially

with WPF where 20-45% improvements are expected. Two new data service components

have been added, the ADO.NET Entity Framework and ADO.NET Data Services. Two new

assemblies for web development, System.Web.Abstraction and System.Web.Routing, have

been added; these are used in the upcoming ASP.NET MVC Framework and, reportedly, will

be utilized in the future release of ASP.NET Forms applications. Service Pack 1 is included

with SQL Server 2008 and Visual Studio 2008 Service Pack 1.

There is also a new variant of the .NET Framework, called the ".NET Framework Client

Profile" which is 86% smaller than the full framework and only installs components relevant

to desktop applications.

.NET vs. JAVA

1) If the application is Windows platform specific then use .Net

15

Page 16: e Advertisement

2) .Net is Language independent, so if the team has multiple skill expertise C#, VB.NET, C++, developers can still work on the same project with different skill set.

3) MS technologies provides RAD (rapid application development) to deliver project faster, customers always prefer faster delivery.

4) Debugging is very effort-less therefore, can fix the bugs quicker.

5) Deployment is very easy and simple.

6) Ajax implementation is simple & easy.

7) It is a user friendly as you have to only click and drag the controls on the form events is

automatically generated.

8) It is faster development environment we can create application easily.

9) .NET 2005 reduces the code up to 70% because of its build in controls.

10) One can easily developed the application with less effort compare to JAVA.

Companies using ASP.NET today to provide solutions to their customers

16

Page 17: e Advertisement

MySpace.com Costco.com

Dell.com HSN.com

Legos.com LondonStock.com

17

Page 18: e Advertisement

Match.com Monster.com

NHS.com NewEgg.com

Why we have used ASP.NET for this project?

18

Page 19: e Advertisement

ASP.NET drastically reduces the amount of code required to build large applications.

ASP.NET makes development simpler and easier to maintain with an event-driven,

server-side programming model.

ASP.NET pages are easy to write and maintain because the source code and HTML are

together.

The source code is executed on the server. The pages have lots of power and flexibility

by this approach.

The source code is compiled the first time the page is requested. Execution is fast as the

Web Server compiles the page the first time it is requested. The server saves the

compiled version of the page for use next time the page is requested.

The HTML produced by the ASP.NET page is sent back to the browser. The

application source code you write is not sent and is not easily stolen.

ASP.NET makes for easy deployment. There is no need to register components because

the configuration information is built-in.

The Web server continuously monitors the pages, components and applications running

on it. If it notices memory leaks, infinite loops, other illegal software or activities, it

seamlessly kills those activities and restarts itself.

ASP.NET validates information (validation controls) entered by the user without

writing a single line of code.

19

Page 20: e Advertisement

ASP.NET easily works with ADO.NET using data-binding and page formatting

features.

An ASP.NET application runs faster and counters large volumes of users without

performance problems.

20

Page 21: e Advertisement

PROJECT OBJECTIVE

E-Advertisement is a project designed for the general public to fulfill their needs.

E-Advertisement is a fruitful process as it is Convenient, savings in time, consistency between

advertised price and site price, information on product comparison easily available,

sometimes price comparison available online, third party shopping sites keeping merchants

competitive hence offering the best products and prices, large online advertising site offering

store comparison.

 

21

Page 22: e Advertisement

INTRODUCTION

Speaking about E advertising, it is a form of direct marketing which uses e-mail as a

means of communicating commercial or fund raising messages to an audience. In its

broadest sense, every e-mail sent to a potential or current customer could be considered

as E advertising. There are millions of users and thousands more coming online daily so

conducting business on the internet is growing at an unprecedented rate.

One of the common ways to support the cost of publishing is through advertising. While

the web lowers the cost of publishing and allows even small organizations to become e-

publishers, the cost of supporting advertising may be prohibitive. One way around this is

to aggregate the advertising through a broker, such as Google which provides with their

Ad Words and Ad Sense services.

When talking about E advertising, the advertising broker accepts advertising and then

places it with suitable web sites. The broker is paid by the advertiser and then shares

some of the payment with the web site publisher. This process can be automated, with

the advertiser providing describing the type of web sites they would like to advertise on

and this then being matched with suitable sites by using meta data about the geographic

region and suitable keywords.

22

Page 23: e Advertisement

The price of the advertisement can be determined by auctioning the web sites, the price

being determined by the most popular keywords. In this way, in effect, the meta data

about the web pages and the advertisements become commodities and proxies for the

advertisements and web page contents. Google is one such search engine which uses this

process.

So nowadays when people discuss about E advertising the most common word for this is

"online advertising". It is an advertising carried out in the online environment. For

example, via Web Sites, email, ads supported software, etc. Though the forms and

mediums have changed, for example web space and advergaming as opposed to

magazine and outdoor advertising. Many of the basic principles remain the same as

traditional advertising like organizations utilize paid space to promote their businesses.

E advertising is an important element of a business carried out in an online marketing

operations. It is considered as non-personal information usually persuasive in nature

about a product or service by an identified sponsor, hence all paid space on the web or in

an e-mail. Businesses clearly recognize that by advertising online they reach their target

market in a fast and an efficient way where they can interact with consumers; this is

clearly indicated by the fact that advertising spending was up to 12.6% during the first

part of 2005. In Australia alone, online advertising expenditure rose by 64% in 2004

hitting a record high of $388 million as per the survey by the audit Bureau of

Circulations. Speaking about E advertising, it has created innovative, comparatively low

cost and highly targeted opportunities for the online advertisers and marketers.

23

Page 24: e Advertisement

SYSTEM ANALYSIS

The analysis model must achieve three primary objectives: -

1. To describe the requirements of the customer.

2. To establish a basis for the creation of a software design.

3. To define a set of requirements that can be validated once software is built.

System Level Goals

Data security.

The application should be error free.

Data integrity should be maintained.

Certain data control methods should be tracked.

Easy understanding of the working of the Institution.

24

Page 25: e Advertisement

Requirements to achieve the goals

INPUTS

USER DETAILS (user name, password)

PRODUCT DETAILS (product description, price) (Entered by advertiser)

ADVERTISER DETAILS

OUTPUTS

PRODUCT DETAILS

ADVERTISER DETAIL

USER DETAIL.

SOFTWARE ENGINEERING PARADIGMS APPLIED

25

Page 26: e Advertisement

Introduction:

Software engineering is a layered technology, which comprises of four independent

layers as a quality focus layer, the process layer, the methods layer and the tools layer.

The foundation for the software engineering is the process layer and together with the

technology layer helps the rational and timely development of computer software. The

method layer provides a technical way to perform a broad array of tasks regarding

requirements analysis, design, program construction, testing and maintenance. The tools

lays encompasses the software engineering tools to provide automated or semi automated

support for the process need the methods.

In real world the software development is a teamwork which incorporate a development

strategy the encompasses the process, methods, and tools layers and so the strategy is termed

as a process model or Software Engineering Paradigms.

According to Fritz Bauer “Software engineering is the establishment and use of sound

engineering principles in order to obtain economically software that is reliable and

works efficiently on real machines”. There are several models suggested to go through the

software process. The one most suitable & we opted the linear sequential model to develop

the software.

(We have followed the water fall model approach)

The Water Fall Model

We use this type of model in three conditions:

Our budget is unlimited.

26

Page 27: e Advertisement

Time have no bar. &

Our staff is categorized in class specialist.

The Waterfall model suggests a systematic and sequential approach to the software

development. The very first phase starts from the system level and progresses through

analysis, design, coding, testing, and support. A pictorial view of opted model to

develop the software is depicted in figure.

SOFTWARE REQUIREMENT ANALYSIS:

In the very first approach of software development the requirements gathering process is

performed and later intensified and focused on the software. To understand the various

27

System/Information Engineering

Analysis

Design

Coding

Testing

Water Fall Model

Page 28: e Advertisement

characteristics of the software to be built, first we must have to understand the information

domain for the software, and the required function, behavior, performance, and interface.

Requirements for both the system and the software are documented and must be reviewed

with the customer. Keeping this software engineering paradigm we maintained a proper

documentation of the

Customer’s requirement (Cost Engineering Department) and always reviewed with the

department (the customer). It helped us to minimize the distance between the actual

requirement and the software required and hence kept the customer’s satisfaction very high.

DESIGN:

The design is almost and always a multi step process and focuses on four

distinct attributes of a program:

1. Data Structure

2. Software Architecture

3. Interface Representations and

4. Procedural Detail.

The design process translates requirements into a representation of the

software that can be assessed for quality before coding begins. Like

requirements, the design is documented and becomes part of the software

configuration.

Code Generation:

28

Page 29: e Advertisement

The design is translated into a machine-readable form using some programming tools.

TESTING:

Once the design is converted into machine-readable form the program testing phase starts.

The testing process on our software mainly focused on the logical internals of the software,

ensuring that all statements have been tested properly, and on the functional externals.

Through testing we mainly intended to uncover errors and ensured that the defined input

produces the desired results that agree with required results in the specification.

MAINTENANCE:

Software will undoubtedly undergo change after it is delivered to the customer. Change will

occur due to either errors have been encountered or the software have been adapted to

accommodate in its external environment or the customer requires functional or performance

enhancements. Software support/ maintenance reapplies each of the preceding phases to an

existing program rather than a new one. The linear nature of the classic life cycle worked

perfect without any “blocking states” as the project is to be developed by me and my team

member only & hence we started the next phase as soon as the current phase is finished

without waiting for any one else.

29

Page 30: e Advertisement

TESTING

A systematic and wholly procedural plan for testing was adopted the procedure while

implementing testing went in hand with preparing a unit test plan.

Test the modules thoroughly- cover all the access paths. Generate

enough data to cover all the access paths arising from conditions.

Test the modules by passing wrong data.

To test different access paths, look at the conditional statement. Enter

some data in the test file, which would satisfy the condition and again

test the script. Repeat this process many times.

After each test, analyze the log file to ensure proper, understandable

and useful messages are present in the log file.

Test for locking by invoking multiple concurrent processes.

TESTING OBJECTIVES :

Testing is a process of executing a program with the intent of finding an error.

A goal test case is one that has a probability of finding an as yet undiscovered error.

A successful test is one that uncovers an as yet undiscovered error.

TESTING PRINCIPLE

All tests should be traceable to customer requirements.

30

Page 31: e Advertisement

Test should be planned long before testing begins.

The testing should begin “in the small” and progress towards testing “in the large”.

Exhaustive testing is not possible.

To be most efficient, an independent third party should conduct testing.

CHARACTERS OF A GOOD TEST :

A good test has a high probability of finding an error.

A good test is not redundant.

A good test should be best of breed.

A good test should be neither too simple nor too complicated.

TYPES OF TESTING :

WHITE BOX TESTING

BLACK BOX TESTING

31

Page 32: e Advertisement

WHITE BOX TESTING

White Box testing which is performed early in the testing process is also called glass-box

testing. Using white box testing, the software engineer can derive test cases that

1. Guarantee that all the independent paths within the module have been exercised at

least once.

2. Exercise all logical decisions on their true and false sides.

3. Execute all loops at their boundaries and within their operational bounds.

4. Exercise internal data structure to assure their validity.

BLACK BOX TESTING

Black box testing to be applied during later stage of testing. Black box testing focuses

on the functional requirement of the software. Black box testing enables the software engineer

to derive sets of input conditions that will fully exercise the functional requirement of a

program.

Black box testing enables to find error in the following categories:-

Incorrect or missing functions. Interface errors. Errors in the data structure or external database access. Performance errors. Initialization and termination errors

By applying Black box testing a set of test cases that satisfy the following criteria ---

32

Page 33: e Advertisement

Test cases that reduce, by a count that is greater than one, the number of additional

test case must be designed to achieve reasonable testing.

Test cases that tell us something about the presence or absence of classes of errors,

rather than associated only with the specific test at the hand

33

Page 34: e Advertisement

ANALYSIS MODELING

Data Modeling

Data modeling is very important part of the analysis it mainly deals with the data

object and their relationship. With the help of data model one can easily identify the

primary objects to be process by the system. Data model makes Entity-Relationship

(ER) diagram to describe the relationship between entities. The data model considers the

data independent of the processing that transform the data.

Data modeling answers a set of specific questions that are relevant to any data

processing application. What are the primary data objects to be processed by the

system? What is the composition of each data object and what attributes describe the

object? What do the objects currently reside? What are the relationship between each

object and other objects? What are the relationships between the objects and the

processes that transform them?

Data Objects and Attributes

The data model consist the data objects and attributes that describe the data

object. A data object is the representation of any composite information that is processed

by computer software. A data object can be an external entity, a thing, an occurrence or

event, a role, a structure etc. A data object encapsulates the data only—there is no

reference within a data object to operations that act on the data. So the data object can be

a table.

34

Page 35: e Advertisement

Attributes define the properties of a data object and take on one of three different

characteristics.

Name an instance of the data object

Describe the instance

Make reference to another instance in another table.

Also one or more attribute can be defined as identifier i.e. - Key. The key is used to

make the relationship with the attribute of another data object. It may or may not be

unique. In our context, we can say that as our project is RDBMS, so here relationship

between various data object is essential to get required information and result the user

want. So key has very important role here to make references as well as referential

integrity and to prevent from data redundancy.

Cardinality

Cardinality defines the maximum number of objects that can be participating in a

relationship. According to Tillman, the cardinality is the specification of the number of

occurrences of one object that can be related to the number of occurrences of another

object. Taking into consideration all combinations of ‘one’ and ‘many’ two objects can

be related as:

One-to-One (1:1)

One-to-Many (1: M)

Many-to-One (M: 1)

Many-to-Many (M: N)

35

Page 36: e Advertisement

Entity Relationship Diagram

The Entity Relationship Diagrams (ERD) is the graphical notation of relationship

between data object and attributes. The ERD was originally proposed by Peter Chen for

the design of relational database systems and has been extended by others. Sets of

primary components are identified for the ERD: data objects, attributes, relationship,

and various type indicators. The primary purpose of the ERD is to represent data objects

and their relationship.

36

Page 37: e Advertisement

ER diagram for E-Advertisement

37

Page 38: e Advertisement

Data Flow Diagram

The Data Flow Diagram is the graphical representation that depicts information flow

and the transforms that are applied as data move from input to output. DFD is a model,

which gives the insight into the information domain and functional domain at the same

time. DFD is refined into different levels. The more refined DFD is more details of the

system are incorporated. In the process of creating a DFD, we decompose the system

into different functional subsystems. The DFD refinement results in a corresponding

refinement of data.

The DFD at the simplest level is referred to as the ‘CONTEXT ANALYSIS

DIAGRAM’. These are expanded by level, each explaining its process in detail.

Processes are numbered for easy identification and are normally labeled in block

letters. Each data flow is labeled for easy understanding.

38

Page 39: e Advertisement

DFD FOR E-Advertisement

LEVEL 0 DFD:

LEVEL 1 DFD:

39

Page 40: e Advertisement

SOURCE CODE

Home Page

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div style="height: 529px; width: 749px" align="center"> <table style="width:100%; height: 320px;"> <tr> <td colspan="2" style="font-weight: bold; font-style: inherit; font-variant: normal; text-transform: uppercase; color: #FF0000; text-decoration: underline; font-family: 'Comic Sans MS';"> LOGIN<br /> <br />

40

Page 41: e Advertisement

</td> </tr> <tr> <td align="left" class="style4"> User Name</td> <td class="style7"> <asp:TextBox ID="txtusername" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtusername" ErrorMessage="Enter User Name"></asp:RequiredFieldValidator> </td> </tr> <tr> <td align="left" class="style5"> Password</td> <td class="style8"> <asp:TextBox ID="txtpassword" runat="server" TextMode="Password" ontextchanged="txtpassword_TextChanged"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtpassword" ErrorMessage="Enter Password"></asp:RequiredFieldValidator> </td> </tr> <tr> <td align="left" colspan="2"> <br /> <br /> <asp:Button ID="btnSubmit" runat="server" onclick="Button1_Click" Text="Submit" /> </td> </tr> <tr> <td align="left" colspan="2"> <asp:Label ID="lblError" runat="server"></asp:Label> </td> </tr> <tr> <td align="left" class="style6" colspan="2"> <asp:HyperLink ID="hypNewuser" runat="server" NavigateUrl="~/Registration.aspx">New User?</asp:HyperLink> </td> </tr> </table> </div> </asp:Content><asp:Content ID="Content2" runat="server" contentplaceholderid="head">

<style type="text/css"> .style4 { height: 60px;

41

Page 42: e Advertisement

width: 195px; } .style5 { height: 74px; width: 195px; } .style6 { height: 155px; } .style7 { height: 60px; width: 511px; } .style8 { height: 74px; width: 511px; } </style>

</asp:Content>

using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class _Default : System.Web.UI.Page{ string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(strcon); SqlCommand cmd = new SqlCommand("Select Roles from UserRegistration where Username=@uname and Password=@pwd", con); cmd.Parameters.AddWithValue("@uname", txtusername.Text); cmd.Parameters.AddWithValue("@pwd", txtpassword.Text); Session["Name"] = txtusername.Text; con.Open(); SqlDataReader rd = cmd.ExecuteReader(); if (!rd.HasRows) { lblError.Text = "Invalid Username or Password"; } else

42

Page 43: e Advertisement

{ rd.Close(); string x = cmd.ExecuteScalar().ToString(); if (x == "Advertiser") { FormsAuthentication.SetAuthCookie(x, false); Response.Redirect("advertiser/AdvertiserHome.aspx");

} else if (x == "Visitor") { FormsAuthentication.SetAuthCookie(x, false); Response.Redirect("visitor/Visitor home.aspx");

} else if (x == "admin") { FormsAuthentication.SetAuthCookie(x, false); Response.Redirect("admin/welcomeadmin.aspx"); } } con.Close(); } protected void txtpassword_TextChanged(object sender, EventArgs e) {

}}Admin Home

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="welcomeadmin.aspx.cs" Inherits="welcomeadmin" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style4 { width: 461px; } .style5 { width: 195px; } .style6 { width: 206px; } </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table class="style1"> <tr> <td colspan="3"

43

Page 44: e Advertisement

style="text-align: center; font-weight: bold; font-size: xx-large; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #800000;"> WELCOME ADMINISTRATOR</td> </tr> <tr> <td class="style4" style="text-align: left; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #FF0000;"> <asp:LinkButton ID="lbtnaddcategory" runat="server" onclick="lbtnaddcategory_Click" PostBackUrl="~/advertiser/AddProductCategory.aspx">Add Product Categories</asp:LinkButton> </td> <td style="text-align: center; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #800000;" colspan="2"> <asp:LinkButton ID="lbtnsubcategory" runat="server" PostBackUrl="~/advertiser/AddSubCategory.aspx">Add Sub Category</asp:LinkButton> </td> </tr> <tr> <td class="style4" style="text-align: left; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #FF0000;"> <br /> <br /> <br /> <asp:Button ID="btnDeleteAccount" runat="server" onclick="btnDeleteAccount_Click" Text="Delete Account" /> <br /> <br /> <br /> <br /> </td> <td style="text-align: center; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #800000;" class="style5"> <asp:HyperLink ID="hypDeleteVisitor" runat="server" Visible="False" NavigateUrl="~/admin/DeleteVisitor.aspx">Delete Visitor</asp:HyperLink> </td> <td style="text-align: center; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #800000;" class="style6"> <asp:HyperLink ID="hypDeleteAdvertiser" runat="server" Visible="false">Delete Advertiser</asp:HyperLink> </td> </tr> <tr> <td class="style4" style="text-align: left; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #FF0000;"> <br /> <asp:LinkButton ID="lbtnDeleteCat" runat="server">Delete Category</asp:LinkButton> </td>

44

Page 45: e Advertisement

<td style="text-align: center; font-weight: bold; font-size: medium; font-style: normal; font-family: 'Times New Roman', Times, serif; color: #800000;" colspan="2"> &nbsp;</td> </tr> </table> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p></asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;

public partial class welcomeadmin : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {

} protected void lbtnaddcategory_Click(object sender, EventArgs e) {

} protected void btnDeleteAccount_Click(object sender, EventArgs e) { hypDeleteAdvertiser.Visible = true; hypDeleteVisitor.Visible = true; }}

45

Page 46: e Advertisement

Advertiser Home

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdvertiserHome.aspx.cs" MasterPageFile="~/MasterPage.master" Inherits="advertiser_AdvertiserHome" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<style type="text/css"> .style1 { font-style: italic; font-weight: bold; color: #000099; } .style2 { width: 319px; } </style>

<body>

<div style="height: 188px; width: 1018px"> <table style="width: 99%; height: 179px;"> <tr> <td class="style1" colspan="2"> <asp:Label ID="lblName" runat="server"></asp:Label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> &nbsp;</td> </tr> <tr> <td class="style2"> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/advertiser/AddSubCategory.aspx">Add Product Sub Category</asp:HyperLink> </td> <td> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/advertiser/ProductDetails.aspx">New Product</asp:HyperLink> </td> <td> &nbsp;</td> </tr> <tr> <td class="style2"> &nbsp;</td>

46

Page 47: e Advertisement

<td> &nbsp;</td> <td> &nbsp;</td> </tr> </table> </div> </body></asp:Content>

Visitor Home

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Visitor home.aspx.cs" Inherits="visitor_Visitor_home" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style1 { height: 43px; } </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table style="width:100%;"> <tr> <td class="style1"> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</td> </tr> <tr> <td> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> <asp:TemplateField> <ItemTemplate>

47

Page 48: e Advertisement

<a href="SeeSubCategories.aspx?Pid=<%#Eval("ProductCategoryId")%>"> <img style="border:none;" src='../<%#Eval("ImageName")%>' height="100" width="100" /> </a> &nbsp;&nbsp <%#Eval("ProductCategoryName") %> </ItemTemplate> </asp:TemplateField> </Columns> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView> </td> </tr> </table></asp:Content>

using System;using System.Collections;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Web.Configuration;

public partial class visitor_Visitor_home : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon);

48

Page 49: e Advertisement

string strcmd = "select * from ProductCategory"; SqlDataAdapter dap = new SqlDataAdapter(strcmd, conn); DataSet dst = new DataSet(); dap.Fill(dst); GridView1.DataSource = dst.Tables[0]; GridView1.DataBind(); }}

49

Page 50: e Advertisement

DELETE VISITOR<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="DeleteVisitor.aspx.cs" Inherits="admin_DeleteVisitor" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateSelectButton="True" onrowdeleting="GridView1_RowDeleting"> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView></asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;

public partial class admin_DeleteVisitor : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {

string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string strcmd = "select * from UserRegistration where Roles='Visitor'";

SqlDataAdapter dap = new SqlDataAdapter(strcmd, conn);

DataSet ds = new DataSet(); dap.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind();

50

Page 51: e Advertisement

} protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) {

}}

ADD PRODUCT CATEGORY

<%@ Page Language="C#" masterpagefile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AddProductCategory.aspx.cs" Inherits="AddProductCategory" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <style type="text/css"> .style1 { color: #0000CC; font-style: italic; font-weight: bold; } .style2 { } .style3 { width: 210px; } </style>

<body> <div style="height: 664px; width: 657px"> <table style="width: 99%; height: 169px;"> <tr> <td class="style1" colspan="3"> ADD NEW PRODUCT CATEGORY</td> </tr> <tr> <td class="style3"> Product Category Name</td> <td> <asp:TextBox ID="txtProductCategoryName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtProductCategoryName" ErrorMessage="Enter Product Category Name"></asp:RequiredFieldValidator> </td> <td> &nbsp;</td>

51

Page 52: e Advertisement

</tr> <tr> <td class="style3"> Image Name</td> <td> <asp:FileUpload ID="FileUpload1" runat="server" /> </td> <td> &nbsp;</td> </tr> <tr> <td class="style2" colspan="3"> <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" Text="Submit" style="height: 26px" /> </td> </tr> </table> </div>

</body>

</asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Web.Configuration;

public partial class AddProductCategory : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {

} protected void btnSubmit_Click(object sender, EventArgs e) { string query; query = "insert into ProductCategory (ProductCategoryName,ImageName) values ('" + txtProductCategoryName.Text + "','" + FileUpload1.FileName +"')"; ExecuteNonQuery(query); string path = WebConfigurationManager.AppSettings["Images"].ToString(); path = path + FileUpload1.FileName; path = Server.MapPath(path); FileUpload1.SaveAs(path); }

52

Page 53: e Advertisement

void ExecuteNonQuery(string query) { string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); SqlCommand command = new SqlCommand(query, conn); conn.Open(); command.ExecuteNonQuery(); conn.Close(); }}

PRODUCT DETAILS

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master" CodeFile="ProductDetails.aspx.cs" Inherits="advertiser_ProductDetails" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <br /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> <style type="text/css"> .style1 { width: 441px; } </style>

<body> <div> </div> <table style="width: 100%; height: 381px;"> <tr> <td class="style1"> <asp:Label ID="lblProductCategory" runat="server" Text="ProductCategory"></asp:Label> </td> <td> <asp:DropDownList ID="ddlProductCategory" runat="server" onselectedindexchanged="ddlProductCategory_SelectedIndexChanged"> </asp:DropDownList> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblProductSubCategory" runat="server" Text="ProductSubCategory"></asp:Label> </td> <td> <asp:DropDownList ID="ddlProductSubCategory" runat="server"> </asp:DropDownList>

53

Page 54: e Advertisement

</td> </tr> <tr> <td class="style1"> <asp:Label ID="lblprice" runat="server" Text="Price"></asp:Label> </td> <td> <asp:TextBox ID="txtprice" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtprice" ErrorMessage="Enter Price"></asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblManufacture" runat="server" Text="Manufacture"></asp:Label> </td> <td> <asp:TextBox ID="txtman" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblModel" runat="server" Text="Model"></asp:Label> </td> <td> <asp:TextBox ID="txtmodel" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblLength" runat="server" Text="Length"></asp:Label> </td> <td> <asp:TextBox ID="txtlen" runat="server" ontextchanged="TextBox4_TextChanged"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label> </td> <td> <asp:TextBox ID="txttitle" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblSubTitle" runat="server" Text="SubTitle"></asp:Label> </td> <td> <asp:TextBox ID="txtsub" runat="server"></asp:TextBox> </td> </tr>

54

Page 55: e Advertisement

<tr> <td class="style1"> <asp:Label ID="lblDescription" runat="server" Text="Description"></asp:Label> </td> <td> <asp:TextBox ID="txtdes" runat="server" TextMode="MultiLine"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="Label1" runat="server" Text="Year"></asp:Label> </td> <td> <asp:TextBox ID="txtyear" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="lblExpiryDate" runat="server" Text="ExpiryDate"></asp:Label> </td> <td> <asp:TextBox ID="txtexp" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> Phone No.</td> <td> <asp:TextBox ID="txtphone" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" /> </td> <td> &nbsp;</td> </tr> </table> </body></asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;

55

Page 56: e Advertisement

using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;

public partial class advertiser_ProductDetails : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { ddlProductCategory.AutoPostBack = true; if (!IsPostBack) { bind_category(); } }

private void bind_category() { string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string strcmd = "select * from ProductCategory"; SqlCommand cmd = new SqlCommand(strcmd, conn); conn.Open();

ddlProductCategory.DataSource = cmd.ExecuteReader(); ddlProductCategory.DataTextField = "ProductCategoryName"; ddlProductCategory.DataValueField = "ProductCategoryId"; ddlProductCategory.DataBind(); conn.Close(); } public int getuserid() { string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); SqlCommand cmd = new SqlCommand("Select UserId from UserRegistration where UserName=@uname", conn); cmd.Parameters.AddWithValue("@uname", Session["Name"].ToString());

conn.Open(); string x = cmd.ExecuteScalar().ToString(); int a = Convert.ToInt32(x); conn.Close(); return a; }

private void bind_subCategory() {

56

Page 57: e Advertisement

string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string strcmd = "select * from ProductSubCategories where ProductCategoryId=" + ddlProductCategory.SelectedValue; SqlCommand cmd = new SqlCommand(strcmd, conn); conn.Open();

ddlProductSubCategory.DataSource = cmd.ExecuteReader(); ddlProductSubCategory.DataTextField = "ProductSubCategoryName"; ddlProductSubCategory.DataValueField = "ProductSubCategoryId"; ddlProductSubCategory.DataBind(); conn.Close(); }

protected void btnSubmit_Click(object sender, EventArgs e) { int a = getuserid(); string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string cmd = "insert into ProductDetails (UserId,ProductCategoryId,ProductSubCategoryId,Price,Manufacture,Model,Length,Title,SubTitle,Description,Year,ExpiryDate,PhoneNumber) values ('" +a +"','"+ ddlProductCategory.SelectedValue + "','" + ddlProductSubCategory.SelectedValue + "','" + txtprice.Text + "','" + txtman.Text + "','" + txtmodel.Text + "','" + txtlen.Text + "','" + txttitle.Text + "','" + txtsub.Text + "','" + txtdes.Text + "','" + txtyear.Text + "','" + txtexp.Text + "','" + txtphone.Text + "')"; ExecuteNonQuery(cmd); }

protected void ddlProductCategory_SelectedIndexChanged(object sender, EventArgs e) { bind_subCategory(); } void ExecuteNonQuery(string query) { string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon);

SqlCommand command = new SqlCommand(query, conn); conn.Open(); command.ExecuteNonQuery(); conn.Close(); } protected void TextBox4_TextChanged(object sender, EventArgs e) {

} protected void Button1_Click(object sender, EventArgs e) { getuserid(); }

57

Page 58: e Advertisement

}

APPCODE FOR PRODUCTCATEGORY

using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.ComponentModel;

/// <summary>/// Summary description for ProductCategory/// </summary>public class ProductCategory{ public ProductCategory() { // // TODO: Add constructor logic here // }

private string productName; public string ProductName { get { return productName; } set { productName = value; } }

private string productImage; [Browsable(false)] public string ProductImage { get { return productImage; } set { productImage = value; } }}

APPCODE FOR PRODUCTSUBCATEGORY

using System;using System.Data;using System.Configuration;using System.Linq;

58

Page 59: e Advertisement

using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.ComponentModel;

public class ProductSubCategory{ public ProductSubCategory() { // // TODO: Add constructor logic here // }

private string productName; public string ProductName { get { return productName; } set { productName = value; } }

private string productImage; [Browsable(false)] public string ProductImage { get { return productImage; } set { productImage = value; } }}

VIEW SUBCATEGORY

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SeeSubCategories.aspx.cs" Inherits="visitor_SeeSubCategories" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateField> <ItemTemplate> <a href="SubCategoryDetails.aspx?Pid=<%#Eval("ProductSubCategoryId") %>"> <img style="border:none;" src='../<%#Eval("ImageName")%>' height="100" width="100" /> </a> &nbsp;&nbsp

59

Page 60: e Advertisement

<%#Eval("ProductSubCategoryName") %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView></asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Web.Configuration;using System.Collections.Generic;

public partial class visitor_SeeSubCategories : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { // List<ProductSubCategory> productSubCategoryList = new List<ProductSubCategory>(); string pid = Request.QueryString["Pid"].ToString(); string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string strcmd = "select * from ProductSubCategories where ProductCategoryId=@pid";

SqlDataAdapter dap = new SqlDataAdapter(strcmd, conn); dap.SelectCommand.Parameters.AddWithValue("@pid",pid); DataSet ds = new DataSet(); dap.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind();

}}

VIEW SUBCATEGORY DETAILS

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SeeSubCategories.aspx.cs" Inherits="visitor_SeeSubCategories" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

60

Page 61: e Advertisement

</asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateField> <ItemTemplate> <a href="SubCategoryDetails.aspx?Pid=<%#Eval("ProductSubCategoryId") %>"> <img style="border:none;" src='../<%#Eval("ImageName")%>' height="100" width="100" /> </a> &nbsp;&nbsp <%#Eval("ProductSubCategoryName") %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView></asp:Content>

using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Web.Configuration;using System.Collections.Generic;

public partial class visitor_SeeSubCategories : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { // List<ProductSubCategory> productSubCategoryList = new List<ProductSubCategory>(); string pid = Request.QueryString["Pid"].ToString(); string strcon = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"; SqlConnection conn = new SqlConnection(strcon); string strcmd = "select * from ProductSubCategories where ProductCategoryId=@pid";

SqlDataAdapter dap = new SqlDataAdapter(strcmd, conn); dap.SelectCommand.Parameters.AddWithValue("@pid",pid); DataSet ds = new DataSet(); dap.Fill(ds); GridView1.DataSource = ds.Tables[0];

61

Page 62: e Advertisement

GridView1.DataBind();

}}

62

Page 63: e Advertisement

OUTPUT

63

Page 64: e Advertisement

LOGIN

64

Page 65: e Advertisement

65

Page 66: e Advertisement

Sign Up Form

66

Page 67: e Advertisement

Admin Home Page

67

Page 68: e Advertisement

Visitor Home Page

68

Page 69: e Advertisement

Product Subcategory

69

Page 70: e Advertisement

70

Page 71: e Advertisement

Product Detail

71

Page 72: e Advertisement

Add Product Sub Category

72

Page 73: e Advertisement

73

Page 74: e Advertisement

Add New Product

74

Page 75: e Advertisement

CONCLUSION

Online advertisement is a web based service that offers advertising of consumer products.

This web based service provides catalogs for various categories of products that helps

customer to find and choose the product he needs.

The site provides different user friendly ways for browsing the listed products -by brand name

and product type. Site provides the feature that enables customer to view products and

advertiser to add product at any time of browsing the site. Site provides login facility by

which customer can login and view products.

The site provides interface for the administrators to administer the site by providing options

such as adding new products, updating details of products and managing customer accounts .

75

Page 76: e Advertisement

SYSTEM

REQUIREMENTS

Hardware Requirements:

Memory: 32 MB RAM

Hard Disk: Approximately 5 MB

Mouse: Standard Serial Mouse

Keyboard: 101/104 Keys

Software Requirements:

Operating System: Microsoft Visual Studio 2008

SQL Server

76

Page 77: e Advertisement

BIBLIOGRAPHY

ASP.NET 3.5 Unleashed

- Stephen Walther

Pro ASP.NET 3.5 in C# 2008

( 2nd Edition)

- Matthew MacDonald

77