You are on page 1of 112

SIX MONTHS INDUSTRIAL TRAINING

TRAINING REPORT
UNDERTAKEN AT

XPRESS WEB SOLUTIONZ


IN
.NET
ON
TABLE RESERVATION SYSTEM
SUBMITTED IN PARTIAL FULFILLMENT OF THE DEGREE
OF
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING

Under the Guidance of:

Submitted By:

Name:Sukhbir Khurmi

Name: Jasmeet Singh

Designation:Developer

College Roll No.: CS/11/11039

Department: Express Web Solutionz

University Roll No.:1145758

INSTITUTE OF ENGINEERING AND TECHNOLOGY-BHADDAL


PO : MIANPUR, District: Ropar, Punjab

ACKNOWLEDGEMENT

I am highly grateful to the Mr. Sanjay Singla (HOD) Computer Science & Engineering
Department of Institute of Engineering & Technology Bhaddal, for providing this opportunity
to carry out the six month industrial training at Xpress Web Solutionz.
The constant guidance and encouragement received from Mr. Nitin Verma (Training and
Placement Officer) of Institute of Engineering & Technology Bhaddal, have been of great
help in carrying out the project work and is acknowledged with reverential thanks.
The authors would like to express a deep sense of gratitude and thanks profusely to Mr.
Sukhbir Khurmi (CEO) of Company, without the wise counsel and able guidance, it would
have been impossible to complete the project in this manner.
The help rendered by Mr. Sukhbir Khurmi (Developer) for experimentation is greatly
acknowledged.
The author expresses gratitude to other faculty members of Institute of Engineering &
Technology Bhaddal for their intellectual support throughout the course of this work.
Finally, the authors are indebted to all whosoever have contributed in this project work and
friendly stay at Xpress Web Solutionz.

Jasmeet Singh
CS/11/11039
1145758
I E T Bhaddal, Ropar

PREFACE
TABLE RESERVATION SYSTEM is a computerized, online solution to the various
problems faced by Users/Clients (may be a Company) wishing to outsource their
software development work to a Provider at an economical cost, thus achieving high
performance, accuracy, reliability and high speed of data retrieval.
In this system, there is a registration process each for the Client and the Provider. Once
The Administrator of the site verifies the Provider after his registration and if satisfied,
assigns him an ID and password. The provider can use this ID and password to login
into the website. Similarly, once the Clients have registered themselves, they can post
the projects they wish to get developed. Different registered Providers can then view
these projects and post their biddings in response. The Clients, after viewing these
biddings, can assign the software development work to a particular Provider, best
suitable to their needs and budget.
In addition to the user friendliness and easiness to access and input data into the system,
the system will be available all over the world through the internet facility and anyone
from anywhere can access this application.
From a programmer point of view the objective of the work done by me in the stated
application is to make the whole system Object Oriented. Starting with the first step up
to the final line of code I wrote, I will try to make the system Object Oriented.
The scope of my project work is to make the outsourcing of the work easy. People can
easily find the professional technologist, who can help them to make/complete their
task.

TABLE OF CONTENTS
Sr. No
1

Title

Page No. Remarks

Company Profile

1-3

Introduction to Project and

4-7

Objectives
3

Modular Discription

8
9-10

Detailed analysis of modules


5

Project Undertaken

11-16

Design Phase

17-20

20-21
Data Base Design

Designing of Web Pages

22-25

Development Phase

26-102

10

Integration Testing

103-105

11

Implimentation

106

12

Conclusion

107

13

Bibligraphy

108

1.

COMPANY PROFILE

Xpress Web Solutionz


Science & Techonolgy Enterprenuers Park Gill Road, Ludhiana
Email: sukhbir@xpresswebsolutionz.com
Website: www. xpresswebsolutionz.com

We Xpress Web Solutionz are pleased to introduce ourselves, as a professionally managed


software products & web development company having a workforce of over 75+, highly
skilled designers, developers and other advanced technologies professionals, to provide better
solutions for all your web based needs. We cater to all the web based needs of our clients with
powerful web solutions right from the conception to the completion of the project. The
internet promotion services make sure that the websites rank well on the popular search
engines and gets maximum exposure over the internet. This is the reason why Xpress Web
Solutionz is called the 'One Stop Shop' for all your business needs. When Xpress Web
Solutionz web professionals do their job, results speak themselves. Feel free to check our
web site design portfolio and see the quality yourself. We do web sites which make your
visitors think about you: "Those guys are good!" Our competent graphic designers provide
creative designs for your logos, brochures, corporate identity and presentations to your
utmost satisfaction. You'll never interact with automated support systems. Managers and
customer care representatives will contact you personally making sure they understand your
needs. You'll communicate with people who are able to get inside your problem and find the
proper solution.

WHAT WE DO?
Our work begins by understanding thoroughly what our clients want. Then, with the perfect
blend of web and internet marketing services, we strive to provide customized solutions that
surpass our clients expectations. Be it custom web design, content, web 2.0 programming,
custom database applications, mobile application development, 3D flash animation or
interactive multimedia business presentations, Xpress Web Solutionzdelivers comprehensive
solutions in all sectors of web development domain.

Website Design and Development


A website is a companys online salesperson working 24X7. And understanding this fact to
its core, at Xpress Web Solutionzwe provide the unique combination of graphic design,
informative content and clean code to make websites that gives users an appealing
contemporary look and feel, clear message about your firm and interactive experience. Our
team of creative graphic designers, developers, who are never shy of introducing new
programming paradigms ranging from Microsoft to open source technologies, and expert
marketers, make your website:
1. Optimized for the newest browsers and search engine data
2. More engaging
3. Scalable with robust backend applications
4. Highly functional
5. Easily finable on the web
Mobile Application Development
The world has not just gone online, but mobile as well. And today there is hardly any major
(and even minor) firm, IT or non-IT, that isnt using a mobile app to engage with its
customers. At PNF, creating an app is just the beginning of the process of attracting and
engaging the customer. Therefore, we focus on building apps that are not just highly
functional, but provide an unparalleled user experience. We offer cutting edge mobile
application development as well as a mobile game developer in Houston for all the mobile
devices of the current generation. We develop applications for all the major mobile platforms,
which are in trend today, namely; iOS, Android and Blackberry.

Our Strengths
One-Stop Internet Solutions Vendor
From custom web designing to developing complex web and mobile applications,PNFs team
has the expertise to use all the latest technology paradigms effectively and deliver quality
solutions that meet latest industry trends.

Full-Cycle Development Services


We ensure that every stage of Software Development Life Cycle gets the time and attention it
deserves. From defining the requirements to post deployment support, PNF provides end-toend solutions for application development.

Experience and Expertise


With the credit of providing effective solutions in countless scenarios under our belt, over
years our team has acquired exceptional skill sets and built a knowledge base that enable us
to provide the best possible solutions tailor-made to our clients specific needs.

Quality Standards
At picNframes Technologies, our three-pronged approach of hiring the best talent, using
proven processes and ensuring seamless communication, helps us create solutions that wow
the end user and bring faster returns for our clients.
From DIRECTORs Desk
Xpress Web Solutionz. is striving to become one of the leading web solution and service
providers in the country. They were looking for, and our comprehensive training for budding
IT professionals ensures that they are industry ready and taking the right steps to a successful
career. This way, we are also contributing to the IT industry by giving its young and
promising talent. Knowledge of different APIs and specific tools are enough to develop
websites and applications; however, developing a product that not only meets the clients
requirements but surpasses their expectations as well, requires a great deal of experience and
dedication. At PNF we work on principles; and with high standards that we have set for our
services, we strive to work with the utmost professionalism; and our products speak the rest.

Sukhbir Khurmi

2. INTRODUCTION
2.1

Name of the Project


Table Reservation System.

2.2

Overview of the Project


Table Reservation System is a computerized, online solution to the various problems
faced by Users/Clients (may be a Company) wishing to outsource their software
development work to a Provider at an economical cost, thus achieving high
performance, accuracy, reliability and high speed of data retrieval.
In this system, there is a registration process each for the Client and the Provider. Once
The Administrator of the site verifies the Provider after his registration and if satisfied,
assigns him an ID and password. The provider can use this ID and password to login
into the website. Similarly, once the Clients have registered themselves, they can post
the projects they wish to get developed. Different registered Providers can then view
these projects and post their biddings in response. The Clients, after viewing these
biddings, can assign the software development work to a particular Provider, best
suitable to their needs and budget.

2.3

Objectives and Scope


This software is aimed at making data entry, management, updating, storage and
retrieval easier and faster. The following objectives have been kept in mind:
Practicality: The system is quite stable and can be operated by the people with average
intelligence.
Efficiency: The system will have the accuracy, timeliness and comprehensiveness of
the output.
Cost: It is desirable to aim for the system with a minimum cost subject to the condition
that it must satisfy the entire requirements.
Flexibility:

I have tried that the system should be modifiable depending on the

changing needs of the user. Such modifications should entail extensive reconstructing
or recreation of software. It should also be portable to different computer systems.
Security: This is a very important aspect and I have tried to cover the areas of hardware
reliability, fall-back procedures, and physical security of data.

In addition to the user friendliness and easiness to access and input data into the system,
the system will be available all over the world through the internet facility and anyone
from anywhere can access this application.
From a programmer point of view the objective of the work done by me in the stated
application is to make the whole system Object Oriented. Starting with the first step up
to the final line of code I wrote, I will try to make the system Object Oriented.
The scope of my project work is to make the outsourcing of the work easy. People can
easily find the professional technologist, who can help them to make/complete their
task.

2.4

Work Plan
This project was worked upon using the most common methodology known as
Waterfall Model. This model divides the whole target into a number of modules.
Dividing the project into various modules helped us to better manage the project work
and also helped to complete it in time.
The basic diagram for the waterfall work model is as follows:

Fig.1 -Basic Waterfall Model

The waterfall model provides an orderly sequence of development steps and helps
ensure the adequacy of documentation and design reviews to ensure the quality,
reliability and maintainability of the developed software.

2.5

Implementation Strategy
The various types of requirements for the development of the project are as follows The platform to be used for the development of this project is

Microsoft Visual C#.Net

The database to be used with the project is

Microsoft SQL Server 2008

The Integrated Development Environment (IDE) to be used for the development of


this project is

Microsoft Visual Studio 2010


The system requirements to install and use the Microsoft Visual Studio 2010 are as
follows:

2.6

Software Requirements:
Visual Studio 2010 can be installed on the following operating systems:
Windows XP (x86) with Service Pack 3 - all editions except Starter Edition
Windows Vista (x86 & x64) with Service Pack 2 - all editions except Starter Edition
Windows 7 (x86 & x64)
Windows Server 2003 (x86 & x64) with Service Pack 2
Windows Server 2003 R2 (x86 & x64)
Windows Server 2008 (x86 & x64) with Service Pack 2
Windows Server 2008 R2 (x64)

2.7

Supported Architectures:
32-Bit (x86)
64-Bit (x64)

2.8

Hardware Requirements:
Computer that has a 1.6GHz or faster processor
1 GB (32 Bit) or 2 GB (64 Bit) RAM
3GB of available hard disk space
5400 RPM hard disk drive

DirectX 9 capable video card running at 1024 x 768 or higher-resolution display


2.9

User Requirements
This software has been designed keeping in view the requirements and ease of the
user who is finally going to use it. After all the effort put on analysis phase, I ended up
with the following requirements:
Easy storage, updating, deletion and retrieval of data.
No redundancy of data.
Minimal traversal time.
User friendly interface.
Proper validations and checks for the data to be entered.

Generation of certain automatic values.

3. MODULAR DESCRIPTION
1. ADMINISTRATOR MODULE
2. CLIENT MODULE
3. PROVIDER MODULE
4. EMPLOYEE MODULE
5. ADVERTISOR MODULE
TABLE RESERVATION SYSTEM is a computerized, online solution to the
various problems faced by Users/Clients (may be a Company) wishing to
outsource their software development work to a Provider at an economical cost,
thus achieving high performance, accuracy, reliability and high speed of data
retrieval.
In this system, there is a registration process each for the Client and the
Provider. Once The Administrator of the site verifies the Provider after his
registration and if satisfied, assigns him an ID and password. The provider can
use this ID and password to login into the website. Similarly, once the Clients
have registered themselves, they can post the projects they wish to get
developed. Different registered Providers can then view these projects and post
their biddings in response. The Clients, after viewing these biddings, can assign
the software development work to a particular Provider, best suitable to their
needs and budget.
In addition to the user friendliness and easiness to access and input data into the
system, the system will be available all over the world through the internet
facility and anyone from anywhere can access this application.
From a programmer point of view the objective of the work done by me in the
stated application is to make the whole system Object Oriented. Starting with
the first step up to the final line of code I wrote, I will try to make the system
Object Oriented.

DETAILED ANALYSIS OF MODULES


1. ADMINISTRATOR MODULE:-

Update statistics: Allows administrator to insert/update country, state, city,


frontend, backend, technologies etc.
Verify Client: Allows administrator to add a client to database.
Verify Provider: Allows administrator to add a provider to database.
Verify Advertiser: Allow administrator to add a advertiser to database.
Upload FAQ details: Allows administrator to upload frequently asked questions
for students.
Verify Feedback: Administrator can verify the feedback posted by the enrolled
clients, provider and advertiser
Verify Advertisement: Add advertisement to a database.

2. CLIENT MODULE:-

Manage Personal details: This service provides the client to check personal details
and can do editing in the details.
Manage Projects: This service provides the client to add the projects and view
biding.
Deal With The Provider: This service provides the client to do chat with the
provider on message dash board, assign project to the provider and give payment
to provider.
Client: - This service provides to change password and do logout.

3. PROVIDER MODULE:-

