six months industrial training final 1

155
SIX MONTHS INDUSTRIAL TRAINING TRAINING REPORT UNDERTAKEN AT “XPRESS WEB SOLUTIONZ” IN “.NET” ON “TABLE RESERVATION SYSTEM” SUBMITTED IN PARTIAL FULFILLMENT OF THE DEGREE OF BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE & ENGINEERING Under the Guidance of: Submitted By: Name:Sukhbir Khurmi Name: Jasmeet Singh

Upload: ikhlaaskaushal

Post on 09-Nov-2015

14 views

Category:

Documents


2 download

DESCRIPTION

HELLO

TRANSCRIPT

SIX MONTHS INDUSTRIAL TRAINING TRAINING REPORT

UNDERTAKEN AT

XPRESS WEB SOLUTIONZ IN

.NET

ON

TABLE RESERVATION SYSTEM

SUBMITTED IN PARTIAL FULFILLMENT OF THE DEGREE

OF

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE & ENGINEERING

Under the Guidance of:Submitted By: Name:Sukhbir KhurmiName: Jasmeet SinghDesignation:DeveloperCollege Roll No.: CS/11/11039Department: Express Web SolutionzUniversity Roll No.:1145758

INSTITUTE OF ENGINEERING AND TECHNOLOGY-BHADDAL

PO : MIANPUR, District: Ropar, PunjabACKNOWLEDGEMENT

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. OnceThe 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 TitlePage No.Remarks

1Company Profile 1-3

2Introduction to Project and Objectives4-7

3Modular Discription8

4Detailed analysis of modules9-10

5Project Undertaken11-16

6Design Phase17-20

7Data Base Design20-21

8Designing of Web Pages22-25

9Development Phase26-102

10Integration Testing103-105

11Implimentation106

12Conclusion107

13Bibligraphy108

1. COMPANY PROFILE

Xpress Web SolutionzScience & Techonolgy Enterprenuers Park Gill Road, LudhianaEmail: [email protected]: www. xpresswebsolutionz.com

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

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

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

Our Strengths One-Stop Internet Solutions Vendor From custom web designing to developing complex web and mobile applications,PNFs team has the expertise to use all the latest technology paradigms effectively and deliver quality solutions that meet latest industry trends. Full-Cycle Development Services We ensure that every stage of Software Development Life Cycle gets the time and attention it deserves. From defining the requirements to post deployment support, PNF provides end-to-end solutions for application development. Experience and Expertise With the credit of providing effective solutions in countless scenarios under our belt, over years our team has acquired exceptional skill sets and built a knowledge base that enable us to provide the best possible solutions tailor-made to our clients specific needs. Quality Standards At picNframes Technologies, our three-pronged approach of hiring the best talent, using proven processes and ensuring seamless communication, helps us create solutions that wow the end user and bring faster returns for our clients.

From DIRECTORs Desk Xpress Web Solutionz. is striving to become one of the leading web solution and service providers in the country. They were looking for, and our comprehensive training for budding IT professionals ensures that they are industry ready and taking the right steps to a successful career. This way, we are also contributing to the IT industry by giving its young and promising talent. Knowledge of different APIs and specific tools are enough to develop websites and applications; however, developing a product that not only meets the clients requirements but surpasses their expectations as well, requires a great deal of experience and dedication. At PNF we work on principles; and with high standards that we have set for our services, we strive to work with the utmost professionalism; and our products speak the rest. Sukhbir Khurmi

2. INTRODUCTIOn2.1 Name of the Project Table Reservation System.

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

2.3 Objectives and Scope This software is aimed at making data entry, management, updating, storage and retrieval easier and faster. The following objectives have been kept in mind: Practicality: The system is quite stable and can be operated by the people with average intelligence. Efficiency: The system will have the accuracy, timeliness and comprehensiveness of the output. Cost: It is desirable to aim for the system with a minimum cost subject to the condition that it must satisfy the entire requirements. Flexibility:I have tried that the system should be modifiable depending on the changing needs of the user. Such modifications should entail extensive reconstructing or recreation of software. It should also be portable to different computer systems. Security: This is a very important aspect and I have tried to cover the areas of hardware reliability, fall-back procedures, and physical security of data.

In addition to the user friendliness and easiness to access and input data into the system, the system will be available all over the world through the internet facility and anyone from anywhere can access this application.

From a programmer point of view the objective of the work done by me in the stated application is to make the whole system Object Oriented. Starting with the first step up to the final line of code I wrote, I will try to make the system Object Oriented.

The scope of my project work is to make the outsourcing of the work easy. People can easily find the professional technologist, who can help them to make/complete their task.

2.4 Work PlanThis project was worked upon using the most common methodology known as Waterfall Model. This model divides the whole target into a number of modules. Dividing the project into various modules helped us to better manage the project work and also helped to complete it in time.

The basic diagram for the waterfall work model is as follows:

Fig.1 -Basic Waterfall Model

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

2.5 Implementation StrategyThe various types of requirements for the development of the project are as follows - The platform to be used for the development of this project is Microsoft Visual C#.Net The database to be used with the project is Microsoft SQL Server 2008 The Integrated Development Environment (IDE) to be used for the development of this project is Microsoft Visual Studio 2010

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

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

2.8 Hardware Requirements: Computer that has a 1.6GHz or faster processor 1 GB (32 Bit) or 2 GB (64 Bit) RAM 3GB of available hard disk space 5400 RPM hard disk drive DirectX 9 capable video card running at 1024 x 768 or higher-resolution display2.9 User Requirements This software has been designed keeping in view the requirements and ease of the user who is finally going to use it. After all the effort put on analysis phase, I ended up with the following requirements:

