Академический Документы
Профессиональный Документы
Культура Документы
TRAINING REPORT
UNDERTAKEN AT
Submitted By:
Name:Sukhbir Khurmi
Designation:Developer
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
Company Profile
1-3
4-7
Objectives
3
Modular Discription
8
9-10
Project Undertaken
11-16
Design Phase
17-20
20-21
Data Base Design
22-25
Development Phase
26-102
10
Integration Testing
103-105
11
Implimentation
106
12
Conclusion
107
13
Bibligraphy
108
1.
COMPANY PROFILE
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.
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.
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
2.2
2.3
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:
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
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
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.
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.
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:
Employee: In this service employee can logout and can change password.
5. ADVERTISER MODULE:-
Manage Advertisement:
advertisements.
Advertisement: In this service advertiser can change password and can logout.
This
service
provides
advertiser
to
add
PROJECT UNDERTAKEN
Thread Management
Code Verification
Remoting
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.
Memory management
Thread management
Exception handling
Garbage collection
Security
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 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
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
Payment
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
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();
}
}
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();
}
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
{
{
txtBackEndName.Text = "";
txtBackEndName.Focus();
}
}
}
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();
}
}
}
}
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));
}
}
}
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(".");
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");
}
}
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;
}
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();
}
}
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();
}
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)
{
{
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");
}
}
{
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 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 :-
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 = "";
}
}
{
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");
}
}
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);
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.
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");
}
}
}
}
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.
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 errors are detected and the error messages that should appear
What happens when we try overwriting data that already exists on the list
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.
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