Manage Personal details: This service provides the user to check personal details.

Deal With Client: This service provides the user to place bidding, view projects,
and do chat with client through message dashboard.
Deal With Employee: This service provides the user to manage the employee
designation, manage employee, and do chat with employee through message
dashboard.
Provider: Using this service provider can change password and can do logout.

4. EMPLOYEE MODULE:

Manage Personal Details: This service provides employee to check their


personal details and can edit also.

Deal With Provider: This service provides employee to check assigned


projects and can chat with employee through message dashboard.

Employee: In this service employee can logout and can change password.

5. ADVERTISER MODULE:-

Manage Personal Details: This service provides advertiser to check their


personal details and can edit it.

Manage Advertisement:
advertisements.

Advertisement: In this service advertiser can change password and can logout.

This

service

provides

advertiser

to

add

PROJECT UNDERTAKEN

1. The .net framework


A frame work is commonly though of as a set of class libraries that aid in the development of
applications. The .net framework is more than just a set of classes. The .net framework is
targeted by compliers using a wide variety of applications. Including everything from small
components that run on handheld devices to large Microsoft ASP.NET application that span
web farms, where multiple web serves act together to improve the performance fault
tolerance of a web site. The .NET framework is responsible for providing a basic platform
that these applications can shack are. This basic platform includes a runtimes set of services
that oversee the execution of applications. A key responsibility of the runtime is to manage
execution so that software written by different programming languages uses classes and other
types safely.
Microsoft .net framework architecture
Microsoft's .NET Framework is comprised of two main components - the Common Language
Runtime (CLR) and the .NET Framework class libraries. The CLR is the real foundation of
the .NET Framework. It is the execution engine for all .NET applications. Every target
computer requires the CLR to successfully run a .NET application that uses the .NET
Framework. The main features of CLR include:

Automatic Memory Management

Thread Management

Code Compilation & Execution

Code Verification

High level of security

Remoting

Structured Exception Handling

Interoperability between Managed and Unmanaged code.

Integration with Microsoft Office System


All .NET applications are compiled into Intermediate Language code (MSIL). When
executed on the CLR, MSIL is converted into native machine code specific to the operating
platform. This process is done by a Just in Time (JIT) compiler. The code executed by the
CLR is called as Managed Code. This code is type safe and thoroughly checked by the CLR
before being deployed. The .NET runtime also provides a facility to incorporate existing
COM components and DLL's into a .NET application. Code that is not controlled by the CLR
is called Unmanaged Code.
The .NET Framework is further comprised of Common Type System (CTS) and Common
Language Specification (CLS). The CTS defines the common data types used by .NET
programming languages. The CTS tells you how to represent characters and numbers in a
program. The CLS represents the guidelines defined by for the .NET Framework. These
specifications are normally used by the compiler developers and are available for all
languages, which target the .NET Framework.

Fig5.1: .Net architecture


ASP.NET is a web application framework developed and marketed by Microsoft to allow
programmers 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.
Server-side caching
ASP.NET offers a "Cache" object that is shared across the application and can also be used to
store various objects. The "Cache" object holds the data only for a specified amount of time
and is automatically cleaned after the session time-limit elapses.

Fig 5.2
1.2 Common Language Specification
To fully interact with other objects regardless of the language they were implemented in,
objects must expose to callers only those features that are common to all the languages they
must interoperate with. For this reason, the Common Language Specification (CLS), which is
a set of basic language features needed by many applications, has been defined. The CLS
rules define a subset of the Common Type System; that is, all the rules that apply to the
common type system apply to the CLS, except where stricter rules are defined in the CLS.
The CLS helps enhance and ensure language interoperability by defining a set of features that

developer can rely on to be available in a wide variety of languages. The CLS also establishes
requirements for CLS compliance; these help you determine whether your managed code
conforms to the CLS and to what extent a given tool supports the development of managed
code that uses CLS features.
If your component uses only CLS features in the API that it exposes to other code (including
derived classes), the component is guaranteed to be accessible from any programming
language that supports the CLS. Components that adhere to the CLS rules and use only the
features included in the CLS are said to be CLS-compliant components.
The CLS was designed to be large enough to include the language constructs that are
commonly needed by developers, yet small enough that most languages are able to support it.
In addition, any language constructs that makes it impossible to rapidly verify the type safety
of code was excluded from the CLS so that all CLS-compliant languages can produce
verifiable code if they choose to do so
1.3 Common Language Runtime
The Common Language Runtime (CLR) is the virtual machine component of
Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language
Infrastructure (CLI) standard, which defines an execution environment for program code. The
CLR runs a form of byte code called the Microsoft Intermediate Language (MSIL),
Microsoft's implementation of the Common Intermediate Language.
Developers using the CLR write code in a high level language such as C# or VB.Net.
At compile-time, a .NET compiler converts such code into MSIL (Microsoft Intermediate
Language) code. At runtime, the CLR's just-in-time compiler (JIT compiler) converts the
MSIL code into code native to the operating system. Alternatively, the MSIL code can be
compiled to native code in a separate step prior to runtime. This speeds up all later runs of the
software as the MSIL-to-native compilation is no longer necessary.

Fig5.3: CLR Architecture


Although some other implementations of the Common Language Infrastructure run on nonWindows operating systems, the CLR runs on Microsoft Windows operating systems. The
virtual machine aspect of the CLR allows programmers to ignore many details of the specific
CPU that will execute the program.
The CLR also provides other important services, including the following:

Memory management

Thread management

Exception handling

Garbage collection

Security

Introduction to Microsoft SQL Server


Microsoft SQL Server enhances the performance, reliability, and scalability provided by
earlier releases of SQL Server by making the processes of developing applications, managing
systems, and replicating data easier than ever.
All of data processing is involved with the operations of storing and retrieving data. A
database, such as Microsoft SQL Server, is designed as the central repository for all the data
of an organization. The crucial nature of data to any organization underlines the importance
of the method used to store it and enable its later retrieval.
Microsoft SQL Server uses features similar to those found in other databases and some
features that are unique. Most of these additional features are made possible by SQL Servers
tight integration with the Windows XP operating system. SQL Server contains the data
storage options and the capability to store and process the same volume of data as a
mainframe or minicomputer. Like most mainframe or minicomputer databases, SQL Server is
a Database that has seen an evolution from its introduction in the mid-1960s until today.
Microsofts SQL Server is founded in the mature and powerful relational model, currently the
preferred model for data storage and retrieval.

Fig5.4: SQL Server Architecture


Unlike mainframe and minicomputer databases, a server database is accessed by users--called
clients--from other computer systems rather than from input/output devices, such as
terminals. Mechanisms must be in place for SQL Server to solve problems that arise from the
access of data from perhaps Hundreds of computer systems, each of which can process
portions of the database independently from the data on the server.
Within the framework of a client/server database, a server database also requires integration
with communication components of the server in order to enable connections with client
systems.
SQL server also contains many of the front-end tools of PC databases that traditionally
havent been available as part of either mainframe or minicomputer databases. In addition to
using a dialect of Structured Query Language (SQL), GUI applications can be used from the
storage, retrieval, and administration of the database.

DESIGN PHASE
The most creative and challenging phase of SDLC is system design. The design of the system
will produce the details that state how a system will meet requirements identified during the
system analysis.
Design Features
1

Design describes the final system and the process by which it is developed.

It refers to the technical specifications that will be applied in implementing the candidate system.

It includes architectural design, module design, detail design.

It also includes construction of programs and program testing. Thus the logical design of the
system developed in this phase.

The three main objectives which the designer has to bear in mind are:
1

How fast the design will be able to do users work given a particular hardware resource.

The extent to which the design is secure against the human error and machine malfunction.

The ease with which the design allows the system to be changed.

To meet these objectives analyst and programmers use a combination of top-down and
bottom-up design.
Top-Down Design
It starts with large picture and move to the details. The analyst and team members look at the
major functions that the system must provide and break these down into smaller and smaller
activities.
Bottom-Up Design
It starts with details and then moves to the big picture. This approach is appropriate when
user have specific requirements for output.

System Design
Designing is the most important phase of software development. It requires careful planning
and logical thinking on the part of system designer. It should be done at most care, because if
this phase contains any error then it is going to affect the performance of the entire system.
As a result, it may take more of processing time, more of coding time and extra work load,
and the system might not provide the required functionality. System design is achieved with
the help of two approaches:

Dataflow Diagram

ER Diagram

Dataflow Diagram
Dataflow diagram is used to provide structured design of project. DFD provides design at
various levels with the help of different symbols:
A circle or a bubble represents a process that
transforms incoming data flows into outgoing
data flows.
An open rectangle is used for temporary
repository of data.
A square defines the source or destination of
system data.
An arrow identifies data flow data in motion.
It is a pipeline through which information
flows.
Fig 6.1
Here we represent various DFDs related to our project:
Level 0 DFD :

ProjectOnizer

User

Fig-2
Fig-2 Shows the level 0 DFD (Data Flow Diagram) of the website. It shows the
interaction of the user with the website ProjectOnizer.

Level-1 DFD

Users Details

Performs various actions

Fig-3
Fig-3 shows the level 1 DFD for the website. It shows how the user enters into the
website, view required details and performs various actions.
Level-2 DFD

Provider

Build Project
Register
SITE
View and Bid on Projects

Manage Various Settings

Payment

Verifies Provider and Assigns ID and Password


Assign Project

CLIENT / USER

Project Details
Post Projects

Fig-4 shows the level 2 DFD for the website Table Reservation System. It shows the
working of the website in details. It shows how the admin manages the settings of the whole
website. It also shows how the client posts the projects on the website, assigns it to the
provider and makes payments. It also shows that the provider views the projects and bid on
them, and also builds the projects assigned to him.

Database Design
The database for our project Table Reservation System is created with the help of SQL
Server. It contains different tables to store and maintain different types of information

regarding

Users

our

Technology

project.

ProjectType

UsersId

TechnologyI d

ProjectTypeId

UsersName

TechnologyName

ProjectTypeName

UsersPassword
UsersMemberI d
UsersRole

ProviderProject
ProviderProjectId
ProviderProjectDescription
ProviderProjectFile

Provider

ProjectI nvite
ProjectInviteI d
ProjectInviteProjectId
ProjectInviteProviderId

ProviderProjectProviderI d

ProviderId
ProviderName

MessageBoardI nvite

ProviderAddress

MessageBoardInviteI d

ProviderCityId

MessageBoardInviteProjectId

ProviderPhone
ProviderFax

BackEnd

MessageBoardInviteProviderId

ProviderUrl

BackEndId

ProviderEmailI d

BackEndName

MessageBoardInviteRead

ProviderCompanyTypeI d
ProviderStatus
ProviderRegistrationDate
ProviderPinCode

FrontEnd

MessageBoard
MessageBoardI d

FrontEndId

MessageBoardAddProjectI d

FrontEndName

MessageBoardSenderI d
MessageBoardReceiverI d
MessageBoardDescription
MessageBoardDate

CompanyType
Bid
BidId

MessageBoardSenderRole

CompanyTypeId

MessageBoardReceiverRole

CompanyTypeName

MessageBoardRead

BidProposal
BidAttachment
BidAmount
BidTimeFrame
BidDate
BidProviderI d
BidAddProjectId
BidMessageBoardStatus

State
StateId
StateName

Country
CountryI d
CountryName

AwardedProject
AwardedProjectId
AwardedProjectAddProjectId
AwardedProjectProviderI d

CountryStateI d

AwardedProjectAmount
AwardedProjectDate
AwardedProjectStatus

City
CityId
CityName
CityStateI d

Client

AwardedProjectDueDate

ClientName

AwardedProjectAdvancePay...

ClientAddress
ClientCityI d
ClientPinCode
ClientPhone

AddClientProject

AwardedProjectRead

ClientId

ClientFax

State *
StateId
StateName

Country *
CountryId
CountryName

AwardedProject
AwardedProjectId
AwardedProjectAddProjectId
AwardedProjectProviderId

CountryStateId

AwardedProjectAmount
AwardedProjectDate
AwardedProjectStatus

City *

Client

AwardedProjectRead

CityId

ClientId

AwardedProjectDueDate

CityName

ClientName

AwardedProjectAdvancePay...

CityStateId

ClientAddress
ClientCityId
ClientPinCode
ClientPhone

AddClientProject

ClientFax

AddProjectId

ClientEmailId

AddProject_ProjectTypeId

ClientProfile

AddProjectTitle

ContactPersonName

AddProjectDescription

ContactPersonDesignation

AddProjectAttachment

ContactPersonMobile

AddProjectTechnologyId

ContactPersonPhone

AddProjectFrontEndId

ContactPersonEmailId

AddProjectBackEndId
AddProjectDuration
AddProjectBudget
AddProjectSecurityFee
AddProjectBidOpenDays
AddProjectOpenToAll
AddProjectStatus
AddProjectDate
AddProjectClientId

Designing of Web Pages

DEVELOPMENT PHASE
Time to build your website! This is where all the hard work put into the design phase pays
off. Following your design, carefully assemble the project. Do this one piece at a time, testing
as you go. Be sure to set time aside in your schedule. Start early and work often. Sometimes
the simplest task takes the most time to complete.
For some projects, programming will be minimal. Those folks will have their hands full
scanning images, recording sounds, and pulling the whole kit-and-caboodle together. For
other projects, coding will represent a significant part of the whole.
SOURCE CODE:
1. Admin Panel :1.1 Admin Country Form:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Administrator_Countryfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstCountryDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
pc.CountryInsert(txtCountryName.Text);
BindLstCountryDetails();
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
pc.CountryUpdate(Convert.ToInt32(lstCountryDetails.SelectedValue),
txtCountryName.Text);
BindLstCountryDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)