Easy storage, updating, deletion and retrieval of data. No redundancy of data. Minimal traversal time. User friendly interface. Proper validations and checks for the data to be entered. Generation of certain automatic values.3. MODULAR DESCRIPTION

1. ADMINISTRATOR MODULE2. CLIENT MODULE3. PROVIDER MODULE4. EMPLOYEE MODULE5. ADVERTISOR MODULE

TABLE RESERVATION SYSTEM is a computerized, online solution to the various problems faced by Users/Clients (may be a Company) wishing to outsource their software development work to a Provider at an economical cost, thus achieving high performance, accuracy, reliability and high speed of data retrieval.

In this system, there is a registration process each for the Client and the Provider. Once The Administrator of the site verifies the Provider after his registration and if satisfied, assigns him an ID and password. The provider can use this ID and password to login into the website. Similarly, once the Clients have registered themselves, they can post the projects they wish to get developed. Different registered Providers can then view these projects and post their biddings in response. The Clients, after viewing these biddings, can assign the software development work to a particular Provider, best suitable to their needs and budget.

In addition to the user friendliness and easiness to access and input data into the system, the system will be available all over the world through the internet facility and anyone from anywhere can access this application.

From a programmer point of view the objective of the work done by me in the stated application is to make the whole system Object Oriented. Starting with the first step up to the final line of code I wrote, I will try to make the system Object Oriented.

DETAILED ANALYSIS OF MODULES

1. ADMINISTRATOR MODULE:-

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

2. CLIENT MODULE:-

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

3. PROVIDER MODULE:-

Manage Personal details: This service provides the user to check personal details. Deal With Client: This service provides the user to place bidding, view projects, and do chat with client through message dashboard. Deal With Employee: This service provides the user to manage the employee designation, manage employee, and do chat with employee through message dashboard. Provider: Using this service provider can change password and can do logout. 4. EMPLOYEE MODULE:- Manage Personal Details: This service provides employee to check their personal details and can edit also. Deal With Provider: This service provides employee to check assigned projects and can chat with employee through message dashboard. Employee: In this service employee can logout and can change password.5. ADVERTISER MODULE:- Manage Personal Details: This service provides advertiser to check their personal details and can edit it. Manage Advertisement: This service provides advertiser to add advertisements. Advertisement: In this service advertiser can change password and can logout.

PROJECT UNDERTAKEN

1. The .net frameworkA frame work is commonly though of as a set of class libraries that aid in the development of applications. The .net framework is more than just a set of classes. The .net framework is targeted by compliers using a wide variety of applications. Including everything from small components that run on handheld devices to large Microsoft ASP.NET application that span web farms, where multiple web serves act together to improve the performance fault tolerance of a web site. The .NET framework is responsible for providing a basic platform that these applications can shack are. This basic platform includes a runtimes set of services that oversee the execution of applications. A key responsibility of the runtime is to manage execution so that software written by different programming languages uses classes and other types safely.

Microsoft .net framework architectureMicrosoft's .NET Framework is comprised of two main components - the Common Language Runtime (CLR) and the .NET Framework class libraries. The CLR is the real foundation of the .NET Framework. It is the execution engine for all .NET applications. Every target computer requires the CLR to successfully run a .NET application that uses the .NET Framework. The main features of CLR include: Automatic Memory Management Thread Management Code Compilation & Execution Code Verification High level of security Remoting Structured Exception Handling Interoperability between Managed and Unmanaged code. Integration with Microsoft Office System

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

Fig5.1: .Net architecture

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.Server-side cachingASP.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.21.2 Common Language SpecificationTo fully interact with other objects regardless of the language they were implemented in, objects must expose to callers only those features that are common to all the languages they must interoperate with. For this reason, the Common Language Specification (CLS), which is a set of basic language features needed by many applications, has been defined. The CLS rules define a subset of the Common Type System; that is, all the rules that apply to the common type system apply to the CLS, except where stricter rules are defined in the CLS. The CLS helps enhance and ensure language interoperability by defining a set of features that developer can rely on to be available in a wide variety of languages. The CLS also establishes requirements for CLS compliance; these help you determine whether your managed code conforms to the CLS and to what extent a given tool supports the development of managed code that uses CLS features.

If your component uses only CLS features in the API that it exposes to other code (including derived classes), the component is guaranteed to be accessible from any programming language that supports the CLS. Components that adhere to the CLS rules and use only the features included in the CLS are said to be CLS-compliant components. The CLS was designed to be large enough to include the language constructs that are commonly needed by developers, yet small enough that most languages are able to support it. In addition, any language constructs that makes it impossible to rapidly verify the type safety of code was excluded from the CLS so that all CLS-compliant languages can produce verifiable code if they choose to do so

1.3 Common Language Runtime The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. The CLR runs a form of byte code called the Microsoft Intermediate Language (MSIL), Microsoft's implementation of the Common Intermediate Language.

Developers using the CLR write code in a high level language such as C# or VB.Net. At compile-time, a .NET compiler converts such code into MSIL (Microsoft Intermediate Language) code. At runtime, the CLR's just-in-time compiler (JIT compiler) converts the MSIL code into code native to the operating system. Alternatively, the MSIL code can be compiled to native code in a separate step prior to runtime. This speeds up all later runs of the software as the MSIL-to-native compilation is no longer necessary.

