Вы находитесь на странице: 1из 99

ABSTRACT

Online Advertising can easily handle the advertising needs. You may need to
design an ad for your business, looking for placing a matrimonial advertisement
or perhaps you want to publish an advertisement in newspaper for job
recruitment. Maybe you want to create a catalog to showcase your products, or
make a flyer to announce a special event. Whatever marketing service you
require, we are the advertising company that will provide you with the
exceptional customer service you are seeking.

Benefits of online advertising:


 Online advertising is the means of promoting a product on the Internet
using various Internet features. With the arrival of Internet, the business
world has become digitalized and people prefer buying things online,
which is easier and faster.

 The primary benefit of online advertising over offline business is


monetary advantage, which cannot be gained locally. This leads to great
progress in business, which is the ultimate aim of any businessman.
Online advertising offers a wide spectrum of recognition, which is
incomparable to any other mode of advertising.

 Online advertising has no time limitations and is viewed day and night
throughout the globe. Online advertising reduces the transaction cost and
contributes to the profit of the company and is secure in competition
against international marketing. The owner is much more satisfied
because a secure business is more beneficial and reliable.

1
 Online advertising is one step ahead over others and helps to keep pace
with the fast changing world. 'Pay- per- click' advertising is one form of
advertisement and is a very cost effective way of getting advertised for
the price of a half page advertisement in a regional newspaper.

 Small businesses find online advertising offering maximum exposure for


a minimal cost. Small businesses target their ideal clients and find that
online advertising is an affordable way of advertising.

 Online advertising gives a direct response, making it profitable to both


the consumer and the seller. Banner advertisements depict in pictorial
form and are commonly viewed on high traffic sites and also give a
hyperlink back to the advertisers own site.

 The services of online advertisement agencies have made them to run the
campaigns in an effective way and are more feasible. It also helps the
marketers to keep an eye on the performance of advertising campaign,
which is impossible in other types of media.

 The online advertising agency ensures a wide reach to the audience


through the central advertisement server since it uses online advertising
network. In conclusion, online advertising is the cheapest and effective
mode of advertising whose success has proved its potential.

A&S ADVERTISERS has an experience in providing high quality solutions


to clients in diverse business areas. It is on leveraging new technologies using
proven and cost effective method for each client. Working with customers to
achieve their business objectives is its highest priority.

Product Vision

2
To provides consulting with quality and commitment on what it experiences
and expertises.

Mission Statement
To help clients realize their goals in time and to be cost effective

Quality policy
We shall always strive to deliver products, portfolios and services in time
meeting the customer requirements.

The application can be controlled in 2 levels of access:

1. Customer Mode

Website visitors get options to register themselves on the website and browse
through showcased means where they can showcase their advertisements. They
can use television (different channels), internet, newspapers, magazines and
radio where they can choose to show their ads.

2. Administrator Mode

The ATS ADVERTISERS Admin has complete access over the entire website
through his control panel. He gets privileges to manage ads as well as view all
orders placed by the registered users. The entire website can be remotely
administered through the Admin control panel, thereby eliminating the need to
have physical access to the code and database when the application gets
deployed.

3
FEASIBILITY ANALYSIS

A feasibility analysis involves a detailed assessment of the need value and the
practicality of a proposed enterprise, such as system development. The process
of designing and implementing record keeping systems has significant
accountability and resource implications for an organization. Feasibility
analysis will help you make informed and transparent decisions at crucial points
during the development process as you determine whether it is operational,
economically, technically realistic to proceed with a particular course of action.

TYPES OF FEASIBILITY
A feasibility analysis usually involves a thorough assessment of the financial
(value), technical (practicality), and operational (need) aspects of a proposal. In
Internet Management Solution projects, devices used are primarily responsible
for assessing the operational feasibility of the system, and information
technology (IT) analysts are responsible for assessing technical feasibility. Both
then work together to prepare a cost-benefit analysis of the proposed system to
determine its economic feasibility.

Economic Feasibility

For any system if the expected benefits equal or exceed the 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.

Economic analysis is used for evaluating the effectiveness of the proposed


system. In economic feasibility, the most important is cost benefit analysis. As

4
the name suggests, it is an analysis of the cost to be incurred in the system and
benefits derivable out of the system. As in my organization the hardware and
software required for this type of system is already available so economically
our project is feasible.

Cost Benefit Analysis

Developing an IT application is an investment. Since, after developing that


application it provides the organization with profits. Profits can be monetary or
in the form of an improved working environment. However, it carries risks,
because in some cases an estimate can be wrong. And the project might not
actually turn out to be beneficial.

Cost Benefit Analysis helps to give management a picture of cost, benefits and
risks. It usually involves comparing alternate investments. Cost Benefit
determines the benefits and savings that are expected form the system and
compare them with the expected costs.

The cost of an information system involves the development cost and


maintenance cost. The development costs are one time investments whereas the
maintenance cost are recurring. The development cost is basically the cost
incurred during the various stages of the system development.

Each phase of the life cycle has a cost. Some examples are:

 Personal

 Equipment

 Supplies

 Overheads etc.

5
After evaluating all the costs involved in the life cycle of the project, the
organization found out that the project is Economical Feasible and will in the
long run benefit the organization.
Operational/Social Feasibility

A systems development project is likely to be operationally feasible if it meets


the ‘needs’ and expectations of the organization. User acceptance is an
important determinant of operational feasibility. It requires careful
consideration of:
 Corporate culture.
 Staff resistance or receptivity to change.
 Management support for the new system.
 The nature and level of user involvement in the development and
implementation the system.
 Direct and indirect impacts of the new system on the work practices.
 Anticipated performance and outcomes of the new system compared with the
existing system.
 Viability of the proposed development and implementation schedule.
 Training requirements and other change management strategies.
 ‘Pay back ‘period (i.e. trade-off between long term organizational benefits and
short term inefficiencies during system development and implementation).

Technical Feasibility

The systems development project may be regarded as technically feasible or


practical if the organization has the necessary expertise and infrastructure to
develop, install, operate and maintain the proposed systems. Organizations will
need to make this assessment based on:
 Knowledge of current and emerging technological solutions;

6
 Availability of technically qualified staff in house for the duration of the
project and subsequent maintenance phase.
 Availability of infrastructure in – house to support the development and
maintenance of the proposed system.
 Where necessary, the financial and/or technical capacity to procure
appropriate infrastructure and expertise from outside.
 Capacity of the proposed system to accommodate increasing levels of use
over the medium term and the capacity of the proposed system to meet initial
performance exceptions and accommodate new functionality over the medium
term.

CONCLUSION

Feasibility analysis provides a means of minimizing risk and improving


accountability in decision- making

7
SOFTWARE REQUIREMENT SPECIFICATION