{
pc.CountryDelete(Convert.ToInt32(lstCountryDetails.SelectedValue));
BindLstCountryDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstCountryDetails_SelectedIndexChanged(object sender, EventArgs e)
{
var result =
pc.CountryFind(Convert.ToInt32(lstCountryDetails.SelectedValue)).SingleOrDefault();
txtCountryName.Text = result.CountryName;
}
private void BindLstCountryDetails()
{
lstCountryDetails.DataTextField = "CountryName";
lstCountryDetails.DataValueField = "CountryId";
lstCountryDetails.DataSource = pc.CountryDisplay();
lstCountryDetails.DataBind();
}
private void ClearControls()
{
txtCountryName.Text = "";
txtCountryName.Focus();
}
}

1.2 Admin State Form :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Administrator_Statefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();

protected void Page_Load(object sender, EventArgs e)


{
if (!IsPostBack)
{
BindDdlCountryName();
BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue));
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
pc.StateInsert(txtStateName.Text, Convert.ToInt32(ddlCountryName.SelectedValue));
BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue));
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
pc.StateUpdate(Convert.ToInt32(lstStateDetails.SelectedValue), txtStateName.Text);
BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue));
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
pc.StateDelete(Convert.ToInt32(lstStateDetails.SelectedValue));
BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue));
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ClearControls();
BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue));
}
protected void lstStateDetails_SelectedIndexChanged(object sender, EventArgs e)
{
txtStateName.Text =
pc.StateFind(Convert.ToInt32(lstStateDetails.SelectedValue)).SingleOrDefault().StateName;
}
private void BindDdlCountryName()
{

ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindLstStateDetails(int StateCountryId)
{
lstStateDetails.DataTextField = "StateName";
lstStateDetails.DataValueField = "StateId";
lstStateDetails.DataSource =
pc.StateDisplayByStateCountryId(Convert.ToInt32(ddlCountryName.SelectedValue));
lstStateDetails.DataBind();
}
private void ClearControls()
{
txtStateName.Text = "";
txtStateName.Focus();
}

1.3 Admin City Form :-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_Cityfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDdlCountryName();
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)

{
string CityName = txtCityName.Text;
int CityStateId = Convert.ToInt32(ddlStateName.SelectedValue);
pc.CityInsert(CityName,CityStateId);
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int CityId = Convert.ToInt32(lstCityDetails.SelectedValue);
string CityName = txtCityName.Text;
int CityStateId = Convert.ToInt32(ddlStateName.SelectedValue);
pc.CityUpdate(CityId, CityName);
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int CityId = Convert.ToInt32(lstCityDetails.SelectedValue);
pc.CityDelete(CityId);
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ClearControls();
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{
ClearControls();
BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue));
}
protected void lstCityDetails_SelectedIndexChanged(object sender, EventArgs e)
{
int CityId = Convert.ToInt32(lstCityDetails.SelectedValue);
var result = pc.CityFind(CityId).SingleOrDefault();
txtCityName.Text = result.CityName;

}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
int NewStateCountryId = StateCountryId;
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(NewStateCountryId);
ddlStateName.DataBind();
}
private void BindLstCityDetails(int CityStateId)
{
int NCityStateId = CityStateId;
lstCityDetails.DataTextField = "CityName";
lstCityDetails.DataValueField = "CityId";
lstCityDetails.DataSource = pc.CityDisplayByCityStateId(NCityStateId);
lstCityDetails.DataBind();
}
private void ClearControls()
{
txtCityName.Text = "";
txtCityName.Focus();
}
}
1.4 Admin BackEnd Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_BackEndfrm : System.Web.UI.Page
{

ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();


protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstBackEndDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
string BackEndName = txtBackEndName.Text;
pc.BackEndInsert(BackEndName);
BindLstBackEndDetails();
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue);
string BackEndName = txtBackEndName.Text;
pc.BackEndUpdate(BackEndId, BackEndName);
BindLstBackEndDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue);
pc.BackEndDelete(BackEndId);
BindLstBackEndDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstBackEndDetails_SelectedIndexChanged(object sender, EventArgs e)
{
int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue);
var result = pc.BackEndFind(BackEndId).SingleOrDefault();;
txtBackEndName.Text = result.BackEndName;
}
private void BindLstBackEndDetails()
{
lstBackEndDetails.DataTextField = "BackEndName";
lstBackEndDetails.DataValueField = "BackEndId";
lstBackEndDetails.DataSource = pc.BackEndDisplay();
lstBackEndDetails.DataBind();
}
private void ClearControls()

{
txtBackEndName.Text = "";
txtBackEndName.Focus();
}
}

1.5 Admin FrontEnd Form :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_FrontEndfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstFrontEndDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
string FrontEndName = txtFrontEndName.Text;
pc.FrontEndInsert(FrontEndName);
BindLstFrontEndDetails();
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue);
string FrontEndName = txtFrontEndName.Text;
pc.FrontEndUpdate(FrontEndId, FrontEndName);
BindLstFrontEndDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue);
pc.FrontEndDelete(FrontEndId);
BindLstFrontEndDetails();
ClearControls();
}

protected void lkbtnCancel_Click(object sender, EventArgs e)


{
ClearControls();
}
protected void lstFrontEndDetails_SelectedIndexChanged(object sender, EventArgs e)
{
int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue);
var result = pc.FrontEndFind(FrontEndId).SingleOrDefault();
txtFrontEndName.Text = result.FrontEndName;
}
private void BindLstFrontEndDetails()
{
lstFrontEndDetails.DataTextField = "FrontEndName";
lstFrontEndDetails.DataValueField = "FrontEndId";
lstFrontEndDetails.DataSource = pc.FrontEndDisplay();
lstFrontEndDetails.DataBind();
}
private void ClearControls()
{
txtFrontEndName.Text = "";
txtFrontEndName.Focus();
}
}
1.6 Admin Company Type Form:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_CompanyTypefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstCompanyTypeDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
string CompanyTypeName = txtCompanyTypeName.Text;
pc.CompanyTypeInsert(CompanyTypeName);
BindLstCompanyTypeDetails();
ClearControls();

}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue);
string CompanyTypeName = txtCompanyTypeName.Text;
pc.CompanyTypeUpdate(CompanyTypeId, CompanyTypeName);
BindLstCompanyTypeDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue);
pc.CompanyTypeDelete(CompanyTypeId);
BindLstCompanyTypeDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstCompanyTypeDetails_SelectedIndexChanged(object sender, EventArgs
e)
{
int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue);
var result = pc.CompanyTypeFind(CompanyTypeId).SingleOrDefault();
txtCompanyTypeName.Text = result.CompanyTypeName;
}
private void BindLstCompanyTypeDetails()
{
lstCompanyTypeDetails.DataTextField = "CompanyTypeName";
lstCompanyTypeDetails.DataValueField = "CompanyTypeId";
lstCompanyTypeDetails.DataSource = pc.CompanyTypeDisplay();
lstCompanyTypeDetails.DataBind();
}
private void ClearControls()
{
txtCompanyTypeName.Text = "";
txtCompanyTypeName.Focus();
}
}
1.7 Admin Technology Form :using System;
using System.Collections.Generic;
using System.Linq;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_Technologyfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstTechnologyDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
string TechnologyName = txtTechnologyName.Text;
pc.TechnologyInsert(TechnologyName);
BindLstTechnologyDetails();
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int TechnologyId = Convert.ToInt32(lstTechnologyDetails.SelectedValue);
string TechnologyName = txtTechnologyName.Text;
pc.TechnologyUpdate(TechnologyId,TechnologyName);
BindLstTechnologyDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int TechnologyId = Convert.ToInt32(lstTechnologyDetails.SelectedValue);
pc.TechnologyDelete(TechnologyId);
BindLstTechnologyDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstTechnologyDetails_SelectedIndexChanged(object sender, EventArgs e)
{
int TechnologyId = Convert.ToInt32(lstTechnologyDetails.SelectedValue);
var result = pc.TechnologyFind(TechnologyId).SingleOrDefault();
txtTechnologyName.Text = result.TechnologyName;
}
private void BindLstTechnologyDetails()
{
lstTechnologyDetails.DataTextField = "TechnologyName";
lstTechnologyDetails.DataValueField = "TechnologyId";

lstTechnologyDetails.DataSource = pc.TechnologyDisplay();
lstTechnologyDetails.DataBind();
}
private void ClearControls()
{
txtTechnologyName.Text = "";
txtTechnologyName.Focus();
}
}
1.8 Admin Project Type Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_ProjectTypefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstProjectTypeDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
string ProjectTypeName = txtProjectTypeName.Text;
pc.ProjectTypeInsert(ProjectTypeName);
BindLstProjectTypeDetails();
ClearControls();
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue);
string ProjectTypeName = txtProjectTypeName.Text;
pc.ProjectTypeUpdate(ProjectTypeId, ProjectTypeName);
BindLstProjectTypeDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue);
pc.ProjectTypeDelete(ProjectTypeId);
BindLstProjectTypeDetails();

ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstProjectTypeDetails_SelectedIndexChanged(object sender, EventArgs e)
{
int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue);
var result= pc.ProjectTypeFind(ProjectTypeId).SingleOrDefault();
txtProjectTypeName.Text = result.ProjectTypeName;
}
private void BindLstProjectTypeDetails()
{
lstProjectTypeDetails.DataTextField = "ProjectTypeName";
lstProjectTypeDetails.DataValueField = "ProjectTypeId";
lstProjectTypeDetails.DataSource = pc.ProjectTypeDisplay();
lstProjectTypeDetails.DataBind();
}
private void ClearControls()
{
txtProjectTypeName.Text = "";
txtProjectTypeName.Focus();
}
}

1.9 Admin Add Faq Form :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Administrator_AddFaqfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
BindDataList();

}
}
private void BindDataList()
{
DataList1.DataSource = pc.FaqDisplay();
DataList1.DataBind();
}
private void ClearControls()
{
txtQuestion.Text = "";
txtAnswer.Text = "";
}
protected void DataList1_SelectedIndexChanged(object sender, EventArgs e)
{
int FaqId = Convert.ToInt32(DataList1.DataKeys[DataList1.SelectedIndex]);
var result = pc.FaqDisplayByFaqId(FaqId).SingleOrDefault();
txtQuestion.Text = result.FaqQuestion;
txtAnswer.Text = result.FaqAnswer;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
string FaqQuestion = txtQuestion.Text;
string FaqAnswer = txtAnswer.Text;
pc.FaqInsert(FaqQuestion,FaqAnswer);
BindDataList();
ClearControls();
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
int FaqId = Convert.ToInt32(DataList1.DataKeys[DataList1.SelectedIndex]);
string FaqQuestion = txtQuestion.Text;
string FaqAnswer = txtAnswer.Text;
pc.FaqUpdate(FaqId, FaqQuestion, FaqAnswer);
Response.Write("Updated Successfully");
BindDataList();
ClearControls();
}
}
1.10Admin Verify Provider :using System;
using System.Collections.Generic;
using System.Linq;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Net.Mail;
public partial class Administrator_VerifyProviderfrm : System.Web.UI.Page
{
public static string CityName;
public static string CompanyTypeName;
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDdlProviderName();
}
}
private void BindDdlProviderName()
{
ddlProviderName.DataTextField = "ProviderName";
ddlProviderName.DataValueField = "ProviderId";
ddlProviderName.DataSource = pc.ProviderDisplay();
ddlProviderName.DataBind();
}
protected void ddlProviderName_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlProviderName.SelectedValue != "0")
{
BindFormView(Convert.ToInt32(ddlProviderName.SelectedValue));
BindGridView(Convert.ToInt32(ddlProviderName.SelectedValue));
rbtnStatus.Visible = true;
}
else
{
rbtnStatus.Visible = false;
}
}
private void BindFormView(int ProviderId)
{
CityName =
pc.ProviderCityNameByProviderCityId(ProviderId,Convert.ToInt32(pc.ProviderFind(Provid
erId).SingleOrDefault().ProviderCityId)).SingleOrDefault().CityName;
CompanyTypeName =
pc.ProviderCompanyTypeNameByProviderCompanyTypeId(ProviderId,
Convert.ToInt32(pc.ProviderFind(ProviderId).SingleOrDefault().ProviderCompanyTypeId)).
SingleOrDefault().CompanyTypeName;

FormView1.DataSource = pc.ProviderFind(ProviderId);
FormView1.DataBind();
FormView1.Visible = true;
}
private void BindGridView(int ProviderId)
{
int ProviderProjectProviderId = ProviderId;
GridView1.DataSource =
pc.ProviderProjectDisplayByProviderId(ProviderProjectProviderId);
GridView1.DataBind();
}
protected void rbtnStatus_SelectedIndexChanged(object sender, EventArgs e)
{
if (rbtnStatus.Items[0].Selected)
{
MultiView1.ActiveViewIndex = 0;
}
else
{
MultiView1.ActiveViewIndex = 1;
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add(FormView1.DataKey[0].ToString());
if (rbtnStatus.Items[0].Selected)
{
int ProviderId = Convert.ToInt32(ddlProviderName.SelectedValue);
string ProviderStatus = "Active";
pc.ProviderUpdateStatus(ProviderId,ProviderStatus);
int UsersMemberId = Convert.ToInt32(ddlProviderName.SelectedValue);
string UsersRole = "Provider";
int checkusersmemberid =
Convert.ToInt32(pc.UsersCheckByUsersMemberId(UsersMemberId,UsersRole).SingleOrDef
ault().Column1);
string UsersName = txtUsername.Text;
string UsersPassword = txtPassword.Text;
if (checkusersmemberid == 0)
{
mail.Body = "Username is " + txtUsername.Text + " " + "And Password is " +
txtPassword.Text;
string UsersRoles = "Provider";

pc.UsersInsert(UsersName,
UsersPassword,
UsersMemberId,
UsersRoles);
}
else
{
MultiView1.Visible = false;
pc.UsersUpdate(UsersName, UsersPassword, UsersMemberId);
}
}
else
{
mail.Body = txtReason.Text;
int ProviderId = Convert.ToInt32(ddlProviderName.SelectedValue);
string ProviderStatus = "InActive";
pc.ProviderUpdateStatus(ProviderId, ProviderStatus);
}
mail.From = new MailAddress("projectonizer@gmail.com");
mail.Subject = "Reply By Projectonizer";
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("projectonizer@gmail.com", "freelancing");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
ClearControls();
}
private void ClearControls()
{
txtUsername.Text = "";
txtPassword.Text = "";
txtReason.Text = "";
ddlProviderName.SelectedIndex = 0;
FormView1.Visible = false;
GridView1.Visible = false;
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)

{
GridView1.PageIndex = e.NewPageIndex;
BindGridView(Convert.ToInt32(ddlProviderName.SelectedValue));
}
}