Fig5.3: CLR ArchitectureAlthough some other implementations of the Common Language Infrastructure run on non-Windows operating systems, the CLR runs on Microsoft Windows operating systems. The virtual machine aspect of the CLR allows programmers to ignore many details of the specific CPU that will execute the program. The CLR also provides other important services, including the following:Memory managementThread managementException handlingGarbage collectionSecurityIntroduction to Microsoft SQL ServerMicrosoft SQL Server enhances the performance, reliability, and scalability provided by earlier releases of SQL Server by making the processes of developing applications, managing systems, and replicating data easier than ever.All of data processing is involved with the operations of storing and retrieving data. A database, such as Microsoft SQL Server, is designed as the central repository for all the data of an organization. The crucial nature of data to any organization underlines the importance of the method used to store it and enable its later retrieval.Microsoft SQL Server uses features similar to those found in other databases and some features that are unique. Most of these additional features are made possible by SQL Servers tight integration with the Windows XP operating system. SQL Server contains the data storage options and the capability to store and process the same volume of data as a mainframe or minicomputer. Like most mainframe or minicomputer databases, SQL Server is a Database that has seen an evolution from its introduction in the mid-1960s until today. Microsofts SQL Server is founded in the mature and powerful relational model, currently the preferred model for data storage and retrieval.

Fig5.4: SQL Server Architecture

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

DESIGN PHASE

The most creative and challenging phase of SDLC is system design. The design of the system will produce the details that state how a system will meet requirements identified during the system analysis. Design Features1. Design describes the final system and the process by which it is developed.1. It refers to the technical specifications that will be applied in implementing the candidate system.1. It includes architectural design, module design, detail design.1. 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.1. The extent to which the design is secure against the human error and machine malfunction.1. 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 DesignIt 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 DesignIt 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 DiagramDataflow 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 :

ProjectOnizerUserFig-2Fig-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

LoginUserUsers TableLogin DetailsView User DetailsUsers DetailsPerforms various actionsFig-3Fig-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

AdminManage Various SettingsProject DetailsProviderSITECLIENT / USERRegisterBuild ProjectPaymentAssign ProjectVerifies Provider and Assigns ID and PasswordPost ProjectsView and Bid on 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 DesignThe 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 our project.

Designing of Web Pages

DEVELOPMENT PHASETime to build your website! This is where all the hard work put into the design phase pays off. Following your design, carefully assemble the project. Do this one piece at a time, testing as you go. Be sure to set time aside in your schedule. Start early and work often. Sometimes the simplest task takes the most time to complete. For some projects, programming will be minimal. Those folks will have their hands full scanning images, recording sounds, and pulling the whole kit-and-caboodle together. For other projects, coding will represent a significant part of the whole. SOURCE CODE:1. Admin Panel :-

1.1 Admin Country Form:-using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;

public partial class Administrator_Countryfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindLstCountryDetails(); } } protected void lkbtnInsert_Click(object sender, EventArgs e) { pc.CountryInsert(txtCountryName.Text); BindLstCountryDetails(); ClearControls(); } protected void lkbtnUpdate_Click(object sender, EventArgs e) { pc.CountryUpdate(Convert.ToInt32(lstCountryDetails.SelectedValue), txtCountryName.Text); BindLstCountryDetails(); ClearControls(); } protected void lkbtnDelete_Click(object sender, EventArgs e) { pc.CountryDelete(Convert.ToInt32(lstCountryDetails.SelectedValue)); BindLstCountryDetails(); ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void lstCountryDetails_SelectedIndexChanged(object sender, EventArgs e) {

var result = pc.CountryFind(Convert.ToInt32(lstCountryDetails.SelectedValue)).SingleOrDefault(); txtCountryName.Text = result.CountryName;

} private void BindLstCountryDetails() { lstCountryDetails.DataTextField = "CountryName"; lstCountryDetails.DataValueField = "CountryId";

lstCountryDetails.DataSource = pc.CountryDisplay(); lstCountryDetails.DataBind(); } private void ClearControls() { txtCountryName.Text = ""; txtCountryName.Focus(); }

}

1.2 Admin State Form :-

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

public partial class Administrator_Statefrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDdlCountryName(); BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue)); } }

protected void lkbtnInsert_Click(object sender, EventArgs e) { pc.StateInsert(txtStateName.Text, Convert.ToInt32(ddlCountryName.SelectedValue)); BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue)); ClearControls(); }

protected void lkbtnUpdate_Click(object sender, EventArgs e) { pc.StateUpdate(Convert.ToInt32(lstStateDetails.SelectedValue), txtStateName.Text); BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue)); ClearControls();

}

protected void lkbtnDelete_Click(object sender, EventArgs e) { pc.StateDelete(Convert.ToInt32(lstStateDetails.SelectedValue)); BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue)); ClearControls(); }

protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); }

protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); BindLstStateDetails(Convert.ToInt32(ddlCountryName.SelectedValue)); }

protected void lstStateDetails_SelectedIndexChanged(object sender, EventArgs e) { txtStateName.Text = pc.StateFind(Convert.ToInt32(lstStateDetails.SelectedValue)).SingleOrDefault().StateName; }

private void BindDdlCountryName() { ddlCountryName.DataTextField = "CountryName"; ddlCountryName.DataValueField = "CountryId";

ddlCountryName.DataSource = pc.CountryDisplay(); ddlCountryName.DataBind(); }