1. Introduction
1.1 Purpose
1.2 Scope
1.3 Definitions, Acronyms and Abbreviations
1.4 References
1.5 Overview
2. The Overall Description
2.1 Product Perspective
2.1.1 System Interfaces
2.1.2 Interfaces
2.1.3 Hardware Interfaces
2.1.4 Software Interfaces
2.1.5 Communications Interfaces
2.1.6 Memory Constraints
2.1.7 Operations
2.1.8 Site Adaptation Requirements
2.2 Product Functions
2.3 User Characteristics
2.4 Constraints
2.5 Assumptions and Dependencies
2.6 Apportioning of Requirements
3. Specific Requirements
3.1 External Interfaces
3.2 Functions

8
3.3 Performance
3.4 Logical Database Requirements
3.5 Design Constraints
3.6 Software System Attributes
3.6.1 Security
3.6.2 Maintainability
3.6.3 Reliability
3.7 Organizing the Specific Requirements
3.7.1 System Mode
3.7.2 User Class
3.7.3 Objects
3.7.4 Stimulus
3.7.5 Functional Hierarchy
4. Change Management Process

9
SRS DOCUMENT

1. INTRODUCTION:
This document aims at defining the overall s/w requirement for:
“A&S ADVERTISERS WEBSITE”
Efforts have been made to define the requirements exhaustively and accurately.
The final product will be having all the features/functionalities mentioned in
this documents and assumptions for any additional functionality or features
should not be made on the part of any party that is involved in using this
product. In case it is required to have additional features, a formal change
request will need to be raised on the behalf of customer/user’s side and
subsequently a new release of the product will be produced.

1.1 PURPOSE:

This SRS describes the capabilities that will be provided by the web application
“A&S ADVERTIERS Website”. It also states the various requirements
constraints by which the system will abide. The intended audience for this
document is the development team, testing team for end users of the product.

1.2 SCOPE:

The web application product “A&S ADVERTISERS Website” will be of great


use to the users. The application will allow users to upload their ads in various
media. The application will support various functions; features as specified in
the document .This process will provide additional features to the existing
advertising agencies’ website.

10
1.3 DEFINITIONS, ACRONYMS & ABBREVIATIONS:

MS : Microsoft
RAM : Random Access Memory
S/W : Software
H/W : Hardware
SQL : Structured Query Language
WWW : World Wide Web
DBA : Data Base Administrator
Pts. : Points

1.4 REFERENCES:

(i) http://mantrin.com/

(ii) Google Search Engine website - www.google.ac.in

(iii) Software engineering by K.K. Aggarwal.

1.5 OVERVIEW:

The rest of this SRS documents describes the various system requirements,
system interfaces and functionalities of the web application in detail.

2. OVERALL DESCRIPTION:

The web-application A&S ADVERTISERS is an online advertising agency that


provides a user-friendly environment and makes uploading and posting of the
user ads very easy. It is specially designed to take care of the user needs and
provides a comprehensive platform where users can easily add their
advertisements and choose from different media such as print media including
newspaper and magazines. It also includes media like television and radio.
Users can also add banners to the site. The users can register themselves and

11
receive an e-mail confirming the same. Registered job-seekers can also receive
notifications of the job vacancies of the companies registered with A&S
through e-mail.
2.1 PRODUCT PERSPECTIVE:

The application will be a web based application, self-contained product and


dependent on other sources through WWW.

2.1.1 System Interfaces:

This web application will interact to database through SQL server and
interaction with web server will be through .NET Framework and internet
device.
2.1.2 User Interfaces:

The application will have a user-friendly and menu based user interface.
Following screens will be provided:-
 A Login screen for entering username and password will be provided.
There are different login screens for admin and user.
 If the user is not registered the he/she can register to avail the services
 After registration the user can select the medium for advertisement.
 A screen for placing the ad appears according to the medium selected.
 A screen for admin is there where the admin can view the ads placed
by the user.
 A screen is there for the companies to upload their job profiles.

2.1.3 Hardware Interfaces:

12
 Screen resolution of at least 800 x 600(high color) – required for
proper viewing of screens. Higher resolution would not be a
problem.
 Standalone system or network based – not a concern, as it will be
possible to run the application on any of these.
 Microsoft optical or cordless mouse or any other compatible
pointing device.
 Internet connection modem/Ethernet card etc.

2.1.4 Software Interfaces:

 Any windows-based operating system (Windows


95/98/2000/2003/XP/NT/Vista) that supports .NET framework.
 Any web browser such as internet explorer, mozilla firefox or safa
 The .NET framework version 1.x/2.0/3.0, these feature generally
comes pre-installed in Windows XP operating system.
 Microsoft Visual Studio 2005/2008: designing and coding of
website using C#.
 Microsoft SQL Server 2000/2005 for maintaining database.

Software mention in last two points above will be required only for
development of the application. The final application will be packaged as an
independent program that will be delivered to the client.

2.1.5 Communication Interfaces:


Internet protocols such as TCP/IP will be used.

2.1.6 Memory Constraints:

 Processor: Minimum 600 megahertz (MHz) Pentium Processor.


Recommended 2.4 gigahertz (GHz) Pentium processor.
13
 RAM: Minimum 192 megabyte (MB) Kingston/ Transcend/Simtronics RAM.
Recommended 2 gigabyte (GB) Kingston/Transcend/Simtronics RAM.
 Hard Disk: Minimum 2GB of available hard disk space on installation drive
will be required for running the web application.

2.1.7 Operations:
The Database Administrator at the client side will be responsible for manually
deleting old/non-required data. Database backup and recovery will also have to
be handled by DBA. The website will also support copy, download, edit with
MS Word features.

2.1.8 Site Adaptation Requirements:


The terminals or computer systems at client side will have to support the
hardware and software interfaces specified in above sections.

2.2 PRODUCT FUNCTIONS:


Restricted sections will allow access only to authorized users with specific
roles (such as administrator). Depending on the user’s role, he/she will be able
to access only specific modules of the system.
A summary of the major functions that software will perform:
 A login facility for enabling only authorized access to the restricted
sections of the website.
 User with role of Administrator will be able to add/modify/delete
information about different users registered on the website.
 User with role of Administrator will be able to save/delete various
advertisements uploaded by the registered users.

2.3 USER CHARACTERISTICS:


 Education Level: At least 10+2 pass and should be comfortable with

English language.

14
 Experience: Should be well informed about the internet practices.

 Technical Expertise: Should be comfortable using general purpose

applications on a computer.

2.4 CONSTRAINTS:
 Due to limited speed of internet connection being used, system may
become slow with the increase in number of server side controls added on
to the website.
 Due to limited space available on domain, system may become slow as
the amount of data stored in database increases.
 As administrator is a human, website may not be updated on time.

2.5 ASSUMPTION AND DEPENDENCIES:


We are assuming that hardware and software installed on client’s computer will
at least meet the minimum requirements. If, in fact, some requirements are not
satisfied, the SRS would then have to change accordingly.

2.6 APPORTIONING OF REQUIREMENTS:


Not required.

3. SPECIFIC REQUIREMENTS:
This section contains the software requirements to a level of detail sufficient to
enable designers to design the system, and tester to test that system.

3.1 EXTERNAL INTERFACES:


(i) Login Screen:
This will be the first screen that will be displayed. It will allow user and
administrator to access different screens based upon the user's roles.
Various fields available on the screen will be

15
1. User ID: Alphanumeric of length up to 10 characters
2. Password: Alphanumeric of length up to 8 characters
(ii) Medium Selection:

This screen will have information about the various media.


1. Newspaper
2. Magazines
3. Television
4. Banner
5. Radio
6. Internet

(iii) Different media screens:


This screen will display the information that the client is required to add such
as:
 Name of the different media such as TOI in newspaper or 98.3 in radio
 Advertisement Date
 Pattern
 Advertisement size

(iv) Company Login Screen:


This screen will allow the registered companies to login.

(v) Job Profile Screen:


This screen will allow the companies to enter the details of the jobs available in
their respective firms.

(vi) Admin Screen


This screen will be under admin control and allow him/her to upload i.e save
the ad and display it in the selected medium.

16
(vii) Contact Us Screen
This screen contains the offline contact details of the agency.
3.2 FUNCTIONS
(i) Maintenance:
This system will maintain the various uploaded ads as well as the details about
the registered users.
Validity Checks:
 Only user with role of administrator will be authorized to access this
maintenance module.
 Only administrator with correct user name and password can access it.

 Users can only see the information and cannot update it.
 Information fields cannot be left blank.

Error Handling:
If any of the above validation flow does not hold true, appropriate error
messages will be prompted to the user for doing the needful for that.

3.3 PERFORMANCE
 Can support multiple users simultaneously.
 Only one administrator at a time.
 Any amount of information can be handled.

3.4 LOGICAL DATABASE REQUIREMENTS:


The following information will be placed in database:
 User Account Info: UserID, password etc.
 Administrator Account Info: AdminID, password etc.
 Advertisements uploaded
 Job profiles by company
 Registered companies

17
3.5 DESIGN CONSTRAINTS:
None
3.6 SOFTWARE SYSTEM ATTRIBUTES

3.6.1 Security:
This website will be password protected. User will have to enter correct
username, password and role in order to access the application. A user with
incorrect password and username will not be able to access the website.

3.6.2 Maintainability:
The website will be designed in a maintainable manner. it will be easy to
incorporate new requirements in the individual modules; therefore it is easy to
update it and maintain it for a longer duration.

3.6.3 Reliability:
Thos website is built in such a way such that users can rely completely on this
website to upload any kind of ads in any kind of medium.

3.7 ORGANISING THE SPECIFIC REQUIREMENTS:

3.7.1 System Mode:


This system has a single mode operation, which means that whenever the
system is started it opens the common mode login page.

3.7.2 User Class:


This system has two different sets of functions for two different classes of
users:
The two classes of users that are supported by this system are:
 Registered user.

18
 Unregistered user.
The system supports different functionalities for both the classes of users. Some
fields are kept hidden for the unregistered users and are made available to the
registered users.

3.7.3 Objects:
This system consists of various objects. These objects are real world entities
that have a counterpart within the system. Associated with each object is a set
of attributes and functions. These functions are the various services provided by
this system like forums, carrier information. Some objects in this system share
some of the attributes such as the name these are grouped together as classes.

3.7.4 Stimulus:
This system can be best described and organized for a registered user by
describing the functions as a result of the input or the stimuli provided by the
user and thus the functions are functional in terms of the input provided by the
user.

3.7.5 Functional Hierarchy:


Other than these this document is also supported with data flow diagrams to
show the hierarchy of the functions and the various relationships between and
among the functions and data.

4. CHANGE MANAGEMENT PROCESS:

Upon approval of this document, identify (if any) change in management


process to be used to identify, log, evaluate, and update the SRS to reflect
changes in project scope and requirements.

19
20
DATA FLOW DIAGRAM

0-LEVEL DFD OR CONTEXT DIAGRAM

Company
Administrator User
Login

Login Info
Ad Media Option Entry Job Details

User Account Maintenance ADVERTISIN


G AGENCY

Advertisement E-Mail to Registered Notification about


Upload Users Jobs

21
1-LEVEL DFD

GOOGL
E
USER LOGIN SERAC
DETAILS Add Keyword
H
Login

USER Give Medium Option


COMPANY Details for LOGIN/
Registartio REGISTE
n CHOOSE
R
MEDIU
M FOR
AD
COMPA Upload
NY File
LOGIN MEDIA DETAILS

USER ACCOUNT
INFO
UPLOA
REGISTERED D
COMPANIES PAGE

Update User Info USER


Jobs Entry ACCOUNT
MANAGEME
NT

Send
Mail to
Registere
d Users Save
ADS File
DATABA
SE
Check
Details
ADMIN
LOGIN
UPLOAD FILE - MEDIUM

Enter Id,
Password

Manage AVAILAB JOBS DATABASE


Info LE JOBS
ADMINISTRATO
R

22
ER-DIAGRAM

23
SOFTWARE REQUIREMENT ANALYSIS

INTRODUCTION:-

What is .NET?

.Net is the Microsoft platform that are use to develop extensible mark up
language (xml) web service to allow our application to share & communicate
other data over through the internet.

What are web services?

Web services are the application that run on web server and communicate with
other application. It uses a series of protocols to respond to different request.
The protocols on which web services are built are summarized below:

UDDI: stands for universal discovery and description integration. It’s said to be
the yellow pages of web services, which allow businesses to search for other
businesses allowing them to search for the services it needs. Know about the
service and contact them.
WSDL: stands for web services description language, often called as whiz-dull.
WSDL is an XML document that describes a set of SOAP messages and how
those messages are exchanged.
SOAP: stands for simple object access protocols. It’s the communication
protocols for web services.

XML,HTTP and SMTP : stands for extensible markup language, hyper text
transfer protocols and simple message transfer protocols
respectively.UDDI,WSDL and SOAP rely on these protocols for
communication.

24
The .NET Framework

25
GENERAL DESCRIPTION

C# vs. C++ - Differences


 Compile target
 Memory management
 Pointers
 Operator overloads
 Target environments
 Preprocessor directives
 Enumerators
 Destructors
 Classes versus structs

C# vs. C++ - Similarities


 Syntax
 Execution flow
 Exceptions
 Inheritance model
 Constructors

C# vs. C++ - New Features


 Delegates
 Events
 Properties
 Interfaces
 Attributes

26
 Threading
 Reflection
C# vs. C++ - Unsupported
 Multiple inheritance
 Templates
 supported as Generics in version 2.0

General
 No header files, no #include directive

 No requirement for items to be defined before they are referenced in any


individual file
 No linking after compilation to an assembly
 Program entry point:
static int Main(string[] args)
(method of a class)

Language Syntax
 Does not require semicolon after a class definition
 Permits expressions to be used as statements even if they have no effect

(e.g. i+1)
 Case-sensitive
 (Visual Basic .NET is case-insensitive – potential problems with
interoperability)
 No forward declarations
 the order of definitions is not significant
 No separation of definition and declaration

Recommended Tags