1.11 Admin Verify Advertiser :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Net.Mail;
public partial class Administrator_VerifyAdvertiserfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
static string CityName = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDdlAdvertiserName();
}
}
private void BindDdlAdvertiserName()
{
ddlAdvertiserName.DataTextField = "AdvertiserCompanyName";
ddlAdvertiserName.DataValueField = "AdvertiserId";
ddlAdvertiserName.DataSource = pc.AdvertiserDisplay();
ddlAdvertiserName.DataBind();
}
protected void ddlAdvertiserName_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlAdvertiserName.SelectedValue != "0")
{
BindFormView(Convert.ToInt32(ddlAdvertiserName.SelectedValue));
BindGridView(Convert.ToInt32(ddlAdvertiserName.SelectedValue));
}

}
private void BindFormView(int AdvertiserId)
{
CityName =
pc.AdvertiserCompanyCityNameByAdvertiserCompanyCityId(AdvertiserId,
pc.AdvertiserFind(AdvertiserId).SingleOrDefault().AdvertiserCompanyCityId).SingleOrDefa
ult().CityName;
FormView1.DataSource = pc.AdvertiserFind(AdvertiserId);
FormView1.DataBind();
FormView1.Visible = true;
}
private void BindGridView(int AdvertiserId)
{
GridView1.DataSource =
pc.AdvertiserAdDisplayAdvertiserAdAdvertiserId(AdvertiserId);
GridView1.DataBind();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
string advertiseremailid = FormView1.DataKey[0].ToString();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox cbox = GridView1.Rows[i].FindControl("cbox") as CheckBox;
if (cbox.Checked)
{
pc.AdvertiserAdUpdateStatus(Convert.ToInt32(ddlAdvertiserName.SelectedValue),GridView
1.DataKeys[i][0].ToString(),"Accepted");
}
else
{
pc.AdvertiserAdUpdateStatus(Convert.ToInt32(ddlAdvertiserName.SelectedValue),
GridView1.DataKeys[i][0].ToString(), "Rejected");
}
}
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
BindGridView(Convert.ToInt32(ddlAdvertiserName.SelectedValue));
}
private void ClearControls()

{
ddlAdvertiserName.SelectedIndex = 0;
FormView1.Visible = false;
GridView1.Visible = false;
}
2. Advertiser Panel :2.1 Advertiser Add Advertisement Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Advertiser_AdvertiserAdfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
static int rowindex = 0;
protected void Page_Load(object sender, EventArgs e)
{
cmpStartDate.ValueToCompare = DateTime.Now.ToString("d");
if (!IsPostBack)
{
DataTable dtable = new DataTable("AdvertiserAdTable");
dtable.Columns.Add(new DataColumn("AdvertiserAdImage",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdNavigateUrl",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdKeyword",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdImpressions",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdStartDate",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdEndDate",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdAmount",
Type.GetType("System.String")));
ViewState["AdvertiserAdTable"] = dtable;
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)

{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
pc.AdvertiserAdInsert((GridView1.Rows[i].FindControl("lblImage") as Label).Text,
(GridView1.Rows[i].FindControl("lblNavigateUrl") as Label).Text,
(GridView1.Rows[i].FindControl("lblKeyword") as Label).Text,
Convert.ToInt32((GridView1.Rows[i].FindControl("lblImpressions") as
Label).Text),
(GridView1.Rows[i].FindControl("lblStartDate") as Label).Text,
(GridView1.Rows[i].FindControl("lblEndDate") as Label).Text,
(GridView1.Rows[i].FindControl("lblAmount") as Label).Text,
"Not Active",
Convert.ToInt32(pc.AdvertiserIdentity())
);
}
if (GridView1.Rows.Count > 0)
{
DataTable questiontable = (DataTable)ViewState["AdvertiserAdTable"];
questiontable.Rows.Clear();
GridView1.DataSource = questiontable;
GridView1.DataBind();
}
}
protected void lkbtnAdd_Click(object sender, EventArgs e)
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
if (lkbtnAdd.Text == "Add")
{
DataRow drow = dtable.NewRow();
drow[0] = fuAdvertiserAdImage.FileName;
drow[1] = txtAdvertiserAdNavigateUrl.Text;
drow[2] = ddlAdvertiserAdKeyword.SelectedValue;
drow[3] = txtAdvertiserAdImpressions.Text;
drow[4] = txtAdvertiserAdStartDate.Text;
drow[5] = txtAdvertiserAdEndDate.Text;
drow[6] = txtAdvertiserAdAmount.Text;
dtable.Rows.Add(drow);
GridView1.DataSource = dtable;
GridView1.DataBind();
if (fuAdvertiserAdImage.FileName.Length > 0)
{
string path = Server.MapPath(".");

int indx = path.LastIndexOf("\\");


path = path.Substring(0, indx + 1);
path = path + "AdvertiserAds\\";
fuAdvertiserAdImage.SaveAs(path + fuAdvertiserAdImage.FileName);
}
}
if (lkbtnAdd.Text == "Update")
{
string Image = "";
if (fuAdvertiserAdImage.FileName.Length == 0)
{
Image = dtable.Rows[rowindex][0].ToString();
}
else
{
Image = fuAdvertiserAdImage.FileName;
fuAdvertiserAdImage.SaveAs(Server.MapPath("AdvertiserAds/") +
fuAdvertiserAdImage.FileName);
}
dtable.Rows[rowindex][0] = Image;
dtable.Rows[rowindex][1] = txtAdvertiserAdNavigateUrl.Text;
dtable.Rows[rowindex][2] = ddlAdvertiserAdKeyword.SelectedValue;
dtable.Rows[rowindex][3] = txtAdvertiserAdImpressions.Text;
dtable.Rows[rowindex][4] = txtAdvertiserAdStartDate.Text;
dtable.Rows[rowindex][5] = txtAdvertiserAdEndDate.Text;
dtable.Rows[rowindex][6] = txtAdvertiserAdAmount.Text;
BindGridView();
lkbtnAdd.Text = "Add";
}
ClearAdvertiserAdControls();
}
private void BindGridView()
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
GridView1.DataSource = dtable;
GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
rowindex = e.NewEditIndex;
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];

txtAdvertiserAdNavigateUrl.Text = dtable.Rows[e.NewEditIndex][1].ToString();
txtAdvertiserAdImpressions.Text = dtable.Rows[e.NewEditIndex][3].ToString();
txtAdvertiserAdStartDate.Text = dtable.Rows[e.NewEditIndex][4].ToString();
txtAdvertiserAdEndDate.Text = dtable.Rows[e.NewEditIndex][5].ToString();
txtAdvertiserAdAmount.Text = dtable.Rows[e.NewEditIndex][6].ToString();
ddlAdvertiserAdKeyword.SelectedIndex = 0;
lkbtnAdd.Text = "Update";
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindGridView();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
dtable.Rows.RemoveAt(e.RowIndex);
BindGridView();
}
private void ClearAdvertiserAdControls()
{
txtAdvertiserAdNavigateUrl.Text = "";
txtAdvertiserAdImpressions.Text = "";
txtAdvertiserAdStartDate.Text = "";
txtAdvertiserAdEndDate.Text = "";
txtAdvertiserAdAmount.Text = "";ddlAdvertiserAdKeyword.SelectedIndex = 0; }
2.2 Advertiser Sign Out Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
public partial class Advertiser_AdvertiserSignOutfrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("../Homefrm.aspx");
}
}

3. Provider Panel :3.1 View Project Detail :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ViewProjectDetailsfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
BindDetailsView();
BindGridView(Convert.ToInt32(Session["prjid"]));
}
private void BindDetailsView()
{
DetailsView1.DataSource = pc.AddProjectFind(Convert.ToInt32(Session["prjid"]));
DetailsView1.DataBind();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (fuAttachment.FileName.Length > 0)
{
string path = Server.MapPath(".");
int indx = path.LastIndexOf("\\");
path = path.Substring(0, indx + 1);
path = path + "ProviderProjectFiles\\";
fuAttachment.SaveAs(path + fuAttachment.FileName + "_" + Session["id"]);
}
panel1.Visible = false;
lkbtnBidAgain.Visible = true;
lkbtnBidOtherProject.Visible = true;
pc.BidInsert(
txtBidProposal.Text,
fuAttachment.FileName,
txtBidAmount.Text,
ddlTimeFrame.SelectedValue,
DateTime.Now.ToString(),
Convert.ToInt32(Session["id"]),
Convert.ToInt32(Session["prjid"]),
"No"
);

BindGridView(Convert.ToInt32(Session["prjid"]));
}
protected void lkbtnBidAgain_Click(object sender, EventArgs e)
{
panel1.Visible = true;
lkbtnBidAgain.Visible = false;
lkbtnBidOtherProject.Visible = false;
txtBidAmount.Text = "";
txtBidProposal.Text = "";
}
private void BindGridView(int projectid)
{
GridView1.DataSource = pc.BidDisplayByBidAddProjectId(projectid);
GridView1.DataBind();
}
}
3.2 Provider View Project Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ProviderViewProjectfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
public Int32 sno;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindGridView();
}
private void BindGridView()
{
GridView1.DataSource =
pc.AddProjectDisplayByAwardedProjectProviderId(Convert.ToInt32(Session["id"]));
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
sno = sno + 1;
}

public String status(String sts)


{
if (sts == "Awarded")
{
sts = "New";
}
return sts;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
Session["AddProjectId"] = Convert.ToInt32(GridView1.DataKeys[e.RowIndex][0]);
Session["AddProjectStatus"] = GridView1.DataKeys[e.RowIndex][1].ToString();
Response.Redirect("ProviderAssignProjectfrm.aspx");
}
}

3.3 Provider Update Employee Form :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class ProviderUpdateEmployeefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
BindDdlCountryName();
BindDdlDesignationName();
BindDdlEmployeeName();
}
}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();

ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId);
ddlStateName.DataBind();
}
private void BindDdlCityName(int CityStateId)
{
ddlCityName.DataTextField = "CityName";
ddlCityName.DataValueField = "CityId";
ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId);
ddlCityName.DataBind();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (ddlCountryName.SelectedValue != "0")
{
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
}
else
{
BindDdlStateName(0);
}
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlCityName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitem);
ddlCityName.AppendDataBoundItems = true;
if (ddlStateName.SelectedValue != "0")
{
BindDdlCityName(Convert.ToInt32(ddlStateName.SelectedValue));
}

else
{
BindDdlCityName(0);
}
}
private void BindDdlDesignationName()
{
if (Session["id"] != null)
{
ddlDesignationName.DataTextField = "DesignationName";
ddlDesignationName.DataValueField = "DesignationId";
ddlDesignationName.DataSource =
pc.DesignationDisplayByDesignationProviderId(Convert.ToInt32(Session["id"]));
ddlDesignationName.DataBind();
}
}
private void BindDdlEmployeeName()
{
if (Session["id"] != null)
{
ddlEmployeeName.DataTextField = "EmployeeName";
ddlEmployeeName.DataValueField = "EmployeeId";
ddlEmployeeName.DataSource =
pc.EmployeeDisplayByEmployeeProviderId(Convert.ToInt32(Session["id"]));
ddlEmployeeName.DataBind();
}
}
private void ClearControls()
{
ddlEmployeeName.SelectedIndex = 0;
txtAddress.Text = "";
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtPinCode.Text = "";
txtTelephoneNo.Text = "";
txtMobileNo.Text = "";
txtEmailId.Text = "";
ddlDesignationName.SelectedIndex = 0;
txtRemarks.Text = "";
}
protected void lkbtnUpdate_Click(object sender, EventArgs e)
{
pc.EmployeeUpdate(Convert.ToInt32(ddlEmployeeName.SelectedValue),
txtAddress.Text,
Convert.ToInt32(ddlCityName.SelectedValue),
txtPinCode.Text,
txtTelephoneNo.Text,

txtMobileNo.Text,
txtEmailId.Text,
Convert.ToInt32(ddlDesignationName.SelectedValue),
txtRemarks.Text,
Convert.ToInt32(Session["id"])
);
lblMessage.Text = "Record Updated Successfully";
ClearControls();
}
protected void ddlEmployeeName_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlEmployeeName.SelectedValue != "0")
{
var result =
pc.EmployeeFind(Convert.ToInt32(ddlEmployeeName.SelectedValue)).SingleOrDefault();
txtAddress.Text = result.EmployeeAddress;
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtPinCode.Text = result.EmployeePinCode;
txtTelephoneNo.Text = result.EmployeeTelephoneNo;
txtMobileNo.Text = result.EmployeeMobileNo;
txtEmailId.Text = result.EmployeeEmailId;
ddlDesignationName.SelectedIndex = 0;
txtRemarks.Text = result.EmployeeRemarks;
}
}
}
3.4 Provider Place Bids :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ProviderPlaceBidfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
BindGridView();
for (int i = 0; i < GridView1.Rows.Count; i++)