private void BindLstStateDetails(int StateCountryId) { lstStateDetails.DataTextField = "StateName"; lstStateDetails.DataValueField = "StateId";

lstStateDetails.DataSource = pc.StateDisplayByStateCountryId(Convert.ToInt32(ddlCountryName.SelectedValue)); lstStateDetails.DataBind(); }

private void ClearControls() { txtStateName.Text = ""; txtStateName.Focus(); } 1.3 Admin City Form :-

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

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

protected void lkbtnInsert_Click(object sender, EventArgs e) { string CityName = txtCityName.Text; int CityStateId = Convert.ToInt32(ddlStateName.SelectedValue); pc.CityInsert(CityName,CityStateId); BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue)); ClearControls(); }

protected void lkbtnUpdate_Click(object sender, EventArgs e) { int CityId = Convert.ToInt32(lstCityDetails.SelectedValue); string CityName = txtCityName.Text; int CityStateId = Convert.ToInt32(ddlStateName.SelectedValue); pc.CityUpdate(CityId, CityName); BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue)); ClearControls(); }

protected void lkbtnDelete_Click(object sender, EventArgs e) { int CityId = Convert.ToInt32(lstCityDetails.SelectedValue); pc.CityDelete(CityId); BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue)); ClearControls(); }

protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); }

protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue)); BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue)); }

protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); BindLstCityDetails(Convert.ToInt32(ddlStateName.SelectedValue)); }

protected void lstCityDetails_SelectedIndexChanged(object sender, EventArgs e) { int CityId = Convert.ToInt32(lstCityDetails.SelectedValue); var result = pc.CityFind(CityId).SingleOrDefault(); txtCityName.Text = result.CityName; }

private void BindDdlCountryName() { ddlCountryName.DataTextField = "CountryName"; ddlCountryName.DataValueField = "CountryId";

ddlCountryName.DataSource = pc.CountryDisplay(); ddlCountryName.DataBind(); }

private void BindDdlStateName(int StateCountryId) { int NewStateCountryId = StateCountryId; ddlStateName.DataTextField = "StateName"; ddlStateName.DataValueField = "StateId";

ddlStateName.DataSource = pc.StateDisplayByStateCountryId(NewStateCountryId); ddlStateName.DataBind(); }

private void BindLstCityDetails(int CityStateId) { int NCityStateId = CityStateId; lstCityDetails.DataTextField = "CityName"; lstCityDetails.DataValueField = "CityId";

lstCityDetails.DataSource = pc.CityDisplayByCityStateId(NCityStateId); lstCityDetails.DataBind(); }

private void ClearControls() { txtCityName.Text = ""; txtCityName.Focus(); } }1.4 Admin BackEnd Form :- using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;

public partial class Administrator_BackEndfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindLstBackEndDetails(); } } protected void lkbtnInsert_Click(object sender, EventArgs e) { string BackEndName = txtBackEndName.Text; pc.BackEndInsert(BackEndName); BindLstBackEndDetails(); ClearControls(); } protected void lkbtnUpdate_Click(object sender, EventArgs e) { int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue); string BackEndName = txtBackEndName.Text; pc.BackEndUpdate(BackEndId, BackEndName); BindLstBackEndDetails(); ClearControls(); } protected void lkbtnDelete_Click(object sender, EventArgs e) { int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue); pc.BackEndDelete(BackEndId); BindLstBackEndDetails(); ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void lstBackEndDetails_SelectedIndexChanged(object sender, EventArgs e) { int BackEndId = Convert.ToInt32(lstBackEndDetails.SelectedValue); var result = pc.BackEndFind(BackEndId).SingleOrDefault();; txtBackEndName.Text = result.BackEndName;

} private void BindLstBackEndDetails() { lstBackEndDetails.DataTextField = "BackEndName"; lstBackEndDetails.DataValueField = "BackEndId";

lstBackEndDetails.DataSource = pc.BackEndDisplay(); lstBackEndDetails.DataBind(); } private void ClearControls() { txtBackEndName.Text = ""; txtBackEndName.Focus(); }}

1.5 Admin FrontEnd Form :-

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

public partial class Administrator_FrontEndfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindLstFrontEndDetails(); } } protected void lkbtnInsert_Click(object sender, EventArgs e) { string FrontEndName = txtFrontEndName.Text; pc.FrontEndInsert(FrontEndName); BindLstFrontEndDetails(); ClearControls(); } protected void lkbtnUpdate_Click(object sender, EventArgs e) { int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue); string FrontEndName = txtFrontEndName.Text; pc.FrontEndUpdate(FrontEndId, FrontEndName); BindLstFrontEndDetails(); ClearControls(); } protected void lkbtnDelete_Click(object sender, EventArgs e) { int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue); pc.FrontEndDelete(FrontEndId); BindLstFrontEndDetails(); ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void lstFrontEndDetails_SelectedIndexChanged(object sender, EventArgs e) { int FrontEndId = Convert.ToInt32(lstFrontEndDetails.SelectedValue); var result = pc.FrontEndFind(FrontEndId).SingleOrDefault(); txtFrontEndName.Text = result.FrontEndName; } private void BindLstFrontEndDetails() { lstFrontEndDetails.DataTextField = "FrontEndName"; lstFrontEndDetails.DataValueField = "FrontEndId";

lstFrontEndDetails.DataSource = pc.FrontEndDisplay(); lstFrontEndDetails.DataBind(); } private void ClearControls() { txtFrontEndName.Text = ""; txtFrontEndName.Focus(); }}1.6 Admin Company Type Form:-

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