27
<c> - text in a code-like font
<code> - one or more lines of source code or program output
<example> - an example
<exception> - the exceptions a method can throw
<include> - includes XML from an external file
<list> - list or table
<para> - permits structure to be added to text
<param> - parameter for a method or constructor
<paramref> - identifies that a word is a parameter name
<permission> - the security accessibility of a member
<remarks> - a type
<returns> - the return value of a method
<see> - a link
<seealso> - See Also entry
<summary> - a member of a type
<value> - a property

Accessing Data In Connected Ado.Net Architecture:-

28
In connected architecture database connection need to open and close explicitly.
While accessing data, the respective database needs to be connected.

Accessing Data In Connected Ado.Net Architecture:-

CONNECTION OBJECT:-
The Connection object creates the connection to the database. Microsoft Visual
Studio .NET provides two types of Connection classes. The Connection object
contains all of the information required to open a connection to the database.

Dim cnNorthwind as New System.Data.SqlClient.SqlConnection("User ID=sa;


Password=2389; Initial Catalog=Northwind; Data Source=London; Connection
TimeOut=60;”)

COMMAND OBJECT:-
Command objects are used to execute commands to a database across a data
connection. The Command objects can be used to execute stored procedures on
the database, or return complete tables directly.

Dim sql As String = "SELECT UnitsInStock FROM Products WHERE


ProductID = @ProdID"

29
Dim cmdProducts As SqlCommand (sql, cnNorthwind)

COMMAND OBJECT:-
Command objects provide three methods that are used to execute commands on
the database:
 ExecuteNonQuery()-Executes commands that have no return values

such as INSERT, UPDATE or DELETE


 ExecuteScalar()-Returns a single value from a database query

 ExecuteReader()-Returns a result set by way of a DataReader object

DATA READER OBJECT:-


The DataReader object provides a forward-only, read-only, connected stream
recordset from a database.
Because only one row is in memory at a time, the DataReader provides the
lowest overhead in terms of system performance but requires the exclusive use
of an open Connection object for the lifetime of the DataReader.

Dim rdrProducts As SqlDataReader


rdrProducts = cmdProducts.ExecuteReader()

DATA ADAPTER OBJECT:-


The DataAdapter is the class at the core of ADO .NET's disconnected data
access. The DataAdapter is used either to fill a DataTable or DataSet with data
from the database with it's Fill method. After the memory-resident data has
been manipulated, the DataAdapter can commit the changes to the database by
calling the Update method.

Dim cnNorthwind As New SqlConnection(“…”)


Dim daProducts As New SqlDataAdapter(SELECT * FROM
Products“,cnNorthwind)

30
DATASET OBJECT:-
The dataset is a disconnected, in-memory representation of data. It can be
considered as a local copy of the relevant portions of the database. The DataSet
is persisted in memory and the data in it can be manipulated and updated
independent of the database. When the use of this DataSet is finished, changes
can be made back to the central database for updating. The data in DataSet can
be loaded from any valid data source like Microsoft SQL server database, an
Oracle database or from a Microsoft Access database.

Dim dsCustomers As New DataSet()


daCustomers.Fill(dsCustomers, "Customers")

DATASET OBJECT:-

XML:-
Extensible Markup Language is a text based structured language, used for
presentation of the data.
XML is an alternative for HTML , but HTML is more presentation centric and
XML on other hand is more data centric. In other word HTML focused on how
we present our data, but XML focused on what data need to present.

STRUCTURED QUERY LANGUAGE

31
SQL (Structured Query Language) a database computer language designed
for managing data in relational database management systems (RDBMS). Its
scope includes data query and update, schema creation and modification, and
data access control. SQL was one of the first languages for Edgar F. Codd's
relational model in his influential paper, "A Relational Model of Data for Large
Shared Data Banks" and became the most widely used language for relational
databases.

Language elements

The SQL language is sub-divided into several language elements, including:

• Clauses, which are in some cases optional, constituent components of


statements and queries.
• Expressions which can produce either scalar values or tables consisting
of columns and rows of data.
• Predicates which specify conditions that can be evaluated to SQL three-
valued logic (3VL) Boolean truth values and which are used to limit the
effects of statements and queries, or to change program flow.
• Queries which retrieve data based on specific criteria.
• Statements which may have a persistent effect on schemas and data, or
which may control transactions, program flow, connections, sessions, or
diagnostics.
o SQL statements also include the semicolon (";") statement
terminator. Though not required on every platform, it is defined as
a standard part of the SQL grammar.
• Insignificant whitespace is generally ignored in SQL statements and
queries, making it easier to format SQL code for readability.

32
Queries

The most common operation in SQL is the query, which is performed with the
declarative SELECT statement. SELECT retrieves data from one or more
tables, or expressions. Standard SQL statements have no persistent effects on
the database. Some non-standard implementations of SELECT can have
persistent effects, such as the SELECT INTO syntax that exists in some
databases.

Queries allow the user to describe desired data, leaving the database
management system (DBMS) responsible for planning, optimizing and
performing the physical operations necessary to produce that result as it chooses

A query includes a list of columns to be included in the final result immediately


following the SELECT keyword. SELECT is the most complex statement in
SQL, with optional keywords and clauses that include:

• The FROM clause which indicates the table(s) from which data is to be
retrieved. The FROM clause can include optional JOIN subclauses to
specify the rules for joining tables.
• The WHERE clause includes a comparison predicate, which restricts the
rows returned by the query. The WHERE clause eliminates all rows from
the result set for which the comparison predicate does not evaluate to True.
• The GROUP BY clause is used to project rows having common values into
a smaller set of rows. GROUP BY is often used in conjunction with SQL
aggregation functions or to eliminate duplicate rows from a result set. The
WHERE clause is applied before the GROUP BY clause.
• The HAVING clause includes a predicate used to filter rows resulting
from the GROUP BY clause. Because it acts on the results of the GROUP

33
BY clause, aggregation functions can be used in the HAVING clause
predicate.

• The ORDER BY clause identifies which columns are used to sort the
resulting data, and in which direction they should be sorted (options are
ascending or descending). Without an ORDER BY clause, the order of rows
returned by an SQL query is undefined.

HTML-HYPERTEXT MARKUP LANGUAGE

HTML, which stands for Hypertext Markup Language, is the predominant


markup language for web pages. It provides a means to create structured
documents by denoting structural semantics for text such as headings,
paragraphs, lists etc as well as for links, quotes, and other items. It is written in
the form of HTML elements consisting of "tags" surrounded by angle brackets
within the web page content. It can include or can load scripts in languages such
as JavaScript, which affect the behavior of HTML processors like Web
browsers, and Cascading Style Sheets (CSS) to define the appearance and
layout of text and other material. The use of CSS is encouraged over explicit
presentational markup.

Data types

HTML defines several data types for element content, such as script data and
style sheet data, and a plethora of types for attribute values, including IDs,
names, URIs, numbers, units of length, languages, media descriptors, colors,
character encodings, dates and times, and so on.

34
Delivery of HTML