{
string status = GridView1.DataKeys[i][0].ToString();
if (status == "Awarded")
{
LinkButton lkbtnBid = GridView1.Rows[i].FindControl("lkbtnBid") as
LinkButton;
lkbtnBid.Enabled = false;
}
}
}
private void BindGridView()
{
GridView1.DataSource =
pc.AddProjectDisplayByProviderIdAndOpenToAll(Convert.ToInt32(Session["id"]),"Yes");
GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
int AddProjectId = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex][0]);
Session["prjid"] = AddProjectId;
Response.Redirect("ViewProjectDetailsfrm.aspx");
}
}
3.5 Provider Message Board Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ProviderMessageBoardfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindDdlProjects();
}
private void BindDdlProjects()
{
ddlProjects.DataTextField = "AddProjectTitle";
ddlProjects.DataValueField = "AddProjectId";
ddlProjects.DataSource =
pc.AddProjectDisplayByBidProviderId(Convert.ToInt32(Session["id"]));

ddlProjects.DataBind();
}
protected void ddlProjects_SelectedIndexChanged(object sender, EventArgs e)
{
DetailsView1.DataSource =
pc.ClientDisplayByAddProjectId(Convert.ToInt32(ddlProjects.SelectedValue));
DetailsView1.DataBind();
string messageboardstatus =
pc.BidMessageBoardStatusByBidProviderIdAndBidAddProjectId(Convert.ToInt32(Session["
id"]),
Convert.ToInt32(ddlProjects.SelectedValue)).SingleOrDefault().BidMessageBoardStatus;
if (messageboardstatus == "Yes")
{
Panel1.Visible = true;
lblMessage.Visible = false;
BindGridViewFirst();
BindGridViewSecond();
}
else
{
Panel1.Visible = false;
lblMessage.Visible = true;
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (fuAttachment.FileName != "")
{
string path = Server.MapPath(".");
int indx = path.LastIndexOf("\\");
path = path.Substring(0, indx + 1);
path = path + "ProviderProjectFiles\\";
fuAttachment.SaveAs(path + fuAttachment.FileName);
}
c.MessageBoardInsert(Convert.ToInt32(ddlProjects.SelectedValue),Convert.ToInt32(Session[
"id"]),Convert.ToInt32(DetailsView1.DataKey.Value),
Session["role"].ToString(),"Client",
txtMessage.Text,fuAttachment.FileName,DateTime.Now.ToString());
BindGridViewFirst();
}
private void BindGridViewFirst()
{

GridView1.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole(
Convert.ToInt32(ddlProjects.SelectedValue),
Convert.ToInt32(Session["id"]),
Session["role"].ToString(),
Convert.ToInt32(DetailsView1.DataKey.Value),
"Client"
);
GridView1.DataBind();
}
private void BindGridViewSecond()
{
GridView2.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole(
Convert.ToInt32(ddlProjects.SelectedValue),
Convert.ToInt32(DetailsView1.DataKey.Value),
"Client",
Convert.ToInt32(Session["id"]),
"Provider");
GridView2.DataBind();
}
}
3.6 Provider Employee Message Board Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ProviderEmployeesMessageBoardfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindEmployeeName();
}
private void BindEmployeeName()
{
ddlEmployeeName.DataTextField = "EmployeeName";
ddlEmployeeName.DataValueField = "EmployeeId";

ddlEmployeeName.DataSource =
pc.EmployeeDisplayByEmployeeProviderId(Convert.ToInt32(Session["id"]));
ddlEmployeeName.DataBind();
}
protected void ddlEmployeeName_SelectedIndexChanged(object sender, EventArgs e)
{
BindProjectName();
}
private void BindProjectName()
{
ddlProjectName.DataTextField = "AddProjectTitle";
ddlProjectName.DataValueField = "AddProjectId";
ddlProjectName.DataSource =
pc.AssignProjectDisplayByEmployeeId(Convert.ToInt32(ddlEmployeeName.SelectedValue))
;
ddlProjectName.DataBind();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (fuAttachment.FileName != "")
{
string path = Server.MapPath(".");
int indx = path.LastIndexOf("\\");
path = path.Substring(0, indx + 1);
path = path + "ProviderProjectFiles\\";
fuAttachment.SaveAs(path + fuAttachment.FileName);
}
pc.MessageBoardInsert(Convert.ToInt32(ddlProjectName.SelectedValue),
Convert.ToInt32(Session["id"]),
Convert.ToInt32(ddlEmployeeName.SelectedValue),
Session["role"].ToString(),
"Employee",
txtMessage.Text,
fuAttachment.FileName,
DateTime.Now.ToString()
);
BindGridViewFirst();
txtMessage.Text = "";
BindGridViewFirst();
BindGridViewSecond();
}
private void BindGridViewFirst()
{
GridView1.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole(
Convert.ToInt32(ddlProjectName.SelectedValue),

Convert.ToInt32(Session["id"]),
Session["role"].ToString(),
Convert.ToInt32(ddlEmployeeName.SelectedValue),
"Employee"
);
GridView1.DataBind();
}
private void BindGridViewSecond()
{
GridView2.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole(
Convert.ToInt32(ddlProjectName.SelectedValue),
Convert.ToInt32(ddlEmployeeName.SelectedValue),
"Employee",
Convert.ToInt32(Session["id"]),
Session["role"].ToString()
);
GridView2.DataBind();
}
protected void ddlProjectName_SelectedIndexChanged(object sender, EventArgs e)
{
BindGridViewFirst();
BindGridViewSecond();
}
}

3.7 Provider Edit Profile :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Linq;
public partial class Provider_ProviderEditProfilefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
public static string CityName;
public static string CompanyTypeName;
public static int SelectedIndexCountryId;
public static int SelectedIndexStateId;
public static int StateCountryId;

public static int CityStateId;


public static int ProviderCityId;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindFormView();
}
}
private void BindFormView()
{
if (Session["id"] != null)
{
CityName = pc.ProviderCityNameByProviderCityId(Convert.ToInt32(Session["id"]),
pc.ProviderFind(Convert.ToInt32(Session["id"])).SingleOrDefault().ProviderCityId).SingleO
rDefault().CityName;

CompanyTypeName =
pc.ProviderCompanyTypeNameByProviderCompanyTypeId(Convert.ToInt32(Session["id"]),
pc.ProviderFind(Convert.ToInt32(Session["id"])).SingleOrDefault().ProviderCompanyTypeI
d).SingleOrDefault().CompanyTypeName;
FormView1.DataSource = pc.ProviderFind(Convert.ToInt32(Session["id"]));
FormView1.DataBind();
}
}
protected void FormView1_ModeChanging(object sender, FormViewModeEventArgs e)
{
if (e.NewMode == FormViewMode.Edit)
{
FormView1.ChangeMode(FormViewMode.Edit);
}
if (e.NewMode == FormViewMode.Insert)
{
FormView1.ChangeMode(FormViewMode.Insert);
}
if (e.NewMode == FormViewMode.ReadOnly)
{
FormView1.ChangeMode(FormViewMode.ReadOnly);
}
BindFormView();
}
public ISingleResult<CountryDisplayResult> BindDdlCountryName()
{

return pc.CountryDisplay();
}
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedIndexCountryId = Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedIndex);
DropDownList ddlStateName = (FormView1.FindControl("ddlState") as
DropDownList);
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
DropDownList ddlCityName = (FormView1.FindControl("ddlCity") as DropDownList);
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (SelectedIndexCountryId != 0)
{
BindDdlStateName();
BindFormView();
}
}
public ISingleResult<StateDisplayByStateCountryIdResult> BindDdlStateName()
{
int id = 0;
DropDownList ddlStateName = (FormView1.FindControl("ddlState") as
DropDownList);
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
if (Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedValue) > 0)
{
StateCountryId = Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedValue);
}
else
{
if (StateCountryId > 0)
{
(FormView1.FindControl("ddlCountry") as DropDownList).SelectedIndex =
SelectedIndexCountryId;

id = StateCountryId;
}
else
{
id = 0;
}
}
return pc.StateDisplayByStateCountryId(id);
}
protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedIndexStateId = Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedIndex);
BindDdlCityName();
BindFormView();
}
public ISingleResult<CityDisplayByCityStateIdResult> BindDdlCityName()
{
int id = 0;
if (Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedValue) > 0)
{
CityStateId = Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedValue);
}
else
{
if (CityStateId > 0)
{
(FormView1.FindControl("ddlState") as DropDownList).SelectedIndex =
SelectedIndexStateId;
id = CityStateId;
}
else
{
id = 0;
}
}
return pc.CityDisplayByCityStateId(id);
}
public ISingleResult<CompanyTypeDisplayResult> BindDdlCompanyName()
{
return pc.CompanyTypeDisplay();
}
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
pc.ProviderUpdate(Convert.ToInt32(Session["id"]),
(FormView1.FindControl("etxtName") as TextBox).Text,
(FormView1.FindControl("etxtAddress") as TextBox).Text,

Convert.ToInt32((FormView1.FindControl("ddlCity") as
DropDownList).SelectedValue),
(FormView1.FindControl("etxtPhone") as TextBox).Text,
(FormView1.FindControl("etxtFax") as TextBox).Text,
(FormView1.FindControl("etxtUrl") as TextBox).Text,
(FormView1.FindControl("etxtEmail") as TextBox).Text,
Convert.ToInt32((FormView1.FindControl("ddlCompanyType") as
DropDownList).SelectedValue)
);
FormView1.ChangeMode(FormViewMode.ReadOnly);
BindFormView();
}
}
3.8 Provider Assign Project Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ProviderAssignProjectfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindDdlEmployeeName();
}
private void BindDdlEmployeeName()
{
if (Session["id"] != null)
{
ddlEmployeeName.DataTextField = "EmployeeName";
ddlEmployeeName.DataValueField = "EmployeeId";
ddlEmployeeName.DataSource =
pc.EmployeeDisplayByEmployeeProviderId(Convert.ToInt32(Session["id"]));
ddlEmployeeName.DataBind();
}
}
private void BindGridView()
{

GridView1.DataSource =
pc.AssignProjectDisplayByEmployeeId(Convert.ToInt32(ddlEmployeeName.SelectedValue))
;
GridView1.DataBind();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
BindGridView();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
pc.AssignProjectInsert(Convert.ToInt32(Session["AddProjectId"]),
Convert.ToInt32(ddlEmployeeName.SelectedValue),
txtDateOfAssignment.Text,
txtDueDate.Text,
txtActualDueDate.Text
);

pc.AddProjectUpdateStatusByAddProjectIdAndAddProjectStatus(Convert.ToInt32(Session["
AddProjectId"]),"Allotted");
lblMessage.Text = "Project Assigned To Employee";
txtDateOfAssignment.Text = "";
txtDueDate.Text = "";
txtActualDueDate.Text = "";
BindGridView();
}
}
3.9 Provider Add/Delete View Employee Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_ProviderAddDeleteViewEmployeefrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)

{
if(!IsPostBack)
{
BindDdlCountryName();
BindDdlDesignationName();
BindLstEmployeeDetails();
}
}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId);
ddlStateName.DataBind();
}
private void BindDdlCityName(int CityStateId)
{
ddlCityName.DataTextField = "CityName";
ddlCityName.DataValueField = "CityId";
ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId);
ddlCityName.DataBind();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (ddlCountryName.SelectedValue != "0")
{
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
}
else

{
BindDdlStateName(0);
}
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlCityName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitem);
ddlCityName.AppendDataBoundItems = true;
if (ddlStateName.SelectedValue != "0")
{
BindDdlCityName(Convert.ToInt32(ddlStateName.SelectedValue));
}
else
{
BindDdlCityName(0);
}
}
private void BindDdlDesignationName()
{
if (Session["id"] != null)
{
ddlDesignationName.DataTextField = "DesignationName";
ddlDesignationName.DataValueField = "DesignationId";
ddlDesignationName.DataSource =
pc.DesignationDisplayByDesignationProviderId(Convert.ToInt32(Session["id"]));
ddlDesignationName.DataBind();
}
}
private void BindLstEmployeeDetails()
{
if (Session["id"] != null)
{
lstEmployeeDetails.DataTextField = "EmployeeName";
lstEmployeeDetails.DataValueField = "EmployeeId";
lstEmployeeDetails.DataSource =
pc.EmployeeDisplayByEmployeeProviderId(Convert.ToInt32(Session["id"]));
lstEmployeeDetails.DataBind();
}
}
protected void lstEmployeeDetails_SelectedIndexChanged(object sender, EventArgs e)
{
var result =
pc.EmployeeFind(Convert.ToInt32(lstEmployeeDetails.SelectedValue)).SingleOrDefault();
txtName.Text = result.EmployeeName;
txtAddress.Text = result.EmployeeAddress;

ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtPinCode.Text = result.EmployeePinCode;
txtTelephoneNo.Text = result.EmployeeTelephoneNo;
txtMobileNo.Text = result.EmployeeMobileNo;
txtEmailId.Text = result.EmployeeEmailId;
ddlDesignationName.SelectedIndex = 0;
txtRemarks.Text = result.EmployeeRemarks;
var result1 =
pc.UsersDisplayByUsersMemberIdAndUsersRole(Convert.ToInt32(lstEmployeeDetails.Sele
ctedValue),"Employee").SingleOrDefault();
txtUsername.Text = result1.UsersName;
txtPassword.Text = result1.UsersPassword;
txtConfirmPassword.Text = result1.UsersPassword;
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
pc.EmployeeInsert(txtName.Text,
txtAddress.Text,
Convert.ToInt32(ddlCityName.SelectedValue),
txtPinCode.Text,
txtTelephoneNo.Text,
txtMobileNo.Text,
txtEmailId.Text,
Convert.ToInt32(ddlDesignationName.SelectedValue),
txtRemarks.Text,
Convert.ToInt32(Session["id"])
);
pc.UsersInsert(txtUsername.Text,txtConfirmPassword.Text,Convert.ToInt32(pc.ClientIdentit
y()),"Employee");
BindLstEmployeeDetails();
ClearControls();
}
private void ClearControls()
{
txtName.Text = "";
txtAddress.Text = "";
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtPinCode.Text = "";
txtTelephoneNo.Text = "";

txtMobileNo.Text = "";
txtEmailId.Text = "";
ddlDesignationName.SelectedIndex = 0;
txtRemarks.Text = "";
txtUsername.Text = "";
txtPassword.Text = "";
txtConfirmPassword.Text = "";
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
pc.EmployeeDelete(Convert.ToInt32(lstEmployeeDetails.SelectedValue));
BindLstEmployeeDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
}
3.10 Designation Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Provider_Designationfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindLstDesignationDetails();
}
}
protected void lkbtnInsert_Click(object sender, EventArgs e)
{
pc.DesignationInsert(txtDesignationName.Text, Convert.ToInt32(Session["id"]));
BindLstDesignationDetails();
ClearControls();
}