public partial class Administrator_CompanyTypefrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindLstCompanyTypeDetails(); } } protected void lkbtnInsert_Click(object sender, EventArgs e) { string CompanyTypeName = txtCompanyTypeName.Text; pc.CompanyTypeInsert(CompanyTypeName); BindLstCompanyTypeDetails(); ClearControls(); } protected void lkbtnUpdate_Click(object sender, EventArgs e) { int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue); string CompanyTypeName = txtCompanyTypeName.Text; pc.CompanyTypeUpdate(CompanyTypeId, CompanyTypeName); BindLstCompanyTypeDetails(); ClearControls(); } protected void lkbtnDelete_Click(object sender, EventArgs e) { int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue); pc.CompanyTypeDelete(CompanyTypeId); BindLstCompanyTypeDetails(); ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void lstCompanyTypeDetails_SelectedIndexChanged(object sender, EventArgs e) { int CompanyTypeId = Convert.ToInt32(lstCompanyTypeDetails.SelectedValue); var result = pc.CompanyTypeFind(CompanyTypeId).SingleOrDefault(); txtCompanyTypeName.Text = result.CompanyTypeName; } private void BindLstCompanyTypeDetails() { lstCompanyTypeDetails.DataTextField = "CompanyTypeName"; lstCompanyTypeDetails.DataValueField = "CompanyTypeId";

lstCompanyTypeDetails.DataSource = pc.CompanyTypeDisplay(); lstCompanyTypeDetails.DataBind(); } private void ClearControls() { txtCompanyTypeName.Text = ""; txtCompanyTypeName.Focus(); }

}

1.7 Admin Technology Form :-

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

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

lstTechnologyDetails.DataSource = pc.TechnologyDisplay(); lstTechnologyDetails.DataBind(); } private void ClearControls() { txtTechnologyName.Text = ""; txtTechnologyName.Focus(); }}1.8 Admin Project Type Form :- using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;

public partial class Administrator_ProjectTypefrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindLstProjectTypeDetails(); } } protected void lkbtnInsert_Click(object sender, EventArgs e) { string ProjectTypeName = txtProjectTypeName.Text; pc.ProjectTypeInsert(ProjectTypeName); BindLstProjectTypeDetails(); ClearControls(); } protected void lkbtnUpdate_Click(object sender, EventArgs e) { int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue); string ProjectTypeName = txtProjectTypeName.Text; pc.ProjectTypeUpdate(ProjectTypeId, ProjectTypeName); BindLstProjectTypeDetails(); ClearControls(); } protected void lkbtnDelete_Click(object sender, EventArgs e) { int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue); pc.ProjectTypeDelete(ProjectTypeId); BindLstProjectTypeDetails(); ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void lstProjectTypeDetails_SelectedIndexChanged(object sender, EventArgs e) { int ProjectTypeId = Convert.ToInt32(lstProjectTypeDetails.SelectedValue); var result= pc.ProjectTypeFind(ProjectTypeId).SingleOrDefault(); txtProjectTypeName.Text = result.ProjectTypeName;

} private void BindLstProjectTypeDetails() { lstProjectTypeDetails.DataTextField = "ProjectTypeName"; lstProjectTypeDetails.DataValueField = "ProjectTypeId";

lstProjectTypeDetails.DataSource = pc.ProjectTypeDisplay(); lstProjectTypeDetails.DataBind(); } private void ClearControls() { txtProjectTypeName.Text = ""; txtProjectTypeName.Focus(); }}

1.9 Admin Add Faq Form :-

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

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

private void BindDataList() { DataList1.DataSource = pc.FaqDisplay(); DataList1.DataBind(); }

private void ClearControls() { txtQuestion.Text = ""; txtAnswer.Text = ""; }

protected void DataList1_SelectedIndexChanged(object sender, EventArgs e) { int FaqId = Convert.ToInt32(DataList1.DataKeys[DataList1.SelectedIndex]); var result = pc.FaqDisplayByFaqId(FaqId).SingleOrDefault(); txtQuestion.Text = result.FaqQuestion; txtAnswer.Text = result.FaqAnswer; }

protected void LinkButton1_Click(object sender, EventArgs e) { string FaqQuestion = txtQuestion.Text; string FaqAnswer = txtAnswer.Text; pc.FaqInsert(FaqQuestion,FaqAnswer); BindDataList(); ClearControls(); } protected void LinkButton2_Click(object sender, EventArgs e) { int FaqId = Convert.ToInt32(DataList1.DataKeys[DataList1.SelectedIndex]); string FaqQuestion = txtQuestion.Text; string FaqAnswer = txtAnswer.Text; pc.FaqUpdate(FaqId, FaqQuestion, FaqAnswer);

Response.Write("Updated Successfully"); BindDataList(); ClearControls(); }}

1.10 Admin 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(ProviderId).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).SingleOrDefault().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("[email protected]"); 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 ("[email protected]", "freelancing"); //Or your Smtp Email ID and Password smtp.EnableSsl = true; smtp.Send(mail);

ClearControls(); } private void ClearControls() { txtUsername.Text = ""; txtPassword.Text = ""; txtReason.Text = ""; ddlProviderName.SelectedIndex = 0; FormView1.Visible = false; GridView1.Visible = false; } protected void lkbtnCancel_Click(object sender, EventArgs e) { ClearControls(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; BindGridView(Convert.ToInt32(ddlProviderName.SelectedValue)); }}

1.11 Admin Verify Advertiser :-

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Net.Mail;

public partial class Administrator_VerifyAdvertiserfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();