HTML documents can be delivered by the same means as any other computer
file; however, they are most often delivered either by HTTP from a Web server
or by e-mail.

Document structure elements

<html>...</html>

The Root element of an HTML document; all other elements are


contained in this.
<head>...</head>
Container for processing information and metadata for an HTML
document.
<body>...</body>
Container for the displayable content of an HTML document.

Document head elements


<base>
Specifies a base URL for all relative href and other links in the
document. Must appear before any element that refers to an external
resource. HTML permits only one base element for each document. The
base element has attributes, but no contents.

<link>

Specifies links to other documents, such as previous and next links, or


alternate versions. A common use is to link to external stylesheets, using
the form:

35
<link rel="stylesheet" type="text/css" href="url"
title="description_of_style">

<script>…</script>

Can act as a container for script instructions or link to an external script


with the optional src attribute.] Also usable in the document body to
dynamically generate either both block or inline content.
<style>…</style>
Specifies a style for the document, usually in the form:
<style type="text/css"> … </style>
Can either act as a container for style instructions or link to external
stylesheets – for example, in CSS, with @import directives of the form:
<style> @import url; </style>
<title>…</title>
Define a document title. Required in every HTML and XHTML
document. User agents may use the title in different ways. For example:

• Web browsers usually display it in a window’s title bar


when the window is open, and (where applicable) in the task bar
when the window is minimized.
• It may become the default filename when saving the page.
• Search engines’ web crawlers may pay particular attention
to the words used in the title.

The title element must not contain other elements, only text. Only one
title element is permitted in a document.
Non-standard elements
This section lists some unofficial or proprietary elements which have existed.
They may not be supported in all user agents.

36
<blink>…</blink> (unofficial)
Causes text to blink. Can be done with CSS where supported: {text-
decoration: blink} (This effect may have negative consequences for some
users with epilepsy, its use on the public internet should follow the
appropriate guidelines.)
<marquee>…</marquee> (unofficial)
Creates scrolling text. Can be done with scripting. (Under some
conditions, this effect may have potentially fatal consequences for some
users with epilepsy[citation needed]; its use on the public internet should follow
the appropriate guidelines.)
<blackface>…</blackface> (unofficial)
Supported only in WebTV browsers, generates extra bold lettering.[14]
Can be done with CSS where supported: {font-weight: 900}; with some
fonts (such as Arial or Gill Sans), using "black" or "ultra bold" variants
are more effective.
<shadow>…</shadow> (unofficial)
Supported only in WebTV browsers, generates a shadow underneath text.
It is supported in CSS3 via the text-shadow property.

37
PROJECT PLAN

The following steps are helpful to start off the project.

1. Study and be comfortable with technologies such as

 C# / HTML / XML
 SQL Server etc.

2. Create a database for storing the data of the project.

3. Create a Login page of the system to give access to the users.

4. Create the home page to give the brief description about the project.

38
IMPLEMENTATION

Implementation of the project:-

1. Create a form.

2. Take the controls from the toolbox and arrange them according to
requirement of module.

3. Then create the database required for the form.

4. Now, we have to generate the connection between the sql server and

5. form by using the sqldataadapter in disconnected mode.

6. After creating the connection we create a dataset for the temporary


storage.

39
7. Now we implement the required controls.

8. Then debug the code.

TYPES OF TESTING

 Unit testing:-Each component or part of the program is tested individually

to verify that the detailed design for unit has been correctly implemented.

 Module testing:-In larger system a module may be a group of several

programs or functions or sub-modules testing.

 Integration testing:-It is carried out to find problems in the interfaces

between assembled units/modules in a system.

 System testing:-It is executing a program to check logic changes made in it

and with the intention of finding errors.

 Acceptance testing:-It is running the system with live data by the actual

user. Testing the users accept or reject the system. Implementation phase of
the project starts only if the user accepts the system.

40
 Volume testing:-determines whether or not the system will be able to

handle a large volume of data. The volume should be a representation of the


real life volume with some provision for future growth.

 Performance testing:-this is a corollary to volume testing. This testing

focuses on the performance of the system under large volumes and not just
on the ability to handle it.

 Stress testing:-Every system can experience a period of stress, which

usually lasts for a short period. Although this is not a normal condition, the
system must be capable of handling it.

 Regression testing:-When a system is changed in one part, it is possible

that this change could have affected the behavior of an unchanged part of
the system.

 Interface testing:-whenever two or more modules handle common data

particularly write or update or use it as part of a calculation, then it become


a case for interface testing.

 Security testing: - This attempts to verify that the protection mechanisms

built into a system actually protect the system from unauthorized access.

41
DATABASE TABLES
 Login

 Company Login

 Company

 Admin Newspaper

 Admin Banner

 Admin Internet

 Admin Magazine

 Admin Radio

 Admin Tv

 Newspaper
 Banner
 Internet

42
 Magazine
 Radio
 Television

SNAPSHOTS

43
44
45
46
47
48
49
50
51
52
SOURCE CODE

Home.aspx.cs

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

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


{
SqlConnection con;
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
if (!IsPostBack)
{
TextBox1.Focus();
}
}

53
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Select count(*) from login where username='" +
TextBox1.Text + "' and password='" + TextBox2.Text + "'";
con.Open();
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (i == 1)
{
Session["username"] = TextBox1.Text;
Server.Transfer("media selection.aspx");
}
else
{
Label1.Text = "Invalid Username or Password";
TextBox2.Text = "";
}
}

protected void ImageButton2_Click(object sender, ImageClickEventArgs e)


{

54
Adminlogin.aspx.cs

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

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


{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if ((TextBox1.Text == "") || (TextBox2.Text == ""))
{
Label1.Text = "Enter Login Details";
}
else if ((TextBox1.Text == "admin") && (TextBox2.Text == "gvn"))
{
Response.Redirect("Adminpage.aspx");
}
else
55
{
Label1.Text = "Invalid Username & Password";
}
}
}

56
Admininternet.aspx.cs

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

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


{
public string filename;
public SqlConnection con;
public SqlDataReader dr;
public SqlCommand cmd;
protected void Page_Load(object sender, System.EventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
}

protected void ADD_Click(object sender, System.EventArgs e)


{

57
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string sql = "Insert into admininternet(website)Values('" + TextBox1.Text
+ "')";
cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
TextBox1.Text = "";
Server.Transfer("admininternet.aspx");
}

protected void GridView2_RowCommand(object sender,


GridViewCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
if (e.CommandArgument.ToString().Equals("upload"))
{
LinkButton lnk = (LinkButton)e.CommandSource;
filename = lnk.Text;
//filename =
((LinkButton)e.Item.Cells[10].FindControl("download")).Text;
try
{
string Command = "SELECT * FROM Internet WHERE
uploadcontent='" + filename + "'";

58
cmd = new SqlCommand(Command, con);
con.Open();
cmd.Prepare();
dr = cmd.ExecuteReader();
if (dr.Read())
{
string fName = dr["uploadcontent"].ToString();
if ((fName.EndsWith(".pdf")) || (fName.EndsWith(".PDF")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/pdf";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".doc")) || (fName.EndsWith(".DOC")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/msword";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".txt")) || (fName.EndsWith(".TXT")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/text";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".jpg")) || (fName.EndsWith(".JPG")))

59
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Image/jpg";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".bmp")) || (fName.EndsWith(".BMP")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/msword";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".zip")) || (fName.EndsWith(".ZIP")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/Zip";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".aspx")) ||
(fName.EndsWith(".ASPX")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "weppage/aspxfiles";
Response.BinaryWrite((byte[])dr["content"]);
}
else

60
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/Binary";
Response.BinaryWrite((byte[])dr["content"]);
}
}
}
catch (Exception SqlException)
{
Response.Write("<script>alert('" + SqlException.Message +
"')</script>");
}
finally
{
con.Close();
}
}
else if (e.CommandArgument.ToString().Equals("userdetails"))
{
}
}
}