protected void lkbtnUpdate_Click(object sender, EventArgs e)


{
pc.DesignationUpdate(Convert.ToInt32(lstDesignationDetails.SelectedValue),
txtDesignationName.Text);
BindLstDesignationDetails();
ClearControls();
}
protected void lkbtnDelete_Click(object sender, EventArgs e)
{
pc.DesignationDelete(Convert.ToInt32(lstDesignationDetails.SelectedValue));
BindLstDesignationDetails();
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
protected void lstDesignationDetails_SelectedIndexChanged(object sender, EventArgs e)
{
txtDesignationName.Text =
pc.DesignationFind(Convert.ToInt32(lstDesignationDetails.SelectedValue)).SingleOrDefault(
).DesignationName;
}
private void BindLstDesignationDetails()
{
lstDesignationDetails.DataTextField = "DesignationName";
lstDesignationDetails.DataValueField = "DesignationId";
lstDesignationDetails.DataSource =
pc.DesignationDisplayByDesignationProviderId(Convert.ToInt32(Session["id"]));
lstDesignationDetails.DataBind();
}
private void ClearControls()
{
txtDesignationName.Text = "";
txtDesignationName.Focus();
}
}

4. Client Panel :4.1 Client Add Project :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Client_ClientAddProjectfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDdlProjectType();
BindDdlTechnology();
BindDdlFrontEnd();
BindDdlBackEnd();
}
}
private void BindDdlProjectType()
{
ddlProjectType.DataTextField = "ProjectTypeName";
ddlProjectType.DataValueField = "ProjectTypeId";
ddlProjectType.DataSource = pc.ProjectTypeDisplay();
ddlProjectType.DataBind();
}
private void BindDdlTechnology()
{
ddlTechnology.DataTextField = "TechnologyName";
ddlTechnology.DataValueField = "TechnologyId";
ddlTechnology.DataSource = pc.TechnologyDisplay();
ddlTechnology.DataBind();
}
private void BindDdlFrontEnd()
{
ddlFrontEnd.DataTextField = "FrontEndName";
ddlFrontEnd.DataValueField = "FrontEndId";
ddlFrontEnd.DataSource = pc.FrontEndDisplay();
ddlFrontEnd.DataBind();
}
private void BindDdlBackEnd()
{
ddlBackEnd.DataTextField = "BackEndName";
ddlBackEnd.DataValueField = "BackEndId";

ddlBackEnd.DataSource = pc.BackEndDisplay();
ddlBackEnd.DataBind();
}
private void BindGridView()
{
GridView1.DataSource = pc.ProviderDisplay();
GridView1.DataBind();
}
protected void ddlOpenToAll_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlOpenToAll.Items[0].Selected)
{
GridView1.Visible = false;
}
else
{
GridView1.Visible = true;
BindGridView();
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
pc.AddProjectInsert(Convert.ToInt32(ddlProjectType.SelectedValue),
txtTitle.Text,
txtDescription.Text,
fuAttachment.FileName,
Convert.ToInt32(ddlTechnology.SelectedValue),
Convert.ToInt32(ddlFrontEnd.SelectedValue),
Convert.ToInt32(ddlBackEnd.SelectedValue),
ddlDuration.SelectedValue,
ddlBudget.SelectedValue,
txtSecurityFee.Text,
txtBidOpenDays.Text,
ddlOpenToAll.SelectedValue,
"UnAwarded",
DateTime.Now.ToString(),
Convert.ToInt32(Session["id"])
);
if (fuAttachment.FileName.Length > 0)
{
string path = Server.MapPath(".");
int indx = path.LastIndexOf("\\");
path = path.Substring(0, indx + 1);
path = path + "ClientProjectFiles\\";
fuAttachment.SaveAs(path + fuAttachment.FileName);
}
if (ddlOpenToAll.Items[1].Selected)
{

for (int i = 0; i < GridView1.Rows.Count; i++)


{
CheckBox cbox = GridView1.Rows[i].FindControl("cbox") as CheckBox;
if (cbox.Checked)
{
pc.ProjectInviteInsert(Convert.ToInt32(pc.AddProjectIdentity().FirstOrDefault().Column1),
Convert.ToInt32(GridView1.DataKeys[i][0]));
}
}
}
ClearControls();
}
private void ClearControls()
{
txtTitle.Text = "";
txtBidOpenDays.Text = "";
txtDescription.Text = "";
txtSecurityFee.Text = "";
ddlTechnology.SelectedIndex = 0;
ddlFrontEnd.SelectedIndex = 0;
ddlBackEnd.SelectedIndex = 0;
ddlBudget.SelectedIndex = 0;
ddlDuration.SelectedIndex = 0;
ddlOpenToAll.SelectedIndex = 0;
ddlProjectType.SelectedIndex = 0;
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.EditIndex = e.NewPageIndex;
BindGridView();
}
}
4.2 Client Bidding Details :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Client_ClientBiddingDetailsfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)

{
if (!IsPostBack)
{
BindDetailsView();
BindGridView();
}
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox chbox = GridView1.Rows[i].FindControl("chbox") as CheckBox;
string status =
pc.BidFindBidMessageBoardStatusByBidId(Convert.ToInt32(GridView1.DataKeys[i]
[0])).FirstOrDefault().BidMessageBoardStatus;
if (status == "Yes")
chbox.Checked = true;
}
}
private void BindDetailsView()
{
DetailsView1.DataSource = pc.AddProjectFind(Convert.ToInt32(Session["prjid"]));
DetailsView1.DataBind();
}
private void BindGridView()
{
GridView1.DataSource =
pc.BidDisplayByBidAddProjectId(Convert.ToInt32(Session["prjid"]));
GridView1.DataBind();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox chbox = GridView1.Rows[i].FindControl("chbox") as CheckBox;
if (chbox.Checked)
{
pc.BidUpdateBidMessageBoardStatusByBidId(Convert.ToInt32(GridView1.DataKeys[i]
[0]),"Yes");
}
}
Response.Redirect("ClientViewBiddingfrm.aspx");
}
}

4.3 Client Edit Profile :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Linq;
public partial class Client_ClientEditProfile : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
public static string CityName;
public static int SelectedIndexCountryId;
public static int SelectedIndexStateId;
public static int StateCountryId;
public static int CityStateId;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindFormView();
}
}
private void BindFormView()
{
if (Session["id"] != null)
{
CityName = pc.ClientCityNameByClientCityId(Convert.ToInt32(Session["id"]),
pc.ClientFind(Convert.ToInt32(Session["id"])).SingleOrDefault().ClientCityId).SingleOrDef
ault().CityName;
FormView1.DataSource = pc.ClientFind(Convert.ToInt32(Session["id"]));
FormView1.DataBind();
}
}
protected void FormView1_ModeChanging(object sender, FormViewModeEventArgs e)
{
if (e.NewMode == FormViewMode.Edit)

{
FormView1.ChangeMode(FormViewMode.Edit);
}
if (e.NewMode == FormViewMode.Insert)
{
FormView1.ChangeMode(FormViewMode.Insert);
}
if (e.NewMode == FormViewMode.ReadOnly)
{
FormView1.ChangeMode(FormViewMode.ReadOnly);
}
BindFormView();
}
public ISingleResult<CountryDisplayResult> BindDdlCountryName()
{
return pc.CountryDisplay();
}
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedIndexCountryId = Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedIndex);
DropDownList ddlStateName = (FormView1.FindControl("ddlState") as
DropDownList);
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
DropDownList ddlCityName = (FormView1.FindControl("ddlCity") as DropDownList);
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (SelectedIndexCountryId != 0)
{
BindDdlStateName();
BindFormView();
}
}
public ISingleResult<StateDisplayByStateCountryIdResult> BindDdlStateName()
{
int id = 0;
DropDownList ddlStateName = (FormView1.FindControl("ddlState") as
DropDownList);
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);

ddlStateName.AppendDataBoundItems = true;
if (Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedValue) > 0)
{
StateCountryId = Convert.ToInt32((FormView1.FindControl("ddlCountry") as
DropDownList).SelectedValue);
}
else
{
if (StateCountryId > 0)
{
(FormView1.FindControl("ddlCountry") as DropDownList).SelectedIndex =
SelectedIndexCountryId;
id = StateCountryId;
}
else
{
id = 0;
}
}
return pc.StateDisplayByStateCountryId(id);
}
protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedIndexStateId = Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedIndex);
BindDdlCityName();
BindFormView();
}
public ISingleResult<CityDisplayByCityStateIdResult> BindDdlCityName()
{
int id = 0;
if (Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedValue) > 0)
{
CityStateId = Convert.ToInt32((FormView1.FindControl("ddlState") as
DropDownList).SelectedValue);
}
else
{
if (CityStateId > 0)
{
(FormView1.FindControl("ddlState") as DropDownList).SelectedIndex =
SelectedIndexStateId;
id = CityStateId;
}
else
{

id = 0;
}
}
return pc.CityDisplayByCityStateId(id);
}
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
pc.ClientUpdate(Convert.ToInt32(Session["id"]),
(FormView1.FindControl("etxtName") as TextBox).Text,
(FormView1.FindControl("etxtAddress") as TextBox).Text,
Convert.ToInt32((FormView1.FindControl("ddlCity") as
DropDownList).SelectedValue),
(FormView1.FindControl("etxtPinCode") as TextBox).Text,
(FormView1.FindControl("etxtPhone") as TextBox).Text,
(FormView1.FindControl("etxtFax") as TextBox).Text,
(FormView1.FindControl("etxtEmail") as TextBox).Text,
(FormView1.FindControl("etxtProfile") as TextBox).Text
);
FormView1.ChangeMode(FormViewMode.ReadOnly);
BindFormView();
}
}
4.4 Client Message Board Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Client_ClientMessageBoardfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindDdlProject();
}
private void BindDdlProject()
{
ddlProject.DataTextField = "AddProjectTitle";
ddlProject.DataValueField = "AddProjectId";

ddlProject.DataSource =
pc.AddProjectDisplayByAddProjectClientId(Convert.ToInt32(Session["id"]));
ddlProject.DataBind();
}
private void BindDdlProvider()
{
ddlProvider.DataTextField = "ProviderName";
ddlProvider.DataValueField = "ProviderId";
ddlProvider.DataSource =
pc.ProviderDisplayByProjectIdAndBidMessageBoardStatus(Convert.ToInt32(ddlProject.Sele
ctedValue),
"Yes");
ddlProvider.DataBind();
}
protected void ddlProject_SelectedIndexChanged(object sender, EventArgs e)
{
ddlProvider.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlProvider.Items.Add(lstitem);
ddlProvider.AppendDataBoundItems = true;
BindDdlProvider();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (fuAttachment.FileName != "")
{
string path = Server.MapPath(".");
int indx = path.LastIndexOf("\\");
path = path.Substring(0, indx + 1);
path = path + "ClientProjectFiles\\";
fuAttachment.SaveAs(path + fuAttachment.FileName);
}
pc.MessageBoardInsert(Convert.ToInt32(ddlProject.SelectedValue),
Convert.ToInt32(Session["id"]),
Convert.ToInt32(ddlProvider.SelectedValue),
Session["role"].ToString(),
"Provider",
txtMessage.Text,
fuAttachment.FileName,
DateTime.Now.ToString());
BindGridViewFirst();
}
private void BindGridViewFirst()
{
GridView1.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole

(Convert.ToInt32(ddlProject.SelectedValue),
Convert.ToInt32(Session["id"]),
Session["role"].ToString(),
Convert.ToInt32(ddlProvider.SelectedValue),
"Provider");
GridView1.DataBind();
}
protected void ddlProvider_SelectedIndexChanged(object sender, EventArgs e)
{
BindGridViewFirst();
BindGridViewSecond();
}
private void BindGridViewSecond()
{
GridView2.DataSource =
pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndRe
ceiverRole
(Convert.ToInt32(ddlProject.SelectedValue),
Convert.ToInt32(ddlProvider.SelectedValue),
"Provider",
Convert.ToInt32(Session["id"]),
"Client");
GridView2.DataBind();
}
}
4.5 Client Project Awarded :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Client_ClientProjectAwarded : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDdlProjectName();
}
}

private void BindDdlProjectName()