static string CityName = "";

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDdlAdvertiserName(); } } private void BindDdlAdvertiserName() { ddlAdvertiserName.DataTextField = "AdvertiserCompanyName"; ddlAdvertiserName.DataValueField = "AdvertiserId";

ddlAdvertiserName.DataSource = pc.AdvertiserDisplay(); ddlAdvertiserName.DataBind(); } protected void ddlAdvertiserName_SelectedIndexChanged(object sender, EventArgs e) { if (ddlAdvertiserName.SelectedValue != "0") { BindFormView(Convert.ToInt32(ddlAdvertiserName.SelectedValue)); BindGridView(Convert.ToInt32(ddlAdvertiserName.SelectedValue)); } } private void BindFormView(int AdvertiserId) { CityName = pc.AdvertiserCompanyCityNameByAdvertiserCompanyCityId(AdvertiserId, pc.AdvertiserFind(AdvertiserId).SingleOrDefault().AdvertiserCompanyCityId).SingleOrDefault().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),GridView1.DataKeys[i][0].ToString(),"Accepted"); } else { pc.AdvertiserAdUpdateStatus(Convert.ToInt32(ddlAdvertiserName.SelectedValue), GridView1.DataKeys[i][0].ToString(), "Rejected"); } } ClearControls(); } protected void lkbtnCancel_Click(object sender, EventArgs e) {

} protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; BindGridView(Convert.ToInt32(ddlAdvertiserName.SelectedValue)); } private void ClearControls() { ddlAdvertiserName.SelectedIndex = 0; FormView1.Visible = false; GridView1.Visible = false;

}2. Advertiser Panel :-

2.1 Advertiser Add Advertisement Form :-

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

public partial class Advertiser_AdvertiserAdfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();

static int rowindex = 0; protected void Page_Load(object sender, EventArgs e) {

cmpStartDate.ValueToCompare = DateTime.Now.ToString("d"); if (!IsPostBack) { DataTable dtable = new DataTable("AdvertiserAdTable"); dtable.Columns.Add(new DataColumn("AdvertiserAdImage", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdNavigateUrl", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdKeyword", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdImpressions", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdStartDate", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdEndDate", Type.GetType("System.String"))); dtable.Columns.Add(new DataColumn("AdvertiserAdAmount", Type.GetType("System.String")));

ViewState["AdvertiserAdTable"] = dtable; } } protected void lkbtnSubmit_Click(object sender, EventArgs e) { for (int i = 0; i < GridView1.Rows.Count; i++) { pc.AdvertiserAdInsert((GridView1.Rows[i].FindControl("lblImage") as Label).Text, (GridView1.Rows[i].FindControl("lblNavigateUrl") as Label).Text, (GridView1.Rows[i].FindControl("lblKeyword") as Label).Text, Convert.ToInt32((GridView1.Rows[i].FindControl("lblImpressions") as Label).Text), (GridView1.Rows[i].FindControl("lblStartDate") as Label).Text, (GridView1.Rows[i].FindControl("lblEndDate") as Label).Text, (GridView1.Rows[i].FindControl("lblAmount") as Label).Text, "Not Active", Convert.ToInt32(pc.AdvertiserIdentity()) ); }

if (GridView1.Rows.Count > 0) { DataTable questiontable = (DataTable)ViewState["AdvertiserAdTable"]; questiontable.Rows.Clear(); GridView1.DataSource = questiontable; GridView1.DataBind(); }

}

protected void lkbtnAdd_Click(object sender, EventArgs e) { DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];

if (lkbtnAdd.Text == "Add") { DataRow drow = dtable.NewRow(); drow[0] = fuAdvertiserAdImage.FileName; drow[1] = txtAdvertiserAdNavigateUrl.Text; drow[2] = ddlAdvertiserAdKeyword.SelectedValue; drow[3] = txtAdvertiserAdImpressions.Text; drow[4] = txtAdvertiserAdStartDate.Text; drow[5] = txtAdvertiserAdEndDate.Text; drow[6] = txtAdvertiserAdAmount.Text;

dtable.Rows.Add(drow);

GridView1.DataSource = dtable; GridView1.DataBind(); if (fuAdvertiserAdImage.FileName.Length > 0) { string path = Server.MapPath("."); int indx = path.LastIndexOf("\\"); path = path.Substring(0, indx + 1); path = path + "AdvertiserAds\\"; fuAdvertiserAdImage.SaveAs(path + fuAdvertiserAdImage.FileName); }

} if (lkbtnAdd.Text == "Update") { string Image = ""; if (fuAdvertiserAdImage.FileName.Length == 0) { Image = dtable.Rows[rowindex][0].ToString(); } else { Image = fuAdvertiserAdImage.FileName; fuAdvertiserAdImage.SaveAs(Server.MapPath("AdvertiserAds/") + fuAdvertiserAdImage.FileName); }

dtable.Rows[rowindex][0] = Image; dtable.Rows[rowindex][1] = txtAdvertiserAdNavigateUrl.Text; dtable.Rows[rowindex][2] = ddlAdvertiserAdKeyword.SelectedValue; dtable.Rows[rowindex][3] = txtAdvertiserAdImpressions.Text; dtable.Rows[rowindex][4] = txtAdvertiserAdStartDate.Text; dtable.Rows[rowindex][5] = txtAdvertiserAdEndDate.Text; dtable.Rows[rowindex][6] = txtAdvertiserAdAmount.Text;

BindGridView();

lkbtnAdd.Text = "Add"; } ClearAdvertiserAdControls(); }

private void BindGridView() { DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"]; GridView1.DataSource = dtable; GridView1.DataBind(); }

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { rowindex = e.NewEditIndex;

DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"];

txtAdvertiserAdNavigateUrl.Text = dtable.Rows[e.NewEditIndex][1].ToString(); txtAdvertiserAdImpressions.Text = dtable.Rows[e.NewEditIndex][3].ToString(); txtAdvertiserAdStartDate.Text = dtable.Rows[e.NewEditIndex][4].ToString(); txtAdvertiserAdEndDate.Text = dtable.Rows[e.NewEditIndex][5].ToString(); txtAdvertiserAdAmount.Text = dtable.Rows[e.NewEditIndex][6].ToString(); ddlAdvertiserAdKeyword.SelectedIndex = 0;

lkbtnAdd.Text = "Update";

} protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView1.EditIndex = -1; BindGridView(); } protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { DataTable dtable = (DataTable)ViewState["AdvertiserAdTable"]; dtable.Rows.RemoveAt(e.RowIndex); BindGridView(); } private void ClearAdvertiserAdControls() { txtAdvertiserAdNavigateUrl.Text = ""; txtAdvertiserAdImpressions.Text = ""; txtAdvertiserAdStartDate.Text = ""; txtAdvertiserAdEndDate.Text = ""; txtAdvertiserAdAmount.Text = "";ddlAdvertiserAdKeyword.SelectedIndex = 0; }

2.2 Advertiser Sign Out Form :-

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

public partial class Advertiser_AdvertiserSignOutfrm : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { FormsAuthentication.SignOut(); Response.Redirect("../Homefrm.aspx"); }}