61
Adminbanner.aspx.cs

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

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


{
public static int numberdiv;
public string filename;
public SqlConnection con;
public SqlCommand cmd;
public SqlDataReader dr;
public SqlDataAdapter sqlda;
public DataSet ds = new DataSet();
protected void Page_Load(object sender, System.EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
62
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.DataGrid1.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.DataGr
id1_PageIndexChanged);
this.DataGrid2.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.DataGr
id2_PageIndexChanged);
this.DataGrid2.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2
_CancelCommand);
this.DataGrid2.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2
_EditCommand);
this.DataGrid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1
_EditCommand);
this.DataGrid1.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.DataG
rid1_SortCommand);
this.DataGrid2.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.DataG
rid2_SortCommand);

63
this.DataGrid2.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2
_UpdateCommand);
this.DataGrid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1
_DeleteCommand);
this.DataGrid2.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2
_DeleteCommand);

}
#endregion

protected void ADD_Click(object sender, System.EventArgs e)


{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
cmd = new SqlCommand("Insert into adminbanner(state,location,place)
Values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox4.Text +
"')",con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
TextBox1.Text = "";
TextBox2.Text = "";
TextBox4.Text = "";
Server.Transfer("adminbanner.aspx");
}

64
private void DataGrid1_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
if (e.CommandArgument == "upload")
{
filename =
((LinkButton)e.Item.Cells[8].FindControl("uploadcontent")).Text;
try
{
string Command = "SELECT * FROM Banner WHERE
uploadcontent='" + filename + "'";
cmd = new SqlCommand(Command, con);
con.Open();
cmd.Prepare();
dr = cmd.ExecuteReader();
if (dr.Read())
{
string fName = dr["uploadcontent"].ToString();
if ((fName.EndsWith(".pdf")) || (fName.EndsWith(".PDF")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/pdf";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".doc")) || (fName.EndsWith(".DOC")))
{

65
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/msword";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".txt")) || (fName.EndsWith(".TXT")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/text";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".jpg")) || (fName.EndsWith(".JPG")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Image/jpg";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".bmp")) || (fName.EndsWith(".BMP")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/msword";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".zip")) || (fName.EndsWith(".ZIP")))
{

66
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/Zip";
Response.BinaryWrite((byte[])dr["content"]);
}
else if ((fName.EndsWith(".aspx")) ||
(fName.EndsWith(".ASPX")))
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "weppage/aspxfiles";
Response.BinaryWrite((byte[])dr["content"]);
}
else
{
Response.AppendHeader("Content-Disposition", "attachment;
filename=" + fName);
Response.ContentType = "Application/Binary";
Response.BinaryWrite((byte[])dr["content"]);
}
}
}
catch (Exception SqlException)
{
Response.Write("<script>alert('" + SqlException.Message +
"')</script>");
}
finally
{

67
con.Close();
}
}
else if (e.CommandArgument == "userdetails")
{
}
else if (e.CommandName == "Edit")
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
Server.Transfer("adminbanner.aspx");
}

}
private void DataGrid2_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
DataGrid2.EditItemIndex = e.Item.ItemIndex;
Server.Transfer("adminbanner.aspx");
}

private void DataGrid1_DeleteCommand(object source,


System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

68
string s = e.Item.Cells[0].Text;
SqlCommand cmd = new SqlCommand("delete from banner where cid='"
+ s + "'", con);
cmd.CommandType = CommandType.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Server.Transfer("adminbanner.aspx");
}
private void DataGrid2_DeleteCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string s = e.Item.Cells[2].Text;
SqlCommand cmd = new SqlCommand("delete from adminbanner where
place='" + s + "'", con);
cmd.CommandType = CommandType.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Server.Transfer("adminbanner.aspx");
}

private void DataGrid2_CancelCommand(object source,


System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid2.EditItemIndex = -1;
this.Page_Load(source, e);

69
}

private void DataGrid1_PageIndexChanged(object source,


System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
Server.Transfer("adminbanner.aspx");
}
private void DataGrid2_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataGrid2.CurrentPageIndex = e.NewPageIndex;
Server.Transfer("adminbanner.aspx");
}
private void DataGrid2_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
TextBox state;
TextBox location;
TextBox place;

state = (TextBox)e.Item.Cells[0].Controls[0];
location = (TextBox)e.Item.Cells[1].Controls[0];
place = (TextBox)e.Item.Cells[2].Controls[0];

string updt = "update adminbanner set


state=@state,location=@location,place=@place where place=@place ";
SqlCommand cmd = new SqlCommand(updt, con);
cmd.Parameters.AddWithValue("@state", state.Text);

70
cmd.Parameters.AddWithValue("@location", location.Text);
cmd.Parameters.AddWithValue("@place", place.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
DataGrid2.EditItemIndex = -1;
Server.Transfer("adminbanner.aspx");
}
private void DataGrid1_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand cmd = new SqlCommand("select * from banner", con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "banner");
con.Open();
DataView dv = new DataView(ds.Tables["banner"]);
if ((numberdiv % 2) == 0)
{
dv.Sort = e.SortExpression + " " + "ASC";
}
else
{
dv.Sort = e.SortExpression + " " + "DESC";
}
numberdiv++;

71
DataGrid1.DataSource = dv;
DataGrid1.DataBind();
}
private void DataGrid2_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand cmd = new SqlCommand("select * from adminbanner",
con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "adminbanner");
con.Open();
DataView dv = new DataView(ds.Tables["adminbanner"]);
if ((numberdiv % 2) == 0)
{
dv.Sort = e.SortExpression + " " + "ASC";
}
else
{
dv.Sort = e.SortExpression + " " + "DESC";
}
numberdiv++;
DataGrid2.DataSource = dv;
DataGrid2.DataBind();
}
}

72
CompanyLogin.aspx.cs

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

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


{
SqlConnection con;
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
cmd = new SqlCommand();
cmd.Connection = con;

73
cmd.CommandText = "Select count(*) from companylogin where
username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'";
con.Open();
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (i == 1)
{
Session["username"] = TextBox1.Text;
Server.Transfer("jobprofile.aspx");
}
else
{
Label1.Text = "Invalid Username or Password";
TextBox2.Text = "";
}
}
}