{
ddlProjectName.DataTextField = "AddProjectTitle";
ddlProjectName.DataValueField = "AddProjectId";
ddlProjectName.DataSource =
pc.AddProjectDisplayByAddProjectClientId(Convert.ToInt32(Session["id"]));
ddlProjectName.DataBind();
}
protected void ddlProjectName_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.DataSource =
pc.BidDisplayByBidAddProjectIdAndBidMessageBoardStatus(Convert.ToInt32(ddlProjectN
ame.SelectedValue));
GridView1.DataBind();
}
protected void lkbtnConfirm_Click(object sender, EventArgs e)
{
for (Int32 i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox k = (CheckBox)(GridView1.Rows[i].FindControl("chk"));
if (k.Checked)
{
pc.AwardedProjectInsert(Convert.ToInt32(ddlProjectName.SelectedValue),Convert.ToInt32(
GridView1.DataKeys[i][0].ToString()),txtAmount.Text,
DateTime.Now.ToString());
pc.AddProjectUpdateStatusByAddProjectIdAndAddProjectStatus(Convert.ToInt32(ddlProjec
tName.SelectedValue),"Awarded");
lblMessage.Text = "Project Awarded To Provider";
txtAmount.Text = "";
}
}
}

4.6 Client View Bidding Form :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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


{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
BindGridView();
}
private void BindGridView()
{
GridView1.DataSource =
pc.AddProjectDisplayByAddProjectClientId(Convert.ToInt32(Session["id"]));
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
BindGridView();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
int projectid = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex][0]);
Session["prjid"] = projectid;
Response.Redirect("ClientBiddingDetailsfrm.aspx");
}
}
4.7 Pay Pal Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Client_Payfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ddlProjectBind();
}

}
private void ddlProjectBind()
{
ddlProject.DataTextField = "AddProjectTitle";
ddlProject.DataValueField = "AddProjectId";
ddlProject.DataSource =
pc.AddProjectDisplayByAddProjectClientId(Convert.ToInt32(Session["id"]));
ddlProject.DataBind();
}
private void AwardedProjectDetails()
{
FormView1.DataSource =
pc.AwarderProjectDisplayByAwardedProjectAddProjectId(Convert.ToInt32(ddlProject.Select
edValue));
FormView1.DataBind();
}
protected void ddlProject_SelectedIndexChanged(object sender, EventArgs e)
{
AwardedProjectDetails();
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["Amount"]
=pc.AwarderProjectDisplayByAwardedProjectAddProjectId(Convert.ToInt32(ddlProject.Sele
ctedValue)).SingleOrDefault().AwardedProjectAmount;
Response.Redirect("PayPal.aspx");
}
}
4.8 PayPal :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class PayPal : System.Web.UI.Page
{
protected String amount;
protected void Page_Load(object sender, EventArgs e)
{
amount = Session["Amount"].ToString();
}}
5. Registration Forms :-

5.1 Client Registration :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class ClientRegistrationfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "";
if (!IsPostBack)
{
BindDdlCountryName();
}
}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId);
ddlStateName.DataBind();
}
private void BindDdlCityName(int CityStateId)
{
ddlCityName.DataTextField = "CityName";
ddlCityName.DataValueField = "CityId";
ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId);
ddlCityName.DataBind();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");

ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (ddlCountryName.SelectedValue != "0")
{
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
}
else
{
BindDdlStateName(0);
}
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlCityName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitem);
ddlCityName.AppendDataBoundItems = true;
if (ddlStateName.SelectedValue != "0")
{
BindDdlCityName(Convert.ToInt32(ddlStateName.SelectedValue));
}
else
{
BindDdlCityName(0);
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (Session["GuidStr"].ToString() == txtCode.Text)
{
pc.ClientInsert(txtClientName.Text,
txtClientAddress.Text,
Convert.ToInt32(ddlCityName.SelectedValue),
txtClientPinCode.Text,
txtClientPhone.Text,
txtClientFax.Text,
txtEmailId.Text,
txtClientProfile.Text);

pc.UsersInsert(txtClientUsername.Text,txtClientConfirmPassword.Text,Convert.ToInt32(pc.
ClientIdentity().FirstOrDefault().Column1),"Client");
ClearControls();
Response.Redirect("Homefrm.aspx");
}
else
{
Label1.Text = "Wrong Entered Code";
ClearControls();
}
}
private void ClearControls()
{
txtClientName.Text = "";
txtClientAddress.Text = "";
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtClientPinCode.Text= "";
txtClientPhone.Text= "";
txtClientFax.Text= "";
txtEmailId.Text="";
txtClientProfile.Text ="";
txtClientUsername.Text = "";
txtClientPassword.Text= "";
txtClientConfirmPassword.Text = "";
}
}

5.2 Provider Registration :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class ProviderRegistrationfrm : System.Web.UI.Page
{

ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();


protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "";
if (!IsPostBack)
{
BindDdlCountryName();
BindDdlCompanyName();
DataTable dtable = new DataTable("ProviderProjectTable");
dtable.Columns.Add(new DataColumn("ProviderProjectDescription",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("ProviderProjectFile",
Type.GetType("System.String")));
ViewState["ProviderProjectTable"] = dtable;
}
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (ddlCountryName.SelectedValue != "0")
{
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
}
else
{
BindDdlStateName(0);
}
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlCityName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitem);
ddlCityName.AppendDataBoundItems = true;
if (ddlStateName.SelectedValue != "0")

{
BindDdlCityName(Convert.ToInt32(ddlStateName.SelectedValue));
}
else
{
BindDdlCityName(0);
}
}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId);
ddlStateName.DataBind();
}
private void BindDdlCityName(int CityStateId)
{
ddlCityName.DataTextField = "CityName";
ddlCityName.DataValueField = "CityId";
ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId);
ddlCityName.DataBind();
}
private void BindDdlCompanyName()
{
ddlCompanyType.DataTextField = "CompanyTypeName";
ddlCompanyType.DataValueField = "CompanyTypeId";
ddlCompanyType.DataSource = pc.CompanyTypeDisplay();
ddlCompanyType.DataBind();
}
private void ClearControls()
{
txtProviderName.Text = "";
txtProviderAddress.Text = "";
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtProviderPhone.Text = "";
txtProviderFax.Text = "";
txtProviderUrl.Text = "";
txtProviderEmailId.Text = "";

ddlCompanyType.SelectedIndex = 0;
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];
dtable.Rows.Clear();
BindGridView();
txtProviderName.Focus();
}
protected void lkbtnAdd_Click(object sender, EventArgs e)
{
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];
DataRow drow = dtable.NewRow();
drow[0] = txtProviderProjectDescription.Text;
drow[1] = fuProviderProjectFile.FileName;
dtable.Rows.Add(drow);
GridView1.DataSource = dtable;
GridView1.DataBind();
fuProviderProjectFile.SaveAs(Server.MapPath("ProviderProjectFiles//") +
fuProviderProjectFile.FileName);
txtProviderProjectDescription.Text = "";
}
private void BindGridView()
{
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];
GridView1.DataSource = dtable;
GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindGridView();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];
dtable.Rows.RemoveAt(e.RowIndex);
BindGridView();
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindGridView();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string ProjectDescription = "",ProjectFile = "";
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];

FileUpload fuProjectFile =
(GridView1.Rows[e.RowIndex].FindControl("efuProjectFile") as FileUpload);
if (fuProjectFile.FileName.Length == 0)
{
ProjectFile = dtable.Rows[e.RowIndex][1].ToString();
}
else
{
ProjectFile = fuProjectFile.FileName;
fuProjectFile.SaveAs(Server.MapPath("ProviderProjectFiles//") +
fuProjectFile.FileName);
}
ProjectDescription =
(GridView1.Rows[e.RowIndex].FindControl("etxtProjectDescription") as TextBox).Text;
dtable.Rows[e.RowIndex][0] = ProjectDescription;
dtable.Rows[e.RowIndex][1] = ProjectFile;
GridView1.EditIndex = -1;
BindGridView();
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (Session["GuidStr"].ToString() == txtCode.Text)
{
pc.ProviderInsert(txtProviderName.Text,
txtProviderAddress.Text,
Convert.ToInt32(ddlCityName.SelectedValue),
txtProviderPhone.Text,
txtProviderFax.Text,
txtProviderUrl.Text,
txtProviderEmailId.Text,
Convert.ToInt32(ddlCompanyType.SelectedValue),
"New",
DateTime.Now.ToString()
);
if (GridView1.Rows.Count > 0)
{
DataTable dtable = (DataTable)ViewState["ProviderProjectTable"];
for (int i = 0; i < GridView1.Rows.Count; i++)
{
pc.ProviderProjectInsert(dtable.Rows[i][0].ToString(),
dtable.Rows[i][1].ToString(),
Convert.ToInt32(pc.ProviderIdentity().FirstOrDefault().Column1)
);
}

}
}
else
{
Label1.Text = "Wrong Entered Code";
ClearControls();
}
Response.Redirect("Default2.aspx");
}
}

5.3 Advertiser Registration :using System;


using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class AdvertiserRegistrationfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
static int rowindex = 0;
protected void Page_Load(object sender, EventArgs e)
{
cmpStartDate.ValueToCompare = DateTime.Now.ToString("d");
if (!IsPostBack)
{
BindDdlCountryName();
DataTable dtable = new DataTable("AdvertiserAdTable");
dtable.Columns.Add(new DataColumn("AdvertiserAdImage",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdNavigateUrl",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdKeyword",
Type.GetType("System.String")));

dtable.Columns.Add(new DataColumn("AdvertiserAdImpressions",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdStartDate",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdEndDate",
Type.GetType("System.String")));
dtable.Columns.Add(new DataColumn("AdvertiserAdAmount",
Type.GetType("System.String")));
ViewState["AdvertiserAdTable"] = dtable;
}
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
if (Session["guid"].ToString() == txtCode.Text)
{
pc.AdvertiserInsert(
txtAdvertiserCompanyName.Text,
txtAdvertiserCompanyDescription.Text,
txtAdvertiserCompanyAddress.Text,
Convert.ToInt32(ddlCityName.SelectedValue),
txtAdvertiserCompanyPhone.Text,
txtAdvertiserCompanyFax.Text,
txtAdvertiserCompanyEmailId.Text,
txtAdvertiserCompanyPinCode.Text,
"New",
DateTime.Now.ToString()
);
for (int i = 0; i < GridView1.Rows.Count; i++)
{
pc.AdvertiserAdInsert((GridView1.Rows[i].FindControl("lblImage") as
Label).Text,
(GridView1.Rows[i].FindControl("lblNavigateUrl") as Label).Text,
(GridView1.Rows[i].FindControl("lblKeyword") as Label).Text,
Convert.ToInt32((GridView1.Rows[i].FindControl("lblImpressions") as
Label).Text),
(GridView1.Rows[i].FindControl("lblStartDate") as Label).Text,
(GridView1.Rows[i].FindControl("lblEndDate") as Label).Text,
(GridView1.Rows[i].FindControl("lblAmount") as Label).Text,
"Not Active",
Convert.ToInt32(pc.AdvertiserIdentity())
);
}
if (GridView1.Rows.Count > 0)
{
DataTable questiontable = (DataTable)ViewState["AdvertiserAdTable"];
questiontable.Rows.Clear();
GridView1.DataSource = questiontable;

GridView1.DataBind();
}
int UsersMemberId = Convert.ToInt32(pc.AdvertiserIdentity());
string UsersName = txtUsername.Text;
string UsersPassword = txtPassword.Text;
string UsersRole = "Advertiser";
pc.UsersInsert(UsersName,UsersPassword,UsersMemberId,UsersRole);
ClearAdvertiserControls();
ClearAdvertiserAdControls();
Response.Redirect("Homefrm.aspx");
}
else
{
Label1.Text = "Wrong Entered Code";
ClearAdvertiserControls();
}
}
protected void lkbtnAdd_Click(object sender, EventArgs e)
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
if (lkbtnAdd.Text == "ADD ADVERTISEMENTS")
{
DataRow drow = dtable.NewRow();
drow[0] = fuAdvertiserAdImage.FileName;
drow[1] = txtAdvertiserAdNavigateUrl.Text;
drow[2] = ddlAdvertiserAdKeyword.SelectedValue;
drow[3] = txtAdvertiserAdImpressions.Text;
drow[4] = txtAdvertiserAdStartDate.Text;
drow[5] = txtAdvertiserAdEndDate.Text;
drow[6] = txtAdvertiserAdAmount.Text;
dtable.Rows.Add(drow);
GridView1.DataSource = dtable;
GridView1.DataBind();
fuAdvertiserAdImage.SaveAs(Server.MapPath("AdvertiserAds//") +
fuAdvertiserAdImage.FileName);
}
if (lkbtnAdd.Text == "Update")
{
string Image = "";
if (fuAdvertiserAdImage.FileName.Length == 0)

{
Image = dtable.Rows[rowindex][0].ToString();
}
else
{
Image = fuAdvertiserAdImage.FileName;
fuAdvertiserAdImage.SaveAs(Server.MapPath("AdvertiserAds//") +
fuAdvertiserAdImage.FileName);
}
dtable.Rows[rowindex][0] = Image;
dtable.Rows[rowindex][1] = txtAdvertiserAdNavigateUrl.Text;
dtable.Rows[rowindex][2] = ddlAdvertiserAdKeyword.SelectedValue;
dtable.Rows[rowindex][3] = txtAdvertiserAdImpressions.Text;
dtable.Rows[rowindex][4] = txtAdvertiserAdStartDate.Text;
dtable.Rows[rowindex][5] = txtAdvertiserAdEndDate.Text;
dtable.Rows[rowindex][6] = txtAdvertiserAdAmount.Text;
BindGridView();
lkbtnAdd.Text = "ADD ADVERTISEMENTS";
}
ClearAdvertiserAdControls();
}
protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e)
{
ddlStateName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlStateName.Items.Add(lstitem);
ddlStateName.AppendDataBoundItems = true;
ddlCityName.Items.Clear();
ListItem lstitm = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitm);
ddlCityName.AppendDataBoundItems = true;
if (ddlCountryName.SelectedValue != "0")
{
BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue));
}
else
{
BindDdlStateName(0);
}
}
protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e)
{

ddlCityName.Items.Clear();
ListItem lstitem = new ListItem("-----Select Option-----", "0");
ddlCityName.Items.Add(lstitem);
ddlCityName.AppendDataBoundItems = true;
if (ddlStateName.SelectedValue != "0")
{
BindDdlCityName(Convert.ToInt32(ddlStateName.SelectedValue));
}
else
{
BindDdlCityName(0);
}
}
private void BindDdlCountryName()
{
ddlCountryName.DataTextField = "CountryName";
ddlCountryName.DataValueField = "CountryId";
ddlCountryName.DataSource = pc.CountryDisplay();
ddlCountryName.DataBind();
}
private void BindDdlStateName(int StateCountryId)
{
ddlStateName.DataTextField = "StateName";
ddlStateName.DataValueField = "StateId";
ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId);
ddlStateName.DataBind();
}
private void BindDdlCityName(int CityStateId)
{
ddlCityName.DataTextField = "CityName";
ddlCityName.DataValueField = "CityId";
ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId);
ddlCityName.DataBind();
}
private void BindGridView()
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
GridView1.DataSource = dtable;
GridView1.DataBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
rowindex = e.NewEditIndex;
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];