3. Provider Panel :-

3.1 View Project Detail :-

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

public partial class Provider_ViewProjectDetailsfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) BindDetailsView(); BindGridView(Convert.ToInt32(Session["prjid"])); } private void BindDetailsView() { DetailsView1.DataSource = pc.AddProjectFind(Convert.ToInt32(Session["prjid"])); DetailsView1.DataBind(); } protected void lkbtnSubmit_Click(object sender, EventArgs e) { if (fuAttachment.FileName.Length > 0) { string path = Server.MapPath("."); int indx = path.LastIndexOf("\\"); path = path.Substring(0, indx + 1); path = path + "ProviderProjectFiles\\"; fuAttachment.SaveAs(path + fuAttachment.FileName + "_" + Session["id"]); }

panel1.Visible = false; lkbtnBidAgain.Visible = true; lkbtnBidOtherProject.Visible = true; pc.BidInsert( txtBidProposal.Text, fuAttachment.FileName, txtBidAmount.Text, ddlTimeFrame.SelectedValue, DateTime.Now.ToString(), Convert.ToInt32(Session["id"]), Convert.ToInt32(Session["prjid"]), "No" );

BindGridView(Convert.ToInt32(Session["prjid"])); } protected void lkbtnBidAgain_Click(object sender, EventArgs e) { panel1.Visible = true; lkbtnBidAgain.Visible = false; lkbtnBidOtherProject.Visible = false; txtBidAmount.Text = ""; txtBidProposal.Text = ""; } private void BindGridView(int projectid) { GridView1.DataSource = pc.BidDisplayByBidAddProjectId(projectid); GridView1.DataBind(); }}

3.2 Provider View Project Form :-

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

public partial class Provider_ProviderViewProjectfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); public Int32 sno;

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) BindGridView(); }

private void BindGridView() { GridView1.DataSource = pc.AddProjectDisplayByAwardedProjectProviderId(Convert.ToInt32(Session["id"])); GridView1.DataBind(); } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { sno = sno + 1; }

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

3.3 Provider Update Employee Form :-

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

public partial class ProviderUpdateEmployeefrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { BindDdlCountryName(); BindDdlDesignationName(); BindDdlEmployeeName(); } }

private void BindDdlCountryName() { ddlCountryName.DataTextField = "CountryName"; ddlCountryName.DataValueField = "CountryId";

ddlCountryName.DataSource = pc.CountryDisplay(); ddlCountryName.DataBind(); } private void BindDdlStateName(int StateCountryId) { ddlStateName.DataTextField = "StateName"; ddlStateName.DataValueField = "StateId";

ddlStateName.DataSource = pc.StateDisplayByStateCountryId(StateCountryId); ddlStateName.DataBind(); } private void BindDdlCityName(int CityStateId) { ddlCityName.DataTextField = "CityName"; ddlCityName.DataValueField = "CityId";

ddlCityName.DataSource = pc.CityDisplayByCityStateId(CityStateId); ddlCityName.DataBind(); } protected void ddlCountryName_SelectedIndexChanged(object sender, EventArgs e) { ddlStateName.Items.Clear(); ListItem lstitem = new ListItem("-----Select Option-----", "0"); ddlStateName.Items.Add(lstitem); ddlStateName.AppendDataBoundItems = true;

ddlCityName.Items.Clear(); ListItem lstitm = new ListItem("-----Select Option-----", "0"); ddlCityName.Items.Add(lstitm); ddlCityName.AppendDataBoundItems = true;

if (ddlCountryName.SelectedValue != "0") { BindDdlStateName(Convert.ToInt32(ddlCountryName.SelectedValue)); } else { BindDdlStateName(0); } } protected void ddlStateName_SelectedIndexChanged(object sender, EventArgs e) { ddlCityName.Items.Clear(); ListItem lstitem = new ListItem("-----Select Option-----", "0"); ddlCityName.Items.Add(lstitem); ddlCityName.AppendDataBoundItems = true;

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

lblMessage.Text = "Record Updated Successfully"; ClearControls();

} protected void ddlEmployeeName_SelectedIndexChanged(object sender, EventArgs e) { if (ddlEmployeeName.SelectedValue != "0") { var result = pc.EmployeeFind(Convert.ToInt32(ddlEmployeeName.SelectedValue)).SingleOrDefault();

txtAddress.Text = result.EmployeeAddress; ddlCountryName.SelectedIndex = 0; ddlStateName.SelectedIndex = 0; ddlCityName.SelectedIndex = 0; txtPinCode.Text = result.EmployeePinCode; txtTelephoneNo.Text = result.EmployeeTelephoneNo; txtMobileNo.Text = result.EmployeeMobileNo; txtEmailId.Text = result.EmployeeEmailId; ddlDesignationName.SelectedIndex = 0; txtRemarks.Text = result.EmployeeRemarks; } }}