74
JobProfile.aspx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
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.Data.SqlClient;

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


{
SqlConnection con;
SqlCommand cmd;
//SqlDataAdapter da;
//DataTable dt;
SqlDataReader dr;

protected void Page_Load(object sender, EventArgs e)


{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

}
protected void btnSubmit_Click(object sender, EventArgs e)
75
{
if ((drpTitle.Text == "Select One") || (drpExpmin.Text == "YEAR")
|| (drpExpmax.Text == "YEAR") || (drpIndustry.Text == "Any")
|| (drpArea.Text == "Any"))
{
lblError.Visible = true;
}
else
{
string sql = "Insert into Company values('" + drpTitle.Text + "','" +
drpExpmin.Text + "-" + drpExpmax.Text + "','" + drpQualification.Text + "','"
+ drpIndustry.Text + "','" + drpArea.Text + "','" + txtDescription + "','" +
txtProfile + "','" + txtCompany + "','" + txtContact + "')";
cmd = new SqlCommand(sql, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();

//retrieve registered users from database


cmd=new SqlCommand("Select email from login",con);

//send mail to registered users


string fromEmail = "nehajain.265@gmail.com";
string password = "minorproject";
string subject = "call for job";
Label lblCompany = (Label)Master.FindControl("Label1");

con.Open();

76
dr = cmd.ExecuteReader();
while(dr.Read())
{
string toEmail = dr[0].ToString();

string msg = "Following is the freshest job opportunity for you:\n"


+ "Company : " + lblCompany.Text + "\nJob Title : " +
drpTitle.Text + " \nExperience : " + drpExpmin.Text + "-" + drpExpmax.Text +
"yrs"
+ "\nLocation : " + drpLocation.Text + " \nQualification : " +
drpQualification.Text + " \nIndustry Type : " + drpIndustry.Text + "
\nFunctional Area : "
+ drpArea.Text + " \nJob Description : " + txtDescription.Text + "
\nCandidate Profile : " + txtProfile.Text + "\nCompany Profile : " +
txtCompany.Text +
"\nContact Us : " + txtContact.Text;

MailSender.SendEmail(fromEmail, password , toEmail , subject ,


msg , System.Web.Mail.MailFormat.Text, "");

}
con.Close();

lblSuccess.Visible = true;
hprAnother.Visible = true;
hprMedia.Visible = true;
}
}
}

77
MailSender.cs
using System.Web.Mail;
using System;
public class MailSender
{
public static bool SendEmail(
string pGmailEmail,
string pGmailPassword,
string pTo,
string pSubject,
string pBody,
System.Web.Mail.MailFormat pFormat,
string pAttachmentPath)
{
try
{
System.Web.Mail.MailMessage myMail = new
System.Web.Mail.MailMessage();
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpserver",
"smtp.gmail.com");
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
"465");
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendusing",
"2");
//sendusing: cdoSendUsingPort, value 2, for sending the message using
//the network.

//smtpauthenticate: Specifies the mechanism used when authenticating


//to an SMTP
//service over the network. Possible values are:
//- cdoAnonymous, value 0. Do not authenticate.
//- cdoBasic, value 1. Use basic clear-text authentication.
//When using this option you have to provide the user name and
password
//through the sendusername and sendpassword fields.
//- cdoNTLM, value 2. The current process security context is used to
// authenticate with the service.
myMail.Fields.Add

78
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1"
);
//Use 0 for anonymous
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendusername",
pGmailEmail);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendpassword",
pGmailPassword);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpusessl",
"true");
myMail.From = pGmailEmail;
myMail.To = pTo;
myMail.Subject = pSubject;
myMail.BodyFormat = pFormat;
myMail.Body = pBody;
if (pAttachmentPath.Trim() != "")
{
MailAttachment MyAttachment =
new MailAttachment(pAttachmentPath);
myMail.Attachments.Add(MyAttachment);
myMail.Priority = System.Web.Mail.MailPriority.High;
}

System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com:465";
System.Web.Mail.SmtpMail.Send(myMail);
return true;
}
catch (Exception ex)
{
throw;
}
}
}

79
UserMaster.aspx.cs

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

public partial class UserMaster : System.Web.UI.MasterPage


{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["username"].ToString();
}
}

80
Register.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Net.Mail;
using System.Net;
using System.ComponentModel;

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


{
SqlConnection con;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
}

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)


{
81
//con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Select count(*) from login where username='" +
TextBox1.Text + "' and password='" + TextBox2.Text + "'";
con.Open();
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (i == 1)
{
Session["username"] = TextBox1.Text;
Server.Transfer("media selection.aspx");
}
else
{
Label1.Text = "Invalid Username or Password";
TextBox2.Text = "";
}
}

protected void Button1_Click(object sender, EventArgs e)


{
if (Page.IsValid == true)
{
if (CheckBox1.Checked == false)
{
lblErrorCheck.Visible = true;
}

82
else
{
cmd = new SqlCommand("select count(*) from login where
username='" + txtUsername.Text + "'", con);
con.Open();
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (i == 1)
{
lblErrorUser.Visible = true;
}
else
{
string sql = "Insert into
login(username,password,email,name,addr,mobile,phone) Values('" +
txtUsername.Text + "','" + txtPassword.Text + "','" + txtEmail.Text + "','" +
txtName.Text + "','" + txtAddress.Text + "','" + txtMobile.Text + "','" +
txtPhone.Text + "')";
cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;
Session["name"] = txtName.Text;
Session["username"] = txtUsername.Text;
Session["email"] = txtEmail.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();

//Sending Mail

83
MailMessage msg = new MailMessage();
msg.From = new MailAddress("pisces262.future@gmail.com");
msg.To.Add(new MailAddress(txtEmail.Text));
msg.Subject = "Registration confirmed in ATS Advertising
Agency";
msg.Body = "Hi! " + txtName.Text + "you have successfully
registered to ATS Advertising Agency.<br/>This message is send for
confirming your registration..";
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.Credentials = new
NetworkCredential("nehajain.265@gmail.com", "minorproject");
client.Send(msg);

Server.Transfer("succesfull register.aspx");
}
}
}
}
}

84
MediaSelection.aspx.cs

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

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


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

}
}

85
Banner.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Banner : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;

protected void Page_Load(object sender, EventArgs e)


{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

//calculate price
string str = DropDownList19.SelectedItem.ToString();
string str1 = RadioButtonList1.SelectedItem.ToString();
if ((str == "Flex") && (str1 == "SMALL"))
{
txtPrice.Text = "Rs 1500";
86
}
if ((str == "Flex") && (str1 == "MEDIUM"))
{
txtPrice.Text = "Rs 2500";
}
if ((str == "Flex") && (str1 == "LARGE"))
{
txtPrice.Text = "Rs 4000";
}
if ((str == "Cloth") && (str1 == "SMALL"))
{
txtPrice.Text = "Rs 1000";
}
if ((str == "Cloth") && (str1 == "MEDIUM"))
{
txtPrice.Text = "Rs 2000";
}
if ((str == "Cloth") && (str1 == "LARGE"))
{
txtPrice.Text = "Rs 3000";
}
}