txtAdvertiserAdNavigateUrl.Text = dtable.Rows[e.NewEditIndex][1].ToString();
txtAdvertiserAdImpressions.Text = dtable.Rows[e.NewEditIndex][3].ToString();
txtAdvertiserAdStartDate.Text = dtable.Rows[e.NewEditIndex][4].ToString();
txtAdvertiserAdEndDate.Text = dtable.Rows[e.NewEditIndex][5].ToString();
txtAdvertiserAdAmount.Text = dtable.Rows[e.NewEditIndex][6].ToString();
ddlAdvertiserAdKeyword.SelectedIndex = 0;
lkbtnAdd.Text = "Update";
}
protected void GridView1_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindGridView();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];
dtable.Rows.RemoveAt(e.RowIndex);
BindGridView();
}
private void ClearAdvertiserControls()
{
txtAdvertiserCompanyName.Text = "";
txtAdvertiserCompanyDescription.Text = "";
txtAdvertiserCompanyAddress.Text = "";
ddlCountryName.SelectedIndex = 0;
ddlStateName.SelectedIndex = 0;
ddlCityName.SelectedIndex = 0;
txtAdvertiserCompanyPhone.Text = "";
txtAdvertiserCompanyFax.Text = "";
txtAdvertiserCompanyPinCode.Text = "";
}
private void ClearAdvertiserAdControls()
{
txtAdvertiserAdNavigateUrl.Text = "";
txtAdvertiserAdImpressions.Text = "";
txtAdvertiserAdStartDate.Text = "";
txtAdvertiserAdEndDate.Text = "";
txtAdvertiserAdAmount.Text = "";
ddlAdvertiserAdKeyword.SelectedIndex = 0;
}
}

Login Form :-

6.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Security;
public partial class Loginfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
int memberid = 0;
string memberrole ="";
string status = "";
try
{
var result = pc.UserCheck1(txtUserName.Text,txtPassword.Text).SingleOrDefault();
memberid = Convert.ToInt32(result.UsersMemberId);
memberrole = result.UsersRole;
}
catch
{
lblMessage.Text = "Wrong Username and Password";
}
if (memberid <= 0)
{
lblMessage.Text = "Wrong Username and Password";
}
else
{
FormsAuthenticationTicket tkt = new FormsAuthenticationTicket(1,
txtUserName.Text, DateTime.Now, DateTime.Now.AddDays(2), false, memberrole);
String d1 = FormsAuthentication.Encrypt(tkt);

HttpCookie ck = new HttpCookie(FormsAuthentication.FormsCookieName, d1);


Response.Cookies.Add(ck);
if (memberrole == "Provider")
{
status = pc.ProviderFind(memberid).SingleOrDefault().ProviderStatus;
Session["id"] = memberid;
Session["role"] = memberrole;
Session["status"] = status;
Response.Redirect("Default.aspx");
}
if (memberrole == "Advertiser")
{
status =
pc.AdvertiserFind(memberid).SingleOrDefault().AdvertiserCompanyStatus;
Session["id"] = memberid;
Session["role"] = memberrole;
Session["status"] = status;
Response.Redirect("Default.aspx");
}
if (memberrole == "Client")
{
Session["id"] = memberid;
Session["role"] = memberrole;
Session["status"] = "Active";
Response.Redirect("Default.aspx");
}
if (memberrole == "Employee")
{
Session["id"] = memberid;
Session["role"] = memberrole;
Session["status"] = "Active";
Response.Redirect("Default.aspx");
}
if (memberrole == "admin")
{
Session["id"] = memberid;
Session["role"] = memberrole;
Session["status"] = "Active";
Response.Redirect("Default.aspx");
} }
}
7. Faq Display Form :using System;
using System.Collections.Generic;
using System.Linq;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class FAQDisplayfrm : System.Web.UI.Page
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
BindDataList();
}
}
private void BindDataList()
{
DataList1.DataSource = pc.FaqDisplay();
DataList1.DataBind();
}
}
8.

Change Password ascx Form :-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ChangePassword : System.Web.UI.UserControl
{
ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void lkbtnSubmit_Click(object sender, EventArgs e)
{
int res =
pc.UsersChangePassword(Convert.ToInt32(Session["id"]),txtOldPassword.Text,txtNewPass
word.Text).SingleOrDefault().Column1;
if (res > 0)

{
lblMessage.Text = "Password Updated Sucessfully";
}
else
{
lblMessage.Text = "Wrong Old Password";
}
ClearControls();
}
protected void lkbtnCancel_Click(object sender, EventArgs e)
{
ClearControls();
}
private void ClearControls()
{
txtOldPassword.Text = "";
txtNewPassword.Text = "";
txtConfirmNewPassword.Text = "";
}
}
9.

Captcha Code :-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Imaging;
public partial class CaptchaCodefrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Bitmap objBmp = new Bitmap(128, 28);
Graphics objGraphics = Graphics.FromImage(objBmp);
objGraphics.Clear(Color.Wheat);
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
Font objFont = new Font("Comic Sans", 18, FontStyle.Strikeout);
string guidStr = Guid.NewGuid().ToString().Substring(0,7);

Session["GuidStr"] = guidStr;
objGraphics.DrawString(guidStr, objFont, Brushes.Red, 3, 3);
Response.ContentType = "image/GIF";
objBmp.Save(Response.OutputStream, ImageFormat.Gif);
objFont.Dispose();
objGraphics.Dispose();
objBmp.Dispose();
}
}
10. Contact Us Form :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
public partial class ContactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSend_Click(object sender, EventArgs e)
{
string emailid = TextBox2.Text;
SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
// setup Smtp authentication
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("aspdotnetrosario@gmail.com",
"visualstudio2010");
client.UseDefaultCredentials = false;
client.Credentials = credentials;
MailMessage msg = new MailMessage();
msg.From = new MailAddress("aspdotnetrosario@gmail.com");

msg.To.Add("harryparmar07@gmail.com");

msg.Subject = TextBox3.Text;
msg.IsBodyHtml = true;
msg.Body = "Hi, Email Id is " + TextBox2.Text + "And Message is " + TextBox4.Text;
try
{
client.Send(msg);
}
catch { }
Label1.Text = "Message send successfully";
}
}
11. Redirection Page :using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["id"] != null && Session["role"] != null && Session["status"] != null)
{
string role = Session["role"].ToString();
string status = Session["status"].ToString();
if (User.IsInRole("Provider"))
{
Response.Redirect(@"Provider\WelcomeProviderfrm.aspx");
}
if (User.IsInRole("Advertiser"))
{
Response.Redirect(@"Advertiser\WelcomeAdvertiserfrm.aspx");
}
if (User.IsInRole("Client"))
{
Response.Redirect(@"Client\WelcomeClientfrm.aspx");
}
if (User.IsInRole("Employee"))

{
Response.Redirect(@"Employee\WelcomeEmployeefrm.aspx");
}
if (User.IsInRole("admin"))
{
Response.Redirect(@"Administrator\WelcomeAdministrator.aspx");
}
}
}
}

INTEGRATION AND TESTING


Functional testing: This type of testing ignores the internal parts and focus on the output is
as per requirement or not. Black-box type testing geared to functional requirements of an
application. Since, in functional testing of this project we test the external part of the project
so that if the users provide any type of input through GUI then we can handle it and give the
information to the user so that the user can restrict to enter the correct input.
So we test all the controls on all the forms by inputting various types of data so that any
errors can be occur and it can be fixed. Since, in functional testing we faced some run time
error like:
When we test the upload the book panel in admin page then we face an unpredictable
error is that, after inputting the data in the textbox and brows the files and images and
click the upload button then we get an error URL NOT FOUND. So to fix this error
we discuss together and find that this is due to Ajax control Accordion it is not work
properly with the file upload control, so to remove this error we use another Ajax
control AsynchUploader in spite of Accordion control.
And other problems occur when we try to search from the search by page then after
entering the information to search the book from database and click the search button
then there are occur casting problems because we are using LINQ to retrieve the data
from the database, since LINQ return IEnumrable type data. So when we try to return
a particular Colum from a table in that particular data type then it produces an error
when we try to receive the data. So, to remove this error we return
IEnumrable<TableT> generic and receive the table and exclude the information the
table which is required for the page.
Structural testing: Since in the structural testing requires through knowledge of internal
structure of the software, so that we can find the possible errors and then can be removed to
make the software more correct.
So, we start structural testing of the project to check, is the coding standard was fallowed are
not, is the security of the admin and users are configured properly are not, is the layered
architecture was followed are not because we are decided to follow the three layer
architecture to develop this project.

Since, in implementing all these things we get some errors and try to fix it as follows:
When we are testing the source code to check the coding standard is followed are not
then it is missing somewhere in the code then we remove this error so that
understandability of the source code is increased.
Now another problem is encountered when we try to export the source code and
database of the project in other system, of connection string and attachment of
database in that system. So after searching on net and continuous trying to fix this
problem, we find a perfect solution is that when we transfer the database and source
code in other system then we have to change the connection string in web.config file
of the Data Layer because in this layer we are using datacontext class, and also
change the connection string in properties class of Data Layer.
And to fix the security problem of the admin and users we are assign the roles to the
admin and normal users from the configuration wizard which automatic generate the
corresponding code in the config file.
So, all these errors are removed from the project during structural testing.
Levels of testing: We perform different level of testing on the project to remove the possible
errors.
Unit Testing: In unit testing we are divide the whole project in small different units and it is
tested by that programmer who is not make the code of that unit, so that it can produce error
and can be removed.
Integration Testing: Integration testing is insuring the correct interaction between system
units and proper merging of library and DLLs.
System Testing: In system testing we test overall interaction of components in the project and
find disparities between implementation and specification of the project.
Acceptance Testing: In this part of testing we mind the user requirements because users are
essential part of process. And in this testing we also take help of other people who are not
part of the developer of the project.

Regression testing: Due to some error we have to modify the code of the project so, we
perform regression testing.

Testing the project:


Projecttesting is the process of exercising a software item to detect the differences between its
behavior and the desired behavior as stipulated by the requirements of the users. So, in the
project testing we test every module of the project by inputting various possible data through
GUI of the project and get some error and write down it and at the end of the testing we remove
all errors which occurred during the project testing.

IMPLEMENTATION
Implementation of the project:
Some of the difficulty we faced was in trying to make the desired functions work. At first the
coding seemed a little complex, so we went back and discusses the problem for clarification
and we were able to get a more detailed description of the functions. After studying the IDE
we wanted to use, the coding became less complex and we were able to figure out how to go
about it.
Some of the technical issues and questions we encountered were with the following:

How the program saves data

How errors are detected and the error messages that should appear

What happens when we try overwriting data that already exists on the list

Is the software user friendly?

Is the Graphic User Interface elegant?

The platform the software should run on

We were able to answer and resolve these issues after meetings and discussions with the
entire group.
Software development practice adopted:

We used simple designs which were as simple as the current functionality allowed by
the system.

We first began with very simple design which is incrementally improved.

Continuous integration was also used where each code was compiled run and tested
before adding to the system after which the system must meet all the criteria.

The most important practice adopted was pair programming. We paired up with
members of the team and each team met at various times to code. After each pair
coded, they made sure they tested and compiled it, then added it to the main which
they sent to the other group members.

CONCLUSION
The system has been developed for the given condition and is found working
effectively. The developed system is flexible and changes whenever can be made easy.
Using the facilities and functionalities of .Net, the website has been developed in a
neat and simple manner, thereby reducing the operators work.

The speed and accuracy are maintained in proper way. The user friendly nature of this
website developed in .Net framework is very easy to work with both for the higher
management as well as other employees with little knowledge of computer. The
results obtained were fully satisfactory from the user point of view.

The system was verified with valid as well as invalid data in each manner. The system
is run with an insight into the necessary modifications that may require in the future.
Hence the system can be maintained successfully without much network.

BIBLIOGRAPHY
Daily Dairy
C# 4.0 in a Nutshell by Joseph Albahari and Ben Albahari
www.dotnetshell.blogspot.com
www.csharp.net-informations.com
www.msdn.microsoft.com
www.asp.net/ajaxLibrary

You might also like