3.4 Provider Place Bids :-

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

for (int i = 0; i < GridView1.Rows.Count; i++) { string status = GridView1.DataKeys[i][0].ToString();

if (status == "Awarded") { LinkButton lkbtnBid = GridView1.Rows[i].FindControl("lkbtnBid") as LinkButton; lkbtnBid.Enabled = false; } } } private void BindGridView() { GridView1.DataSource = pc.AddProjectDisplayByProviderIdAndOpenToAll(Convert.ToInt32(Session["id"]),"Yes"); GridView1.DataBind(); } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { int AddProjectId = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex][0]); Session["prjid"] = AddProjectId; Response.Redirect("ViewProjectDetailsfrm.aspx"); }}

3.5 Provider Message Board Form :- using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;

public partial class Provider_ProviderMessageBoardfrm : System.Web.UI.Page{ ProjectonizerClassesDataContext pc = new ProjectonizerClassesDataContext();

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) BindDdlProjects(); } private void BindDdlProjects() { ddlProjects.DataTextField = "AddProjectTitle"; ddlProjects.DataValueField = "AddProjectId";

ddlProjects.DataSource = pc.AddProjectDisplayByBidProviderId(Convert.ToInt32(Session["id"])); ddlProjects.DataBind(); } protected void ddlProjects_SelectedIndexChanged(object sender, EventArgs e) { DetailsView1.DataSource = pc.ClientDisplayByAddProjectId(Convert.ToInt32(ddlProjects.SelectedValue)); DetailsView1.DataBind();

string messageboardstatus = pc.BidMessageBoardStatusByBidProviderIdAndBidAddProjectId(Convert.ToInt32(Session["id"]), Convert.ToInt32(ddlProjects.SelectedValue)).SingleOrDefault().BidMessageBoardStatus;

if (messageboardstatus == "Yes") { Panel1.Visible = true; lblMessage.Visible = false; BindGridViewFirst(); BindGridViewSecond();

} else { Panel1.Visible = false; lblMessage.Visible = true; } } protected void lkbtnSubmit_Click(object sender, EventArgs e) { if (fuAttachment.FileName != "") { string path = Server.MapPath("."); int indx = path.LastIndexOf("\\"); path = path.Substring(0, indx + 1); path = path + "ProviderProjectFiles\\"; fuAttachment.SaveAs(path + fuAttachment.FileName); }

c.MessageBoardInsert(Convert.ToInt32(ddlProjects.SelectedValue),Convert.ToInt32(Session["id"]),Convert.ToInt32(DetailsView1.DataKey.Value), Session["role"].ToString(),"Client", txtMessage.Text,fuAttachment.FileName,DateTime.Now.ToString()); BindGridViewFirst(); }

private void BindGridViewFirst() { GridView1.DataSource = pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndReceiverRole( 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.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndReceiverRole( 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.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndReceiverRole( Convert.ToInt32(ddlProjectName.SelectedValue), Convert.ToInt32(Session["id"]), Session["role"].ToString(), Convert.ToInt32(ddlEmployeeName.SelectedValue), "Employee" ); GridView1.DataBind(); } private void BindGridViewSecond() { GridView2.DataSource = pc.MessageBoardDisplayByAddProjectIdAndSenderIdAndSenderRoleAndReceiverIdAndReceiverRole( Convert.ToInt32(ddlProjectName.SelectedValue), Convert.ToInt32(ddlEmployeeName.SelectedValue), "Employee", Convert.ToInt32(Session["id"]), Session["role"].ToString() ); GridView2.DataBind(); } protected void ddlProjectName_SelectedIndexChanged(object sender, EventArgs e) { BindGridViewFirst(); BindGridViewSecond(); }}

3.7 Provider Edit Profile :-

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

public static string CityName; public static string CompanyTypeName; public static int SelectedIndexCountryId; public static int SelectedIndexStateId; public static int StateCountryId; public static int CityStateId; public static int ProviderCityId;

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindFormView();

} } private void BindFormView() { if (Session["id"] != null) { CityName = pc.ProviderCityNameByProviderCityId(Convert.ToInt32(Session["id"]), pc.ProviderFind(Convert.ToInt32(Session["id"])).SingleOrDefault().ProviderCityId).SingleOrDefault().CityName;

CompanyTypeName = pc.ProviderCompanyTypeNameByProviderCompanyTypeId(Convert.ToInt32(Session["id"]), pc.ProviderFind(Convert.ToInt32(Session["id"])).SingleOrDefault().ProviderCompanyTypeId).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 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 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 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 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"]),