protected void Button1_Click(object sender, EventArgs e)


{
string size;
if (RadioButtonList1.Text == "SMALL")
{
size = "10mx5m";

87
}
else if (RadioButtonList1.Text == "MEDIUM")
{
size = "20mx15m";
}
else
{
size = "30mx25m";
}

//Find username
Label lblUsername = (Label)Master.FindControl("Label1");

if (FileUpload1.PostedFile.FileName == "")
{
lblUpload.Visible = true;
}
else
{
System.IO.FileInfo filename = new
System.IO.FileInfo(FileUpload1.PostedFile.FileName);
string sql = "Insert into
banner(username,state,location,place,dfrom,dto,btype,bsize,price,content,uploa
dcontent) Values('"+lblUsername.Text+"','" + DropDownList1.Text + "','" +
DropDownList11.Text + "','" + DropDownList18.Text + "','" +
DropDownList12.Text + "/" + DropDownList13.Text + "/" +
DropDownList14.Text + "','" + DropDownList2.Text + "/" +
DropDownList3.Text + "/" + DropDownList4.Text + "','" +

88
DropDownList19.Text + "','" + size + "','" + txtPrice.Text +
"',@content,@uploadcontent)";
cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;
byte[] bData = new byte[(FileUpload1.PostedFile.InputStream.Length)];
FileUpload1.PostedFile.InputStream.Read(bData, 0, bData.Length);
cmd.Parameters.AddWithValue("@content", bData);
cmd.Parameters.AddWithValue("@uploadcontent", filename.Name);
con.Open();
cmd.ExecuteNonQuery();
lblSuccess.Visible = true;
}
}
}

89
Banner.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Radio : System.Web.UI.Page
{
SqlConnection con;
SqlDataReader dr;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
cmd = new SqlCommand("Select * From adminradio where
station=@station and program=@program", con);
cmd.Parameters.AddWithValue("@station", DropDownList1.Text);
cmd.Parameters.AddWithValue("@program", DropDownList18.Text);

con.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
90
{
TextBox2.Text = dr["ptime"].ToString();
TextBox4.Text = dr["pduration"].ToString();
}
con.Close();

//set id
cmd = new SqlCommand("Select count(*) from radio", con);
con.Open();
int i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (i == 0)
{
lblId.Text = "0";
}
else
{
cmd = new SqlCommand("Select max(id) from radio", con);
con.Open();
i = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
lblId.Text = i.ToString();
}

//calculate price
string str = DropDownList19.SelectedItem.ToString();
string str1 = RadioButtonList1.SelectedItem.ToString();
if ((str == "5sec") && (str1 == "nil"))
{

91
TextBox1.Text = "";
TextBox1.Text = "Rs 500";
}
if ((str == "5sec") && (str1 == "2 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 1000";
}
if ((str == "5sec") && (str1 == "3 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 2000";
}
if ((str == "10sec") && (str1 == "nil"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 1000";
}
if ((str == "10sec") && (str1 == "2 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 2000";
}
if ((str == "10sec") && (str1 == "3 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 2500";
}
if ((str == "15sec") && (str1 == "nil"))

92
{
TextBox1.Text = "";
TextBox1.Text = "Rs 1500";
}
if ((str == "15sec") && (str1 == "2 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 2500";
}
if ((str == "15sec") && (str1 == "3 Times"))
{
TextBox1.Text = "";
TextBox1.Text = "Rs 3000";
}
}
protected void Button4_Click(object sender, EventArgs e)
{
//Find username
Label lblUsername = (Label)Master.FindControl("Label1");

if (FileUpload1.PostedFile.FileName == "")
{
lblUpload.Visible = true;
}
else
{
con.Open();
System.IO.FileInfo filename = new
System.IO.FileInfo(FileUpload1.PostedFile.FileName);

93
int id = Convert.ToInt32(lblId.Text) + 1;
lblId.Text = id.ToString();
string sql = "Insert into
radio(id,name,station,dfrom,dto,program,btime,bduration,adduration,repeat,pric
e,content,uploadcontent) Values('" + lblId.Text + "','" + lblUsername.Text + "','"
+ DropDownList1.Text + "','" + DropDownList12.Text + "/" +
DropDownList13.Text + "/" + DropDownList14.Text + "','" +
DropDownList2.Text + "/" + DropDownList3.Text + "/" +
DropDownList4.Text + "','" + DropDownList18.Text + "','" + TextBox2.Text +
"','" + TextBox4.Text + "','" + DropDownList19.Text + "','" +
RadioButtonList1.Text + "','" + TextBox1.Text +
"',@content,@uploadcontent)";
cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;

byte[] bData = new byte[(FileUpload1.PostedFile.InputStream.Length)];


FileUpload1.PostedFile.InputStream.Read(bData, 0, bData.Length);
cmd.Parameters.AddWithValue("@content", bData);
cmd.Parameters.AddWithValue("@uploadcontent", filename.Name);
cmd.ExecuteNonQuery();
con.Close();
lblSuccess.Visible = true;
lblId.Visible = true;
}
}
}

94
Succesful_Register.aspx.cs

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

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


{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;

protected void Page_Load(object sender, EventArgs e)


{
con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
lblName.Text = Session["name"].ToString();
lblUsername.Text = Session["username"].ToString();
lblEmail.Text = Session["email"].ToString();
}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
95
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Default.aspx");
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if ((TextBox1.Text == "") && (TextBox2.Text == ""))
{
Label6.Text = "Enter Username and Password to Login";
}
else
{
cmd = new SqlCommand("select * from login", con);
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{

if ((TextBox1.Text == dr["username"].ToString()) &&


(TextBox2.Text == dr["password"].ToString()))
{

Session["username"] = TextBox1.Text;
Server.Transfer("media selection.aspx");
//TextBox1.Text = "";
//TextBox2.Text = "";

96
}
else if (TextBox1.Text == dr["username"].ToString())
{
if (TextBox2.Text != dr["password"].ToString())
{
Label6.Text = "Password Did Not match with Username";
}
}
else
{

Label6.Text = "Invalid Username and Password";


}

}
}
}
}

97
FUTURE ENHANCEMENTS

 Google API search.

 Payment through Credit Cards and Debit Cards.

 Designing of advertisements.

 Resume upload.

 Designing and Distribution of pamphlets.

98
BIBLIOGRAPHY

 Kevin Burton”.NET Common Language Runtime

 Paul Yao,David Durant “.NET Compact Framework


Programming with C#”.

 Alexei Fedorov “A Programmer's Guide to .NET”

 Herbert Schildt ” The Complete reference”

 http://www.images.google.com

 http://www.rapidshare.com

 http://wikipedia.com

 http://www.google.com

 http://www.forums.asp.net

99