You are on page 1of 80

COLLEGE TO CAMPUS

A PROJECT REPORT SUBMITTED


IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR
THE DEGREE OF

MASTER IN COMPUTER APPLICATION


UNDER
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA

SUBMITTED BY

XYZ

REG. NO. 1405227002

C V RAMAN COMPUTER ACADEMY


BIDYA NAGAR, MAHURA, JANLA
BHUBANESWAR-752054

1
ODISHA

2
CERTIFICATE FROM THE ORGANIZATION IN THEIR LETTER PAD WHERE PROJECT
HAS BEEN DONE

1
C V RAMAN COMPUTER ACADEMY, BHUBANESWAR-752054

CERTIFICATE

This is to certify that xyz bearing Registration No 1405227002, a student of this

college, has completed the project work on allotted time and has submitted the
project report titled “College To Campus” in partial fulfillment of the requirements
for the award of Master in Computer Application Degree under Biju Patnaik
University of Technology, Odisha.

Internal Examiner External Examiner

2
ACKNOWLEDGEMENT

It was a great experience working on this project of “College To Campus”. I express my heartiest
gratitude towards those who were constantly involved with me during the project.”Srijan
Services” Dhanbad will always occupy a special place in my heart throughout my career.

The phenomenon remains the same that no project ever can be executed proficiently and
efficiently without sharing the meticulous ideas, technical expertise and innovative thoughts put
forwarded by the technical veterans.

Whenever a technical project is developed, eventually it requires conductive technical


environment and technical guidance to get involved in the project enthusiastically.

I am also very thankful to all the CVRCA lecturers for being extremely supportive, friendly and
cooperative during the entire course of project. Their continuous support made the project much
easy.

3
Xyzl

ABSTRACT

“College to Campus” is a web portal for student placement cell of a college which creates an
interface between college and industry (employer).

It keeps details of :
1. Students
2. Colleges
3. Industry

The project would help us in effective and systematic record keeping i.e. storing and retrieving of
useful data. Project will be able to give the report so that industry and colleges can make
decisions on basis of those reports. Colleges can register their students, the students will upload
their documents which later on will be verified by the college so that the recruiters can avail
information of only the verified students. It also provides the users with all the necessary
privileges to access and modify the data intended for them.
It doesn‘t entirely replace the existing system but it mostly automates the recruitment process and
all the data used.

4
CONTENTS

1 Section1
Subsection 1 page no
Subsection 2
1.2.1 Subsubsection 1 page no
1.2.2 Subsubsection 2 page no
Subsection 3
2 Section 2
Subsection 1
2.1.1 Subsubsection 1 page no
Subsection 2
2.2.1 Subsubsection 2 page no
3 Section 3
3.1 Section 1 page no
4 Conclusion page no
References page no

5
LIST OF FIGURES

1 Name of Figure 1 page no


2 Name of Figure 2 page no
3 Name of Figure 3 page no
4 Name of Figure 4 page no
5 Name of Figure 5 page no
6 Name of Figure 6 page no
7 Name of Figure 7 page no

6
LIST OF TABLES

1 Portal Login page no


2 College Login page no
3 College Master page no
4 Name of Table 4 page no
5 Name of Table 5 page no
6 Name of Table 6 page no
7 Name of Table 7 page no

7
INTRODUCTION

1.1 About Project

This online placement portal is a web application built in .Net. It provides colleges the ability to
register their students to this application and students are required to fill in their information and
upload their documents which are later on verified by the college. The colleges, students and the
companies can manage their accounts. Each student will have their own account with their own
home page .On the other hand companies that are willing to publish the jobs for their company to
students can register to the placement portal and get their own account created and can contact
their desired colleges about their requirement and the college will communicate to their students
about the requirement.
Registered companies can add or remove jobs and these jobs can be seen by various colleges
and they can contact the company person for the job. Main aim of this web application is to make
a good web application that can make this job search option easy and accessible to all colleges
who are interested.

1.2 Modules
The main stakeholders of this system are:
1. Admin.
2. Colleges.
3. Companies.
4. Students.
This system enables the recruiting company to login to the system and create a vacancy and post
it on the web. The recruiting company can associate college with a vacancy. This system enables
the colleges to login, to view all the vacancies. The college can register their students and
students can create a profile. College will verify the documents uploaded by the students so the
industry could get list of authentic and verified students.

8
.

Requirement Analysis

Systems analysis is the study of sets of interacting entities, including computer systems analysis.
This field is closely related to operations research. It is also "an explicit formal inquiry carried
out to help someone (referred to as the decision maker) identify a better course of action and
make a better decision than he might otherwise have made."Analysis is defined as the procedure
by which we break down an intellectual or substantial whole into parts so that we can achieve our
end goals. The development of a computer-based information system includes a system analysis
phase which produces or enhances the-
datamodel which itself is a precursor to creating or enhancing a database.

There are a number of different approaches to system analysis. When a computer-based


information system is developed, systems analysis would constitute the following steps:

1. The development of a feasibility study, involving determining whether a project is


economically, socially, technologically and organizationally feasible.

2. Conducting fact-finding measures, designed to ascertain the requirements of the system's end-
users. These typically span interviews, questionnaires, or visual observations of work on the
existing system.

3. Gauging how the end-users would operate the system (in terms of general experience in using
computer hardware or software), what the system would be used for etc.

Another view outlines a phased approach to the process. This approach breaks systems analysis
into 5 phases:

1. Scope definition
2. Problem analysis
3. Requirements analysis
4. Logical design
5. Decision analysis

Use cases are a widely-used system analysis modeling tool for identifying and expressing the
functional requirements of a system. Each use case is a business scenario or event for which the
system must provide a defined response. Use cases evolved out of object-oriented analysis.

2.1 Requirement specification

9
Information gathering is usually the first phase of the software development project. The purpose
of this phase is to identify and document the exact requirements for the system. The user‘s
request identifies the need for a new information system and on investigation re-define the new
problem to be based on MIS, which supports management. The objective is to determine whether
the request is valid and feasible before a recommendation is made to build a new or existing
manual system continues. The major steps are -

1. Defining the user requirements.


2. Studying the present system to verify the problem.
3. Defining the performance expected by the candidate to use requirements.

2.2 Hardware Specification

 Processor : Intel Dual Core or above


 Speed : 1.6 GHZ or above
 RAM : 2 GB for Windows 7
10GMB for Windows 8
 HARD DISK : 500MB of free disk space
 KEY BOARD : Standard

2.2 Software Specification

 Operating system : Windows 8 / Windows xp


 Language : C#.NET
 Database : Oracle, ADO .NET

2.3 Programming Language

2.3.1 .Net
For better performance and reliable user applications Microsoft has evolved .NET in
August, 2001. This was .NET version 1.0.
After adding so many features it became extensible and the current version is .NET V2.0.
It was realized in August 2008. It supports operating systems such as:
 Windows 8
 Win XP –SP4
 Windows Vista.
 It requires 2GB RAM, but 4 GB RAM is used for optimum performance.

10
2.3.2 Features of .Net

 .NET is a Platform
 .NET Framework is a tool which consists of namespaces.(Namespaces are the
big containers which consists of classes , structures ,delegates, interfaces etc)

2.3.3 C#

 Using C # is the quickest and easiest way to create powerful, full-featured


applications that take advantage of the graphical user interface in WINDOWS.
 Its intuitive interface makes C# .NET an excellent tool for programming.
 New users benefit from mouse operations and a consistent look and feel, more
advanced users benefit from easy to use features, such as drop-down list boxes and
multiple windows applications.
 C#.NET application can be combined with ADO.NET to provide database
connectivity to a larger extent.

2.3.4 ADO.Net

ADO.NET is a set of classes for working with data. It provides


 An evolutionary, more flexible successor to ADO.
 A system designed for disconnected environments.
 A programming model with advanced XML support.
 A set of classes, interfaces, structures and enumerations that manage data access from
within the .NET framework.

11
SYSTEM DESIGN

4.1 Introduction

After the analysis phase we have with us the details of the existing system and the requirements
of the user for the new system. This phase diverts focus from the problem domain to the solution
domain. It acts as a bridge between the requirement phase and its solution. The design phase
focuses on the detailed implementation of the system recommended in the feasibility study.
Systems design is the process or art of defining the architecture, components, modules, interfaces,
and data for a system to satisfy specified requirements. There is some overlap with the disciplines
of systems analysis, systems architecture and systems engineering. Object-oriented analysis and
design (OOAD) methods are becoming the most widely used methods for computer system
design. The UML has become the standard language used in Object-oriented analysis and design.
It is widely used for modeling software systems and is increasingly used for high designing non-
software systems and organizations.
The External Design
External design consists of conceiving, planning out and specifying the externally observable
characteristics of the software product. These characteristics include user displays or user
interface forms and the report formats, external data sources and the functional characteristics,
performance requirements etc. External design begins during the analysis phase and continues
into the design phase.

Logicaldesign
The logical design of a system pertains to an abstract representation of the data flows, inputs and
outputs of the system. This is often conducted via modeling, which involves a simplistic (and
sometimes graphical) representation of an actual system. In the context of systems design,
modeling can undertake the following forms, including:

1. Data flow diagrams


2. Entity Life Histories
3. Entity Relationship Diagrams

Physicaldesign

The physical design relates to the actual input and output processes of the system. This is laid
down in terms of how data is input into a system, how it is verified/ authenticated, how it is
processed, and how it is displayed as output. Physical design, in this context, does not refer to the
tangible physical design of an information system. To use an analogy, a personal computer's
physical design involves input via a keyboard, processing within the CPU, and output via a

12
monitor, printer, etc. It would not concern the actual layout of the tangible hardware, which for a
PC would be a monitor, CPU, motherboard, hard drive, modems, video/graphics cards, USB
slots, etc.

Design Methodology: Rapid Application Development (RAD)

Rapid Application Development (RAD) is a methodology in which a systems designer produces


prototypes for an end-user. The end-user reviews the prototype, and offers feedback on its
suitability. This process is repeated until the end-user is satisfied with the final system. It is
widely used for modeling software systems and is increasingly used for high designing non-
software systems and organizations.

4.2. UML Diagrams

Use cases of Admin:

Manages
Profile

Manage
Colleges

Manage
Companies

View
Student List

13
Use cases of College:

Manages
Profile

Register
Students

View
Companies

Communicate
to companies
& students

14
Use cases of Company:

Manage
Profile

View
Colleges

View
Students

Communicate
to colleges

15
Use cases of Student:

Manage
Profile

Upload
Documents

View
Messages

16
Table Name: Portal_Login
Primary Key: LoginId
Description: To keep details of portal_admin

S. No. Field Name Data Type/Size Constraints Description


1 LoginId Number(38) Not Null Login Id of admin
2 LoginName Varchar2(20) Not Null User name for admin
3 Password Varchar2(15) Password of user
4 Status Number(38) Activate/Deactivate user
5 Description Varchar2(200)

Table Name: CollegeType_Master


Primary Key: CollegeTypeId
Description: To keep details of college type.

S. No. Field Name Data Type/Size Constraints Description


1 CollegeTypeId Number(38)
2 CollegeTypeName Varchar2(100)
3 Description Varchar2(200)

Table Name: Course_Master


Primary Key: CourseId
Description: To keep details of courses

S. No. Field Name Data Type/Size Constraints Description


1 CourseId Number(38) Not Null
2 CourseName Varchar2(100)
3 Description Varchar2(200)

17
Table Name: College_Master
Primary Key: CollegeId
Description: To keep details of colleges

S. No. Field Name Data Type/Size Constraints Description


1 CollegeID Number(38) Not Null Login Id of college
2 CollegeName Varchar2(20) Not Null Stores college name
3 Address1 Varchar2(15) Stores 1st line of address
4 Address2 Number(38) Stores 2nd line of address
5 Locality Varchar2(200) Stores locality
6 City Stores city name
7 State Stores state name
8 Pin Stores pin code
9 Phone1 Stores 1st contact number
10 Phone2 Stores alternate number
11 Email Stores email address
12 Website College website address
13 ContactPerson Name of contact person
14 ContactPerNumber Number of contact person
15 Designation Designation of contact person
16 LocationId Location Id of college
17 Description Description about college
18 Status Active/Deactive status
19 Password Login password of college
20 CollegeTypeId Id of college type

18
Table Name: Region_Master
Primary Key: RegionId
Description: To keep details of different regions.

S. No. Field Name Data Type/Size Constraints Description


1 RegionId Number(38) Not Null
2 RegionName Varchar2(30) Not Null
3 Description Varchar2(200)

Table Name: Location_Master


Primary Key: LocationId
Description: To keep details of different locations.

S. No. Field Name Data Type/Size Constraints Description


1 LocationId Number(38) Not Null
2 LocationName Varchar2(30)
3 Description Varchar2(200)
4 RegionId Number(30)

Table Name: IndustryType_Master


Description: To keep details of different industry type.
S. No. Field Name Data Type/Size Constraints Description
1 IndustryType Varchar2(100)

19
Table Name: Industry_Master
Primary Key: IndustryId
Description: To keep details of industries

S. No. Field Name Data Type/Size Constraints Description


1 IndustryID Number(38) Not Null Login Id of college
2 IndustryName Varchar2(20) Not Null Stores college name
3 IndustryType Describe the type of industry
4 Address1 Varchar2(15) Stores 1st line of address
5 Address2 Number(38) Stores 2nd line of address
6 City Stores city name
7 State Stores state name
8 Country Stores country name
9 Pin Stores pin code
10 Contact Stores 1st contact number
11 Fax Stores alternate number
12 Email Stores email address
13 Website College website address
14 ContactPerson Name of contact person
15 Designation Designation of contact person
16 Status Active/Deactive status
17 Password Login password of college

20
Table Name: College_Master
Primary Key: CollegeId
Description: To keep details of colleges

S. No. Field Name Data Type/Size Constraints Description


1 CollegeID Number(38) Not Null Login Id of college
2 CollegeName Varchar2(20) Not Null Stores college name
3 Address1 Varchar2(15) Stores 1st line of address
4 Address2 Number(38) Stores 2nd line of address
5 Locality Varchar2(200) Stores locality
6 City Stores city name
7 State Stores state name
8 Pin Stores pin code
9 Phone1 Stores 1st contact number
10 Phone2 Stores alternate number
11 Email Stores email address
12 Website College website address
13 ContactPerson Name of contact person
14 ContactPerNumber Number of contact person
15 Designation Designation of contact person
16 LocationId Location Id of college
17 Description Description about college
18 Status Active/Deactive status
19 Password Login password of college
20 CollegeTypeId Id of college type

21
Table Name: Message
Primary Key: MsgId
Description: To keep details of all the messages

S. No. Field Name Data Type/Size Constraints Description


1 MsgId Number(38) Not Null
2 MsgSub Varchar2(150)
3 Msg Varchar2(500)
4 MsgDate Date

Table Name: MessageLog


Foreign Key: MsgId
Description: To maintain log of all the messages

S. No. Field Name Data Type/Size Constraints Description


1 SourceId Number(38)
2 SourceType Varchar2(5)
3 DestinationId Number(38)
4 DestinationType Varchar2(5)
5 MsgId Number(38)

22
Activity Diagrams

Activity diagram of Admin

Login

Is
Valid
No

Yes

Manage View
Colleges Students
Manage
Manage
Companies
Profile

Logout

23
Activity diagram of college:

Login

Is
Valid
No

Yes

Register Communicate
Students to students &
View companies
Manage
Profile Companies

Logout

24
Activity diagram of company:

Login

Is
Valid
No

Yes

View View
Colleges Students
Manage Communicat
Profile e to colleges

Logout

25
Activity diagram of Student:

Login

Is
Valid
No

Yes

Upload
documents
Manage View
Profile messages

Logout

26
Admin login page:

Admin change password:

27
Admin viewing college details:

Admin viewing college wise student details:

28
College Login Page:

29
College details:

30
College change password:

College verifying documents:

31
Industry login:

Industry change password:

32
Company details:

Company viewing colleges:

33
Company sending message to college:

Company viewing students:

34
Student Login:

Student change password:

35
Student Details:

Student document upload:

36
CStudent.aspx.cs

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

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


{
OdbcConnection cn;

public void loadCourse()


{

OdbcCommand cmd = new OdbcCommand("select courseName from


course_view", cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{

((DropDownList)GridView1.FooterRow.FindControl("CourseList")).Items.Add(dr.Get
String(0));
foreach (GridViewRow gr in GridView1.Rows)
{

((DropDownList)gr.FindControl("CourseList")).Items.Add(dr.GetString(0));
}

}
cn.Close();

}
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
loadData();
loadCourse();
}

public void loadData()


{

//Label112.Text="select * from studdent_view1 where collegeid=" +


Session["uid"].ToString();
OdbcCommand cmd = new OdbcCommand("select
Studid,regno,studentname,courseName from student_view1 where collegeid=" +
Session["uid"].ToString(), cn);
cn.Open();

37
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();
}
protected void HeadCheck_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow gr in GridView1.Rows)
{

CheckBox cb =
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck"));
((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked;

((TextBox)gr.FindControl("txtRegNo")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtStudentName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtRegNo")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtCourseName")).Visible = !cb.Checked;
((DropDownList)gr.FindControl("CourseList")).Visible = cb.Checked;
}

}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{

CheckBox cb = ((CheckBox)gr.FindControl("RowCheck"));
if (cb.Checked == false)
chk = false;
((TextBox)gr.FindControl("txtRegNo")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtStudentName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtRegNo")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtCourseName")).Visible = !cb.Checked;
((DropDownList)gr.FindControl("CourseList")).Visible = cb.Checked;
}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
string regno =
((TextBox)GridView1.FooterRow.FindControl("txtFRegNo")).Text;
string sname =
((TextBox)GridView1.FooterRow.FindControl("txtFStudentName")).Text;
string cname = ((DropDownList
)GridView1.FooterRow.FindControl("CourseList")).Text;
int ofset = cname.IndexOf("-");
cname = cname.Substring(0, ofset);
string sq = "select count(*) from student_master where
collegeid="+Session["uid"].ToString()+" and regno='"+regno+"'";
OdbcCommand cmd1 = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd1.ExecuteReader();
int chk = 0;

38
if (dr.Read())
{
chk = dr.GetInt32(0);
}
cn.Close();
if (chk == 0)
{
sq = "insert into student_master(regno, studentname,
courceid,COLLEGEID) values('" + regno + "','" + sname + "'," + cname + "," +
Session["uid"].ToString() + ")";
Label112.Text = sq;
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
loadData();
loadCourse();
}
else
Response.Write ("<script>alert('Registration No. is already issued
to someone');</script>");
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{

}
protected void LinkButton2_Click(object sender, EventArgs e)
{
foreach (GridViewRow gr in GridView1.Rows)
{
string studid = ((TextBox)gr.FindControl("txtStudId")).Text;
string regno = ((TextBox)gr.FindControl("txtRegNo")).Text;
string sname = ((TextBox)gr.FindControl("txtStudentName")).Text;
string cname = ((DropDownList)gr.FindControl("CourseList")).Text;
int ofset = cname.IndexOf("-");
cname = cname.Substring(0, ofset);
string sq = "update student_master set regno='" + regno +
"',studentname='" + sname + "', courceid=" + cname + " where studid=" +
studid;
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

}
loadData();
loadCourse();

}
protected void LinkButton3_Click(object sender, EventArgs e)
{
loadData();
loadCourse();
}
}

39
ChangePassword.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default5 : System.Web.UI.Page
{
string chk;
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{

cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
chk = Request.QueryString["val"];
}
protected void ChangePassword1_ChangedPassword(object sender, EventArgs e)
{

}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
string sq="";

if (chk == "0")
{
sq = "select * from portal_login where loginid=" +
Session["uid"].ToString()+" and password='"+TextBox1.Text +"'" ;
}

if (chk == "1")
{
sq = "select * from industry_master where industryid=" +
Session["uid"].ToString()+" and status=1 and password='"+TextBox1.Text +"'" ;
}
if (chk == "2")
{
sq = "select * from college_master where collegeid=" +
Session["uid"].ToString()+" and status=1 and password='"+TextBox1.Text +"'" ;
}

40
if (chk == "3")
{
sq = "select * from student_master where studid=" +
Session["uid"].ToString()+"and status=1 and password='"+TextBox1.Text +"'" ;
}

//TextBox3.Text = sq;
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
TextBox2.Enabled = true;
TextBox3.Enabled = true;
}
else
{

TextBox2.Enabled = false;
TextBox3.Enabled = false;
Label1.Text = "Wrong Password";

}
protected void LinkButton2_Click(object sender, EventArgs e)
{
string sq="";
try
{

if (chk == "0")
{
sq = "update portal_login set password='" + TextBox2.Text + "'
where loginid=" + Session["uid"].ToString();
}
if (chk == "1")
{
sq = "update Industry_master set password='" + TextBox2.Text +
"' where industryid=" + Session["uid"].ToString();
}
if (chk == "2")
{
sq = "update college_master set password='" + TextBox2.Text +
"' where Collegeid=" + Session["uid"].ToString();
}
if (chk == "3")
{
sq = "update Student_master set password='" + TextBox2.Text +
"' where studid=" + Session["uid"].ToString();
}

OdbcCommand cmd = new OdbcCommand(sq, cn);


cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

41
Label112.Text = "Password Succesfully Changed";
}
catch
{
Label112.Text = "Error";
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("changepassword.aspx?val=1");
}
}

CollegeMaster.cs

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

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


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

College2IndustryView.aspx.cs

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

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


{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
IndustryType();

42
LoadData("select
industryid,industryname,city,contactperson,contact,email,industrytype from
industry_master");
}
}
public void IndustryType()
{

IndustryTypeList.Items.Clear();
IndustryTypeList.Items.Add("All");
OdbcCommand cmd = new OdbcCommand("select distinct industrytype from
industry_master", cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
IndustryTypeList.Items.Add(dr.GetString(0));
cn.Close();
}

//select
industryid,industryname,city,contactperson,contact,email,industrytype from
industry_master
public void LoadData(string sq)
{
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();
}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{
if (((CheckBox)gr.FindControl("RowCheck")).Checked == false)
chk = false;
}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;
}
protected void HeadCheck_CheckedChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)GridView1.HeaderRow.FindControl("HeadCheck");
foreach (GridViewRow gr in GridView1.Rows)
{

((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked;
}
}

protected void LinkButton1_Click(object sender, EventArgs e)


{

43
string sq = "select
industryid,industryname,city,contactperson,contact,email,industrytype from
industry_master ";
if (IndustryTypeList.SelectedIndex > 0)
sq = sq + " where industrytype='" + IndustryTypeList.Text + "'";
LoadData(sq);
}
protected void LinkButton3_Click(object sender, EventArgs e)
{

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

}
}

CollegeProfile.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default5 : System.Web.UI.Page
{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
loadPAge();
LoadRegion();
LoadCollegeType();
}
}
public void loadPAge()
{

string sq = "select * from college_view2 where collegeid=" +


Session["uid"].ToString();
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
try
{
txtCollegeID.Text = Session["uid"].ToString();

44
}
catch
{
txtCollegeID.Text = "";
}
try
{
txtCollegeName.Text = dr.GetString(1);
}
catch
{
txtCollegeName.Text = "";
}
try
{
txtAdderss1.Text = dr.GetString(2);
}
catch
{
txtAdderss1.Text = "";
}
try
{
txtAddress2.Text = dr.GetString(3);
}
catch
{
txtAddress2.Text = "";
}
try
{
txtLocation.Text = dr.GetString(20);
}
catch
{
txtLocation.Text = "";
}
try
{
txtCity.Text = dr.GetString(5);
}
catch
{
txtCity.Text = "";
}
try
{
txtState.Text = dr.GetString(6);
}
catch
{
txtState.Text = "";
}
try
{
txtPin.Text = dr.GetString(7);
}

45
catch
{
txtPin.Text = "";
}
try
{
txtPhone1.Text = dr.GetString(8);
}
catch
{
txtPhone1.Text = "";
}
try
{
txtPhone2.Text = dr.GetString(9);
}
catch
{
txtPhone2.Text = "";
}
try
{
txtEmail.Text = dr.GetString(10);
}
catch
{
txtEmail.Text = "";
}
try
{
txtWebsite.Text = dr.GetString(11);
}
catch
{
txtWebsite.Text = "";

}
try
{
txtContactPerson.Text = dr.GetString(12);
}
catch
{
txtContactPerson.Text = "";
}
try
{
txtContactNo.Text = dr.GetString(13);
}
catch
{
txtContactNo.Text = "";
}
try
{
txtDegisnation.Text = dr.GetString(14);
}

46
catch
{
txtDegisnation.Text = "";
}
try
{
txtDescription.Text = dr.GetString(16);
}
catch
{
txtDescription.Text = "";
}
try
{
txtRegion.Text = dr.GetString(21);
}
catch
{
txtRegion.Text = "";
}
try
{
txtCollegeType.Text = dr.GetString(22);
}
catch
{
txtCollegeType.Text = "";
}
}

cn.Close();
}
public void LoadCollegeType ()
{
OdbcCommand cmd = new OdbcCommand("select * from
collegetype_view", cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
DropDownList2.Items.Add(dr.GetString(0));
}
cn.Close();

}
public void LoadRegion()
{
OdbcCommand cmd = new OdbcCommand("select * from region_view",
cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
DropDownList1.Items.Add(dr.GetString(0));
}
cn.Close();
}

47
protected void LinkButton2_Click(object sender, EventArgs e)
{
if (LinkButton2.Text == "Edit")
{
txtRegion.Visible = false;
DropDownList1.Visible = true;
txtLocation.Visible = false;
DropDownList3.Visible = true;
txtCollegeID.Visible = false;
DropDownList2.Visible = true;
txtAdderss1.Enabled = true;
txtAddress2.Enabled = true;
txtCity.Enabled = true;
txtState.Enabled = true;
txtPin.Enabled = true;
txtPhone1.Enabled = true;
txtPhone2.Enabled = true;
txtWebsite.Enabled = true;
txtDescription.Enabled = true;
txtCollegeType.Visible = false;
DropDownList2.Visible = true;
txtContactNo.Enabled = true;
txtContactPerson.Enabled = true;
txtDegisnation.Enabled = true;
txtEmail.Enabled = true;
LinkButton2.Text = "Save";
}
else
{
if (LinkButton2.Text == "Save")
{ string loc;
if (DropDownList3.Text == "")
loc = txtLocation.Text;
else
loc = DropDownList3.Text;
int ofset = loc.IndexOf("-");
loc = loc.Substring(0, ofset);

string coltype = DropDownList2.Text;


ofset = coltype.IndexOf("-");
coltype = coltype.Substring(0, ofset);

string sq = "update college_master set address1='" +


txtAdderss1.Text + "',address2='" + txtAddress2.Text + "',city='" +
txtCity.Text + "',state='" + txtState.Text + "',pin='" + txtPin.Text +
"',phone1='" + txtPhone1.Text;
sq = sq + "',phone2='" + txtPhone2.Text + "',email='" +
txtEmail.Text + "',website='" + txtWebsite.Text + "',contactperson='" +
txtContactPerson.Text;
sq = sq + "',contactpernumber='" + txtContactNo.Text +
"',degisnation='" + txtDegisnation.Text + "',description='" +
txtDescription.Text;
sq = sq + "',collegetypeid=" + coltype + ",locationid=" +
loc + " where collegeid=" + Session["uid"].ToString();
//txtDescription.Text = sq;
OdbcCommand cmd = new OdbcCommand(sq, cn);

48
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
Response.Redirect("collegeprofile.aspx");
//LinkButton2.Text = "Edit";
//Label112.Text = "Succefully Updated";
}
}
}
protected void DropDownList1_SelectedIndexChanged(object sender,
EventArgs e)
{
string cname = DropDownList1.Text;
int ofset = cname.IndexOf("-");
cname = cname.Substring(0, ofset);
string sq = "select * from location_master where regionid=" +
cname;
//txtCity.Text = sq;
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
DropDownList3.Items.Clear();
while (dr.Read())
{
DropDownList3.Items.Add(dr.GetString(1));
}
cn.Close();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("collegeprofile.aspx");
}
}
Home.aspx.cs

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

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


{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if(!Page.IsPostBack )
LoadMsg ();
}

public void LoadMsg()

49
{

string sq = "select distinct * from allmessage where destinationid=" +


Session["uid"].ToString();
//Label1.Text = sq;
TableRow r = new TableRow();
TableHeaderCell h1 = new TableHeaderCell();
h1.Text = "Date/Time";
TableHeaderCell h2 = new TableHeaderCell();
h2.Text = "Sender Type";

TableHeaderCell h3 = new TableHeaderCell();


h3.Text = "Sender";

TableHeaderCell h4 = new TableHeaderCell();


h4.Text = "Subject";
r.Cells.Add(h1);
r.Cells.Add(h2);
r.Cells.Add(h3);
r.Cells.Add(h4);
Table1.Rows.Add(r);
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();

int row = 1;
while (dr.Read())
{
TableRow r1 = new TableRow();
TableCell c1 = new TableCell();
c1.Text = dr.GetString(1);
TableCell c2 = new TableCell();
c2.Text = dr.GetString(2);

TableCell c3 = new TableCell();


c3.Text = dr.GetString(3);
TableCell c4 = new TableCell();
c4.Text = "<a href='showmsgtext.aspx?msgid=" +
dr.GetDecimal(0).ToString() +"' target='i1'>" + dr.GetString(4) + "</a>";
r1.Cells.Add(c1);
r1.Cells.Add(c2);
r1.Cells.Add(c3);
r1.Cells.Add(c4);
if (row % 2 == 1)
r1.BackColor = System.Drawing.Color.BurlyWood;
row++;
Table1.Rows.Add(r1);
}
cn.Close();
}
protected void RowRadio_CheckedChanged(object sender, EventArgs e)
{

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

50
}
}

Industry1.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Industry1 : System.Web.UI.Page
{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
loadData();
LoadIndustry();
}
}

public void LoadIndustry()


{
OdbcCommand cmd = new OdbcCommand("select * from industrytype_master",
cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{

((DropDownList)GridView1.FooterRow.FindControl("IndustryList")).Items.Add(dr.G
etString(0));

foreach (GridViewRow gr in GridView1.Rows)


{

((DropDownList)gr.FindControl("IndustryList")).Items.Add(dr.GetString(0));
}
}
cn.Close();

foreach (GridViewRow gr in GridView1.Rows)


{
((DropDownList)gr.FindControl("IndustryList")).Text =
((TextBox)gr.FindControl("txtIndustryType")).Text;

51
}
}
public void loadData()
{
OdbcCommand cmd = new OdbcCommand("select industryid, industryname,
industrytype,City,Contact, status from industry_master", cn);
cn.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();
cmd.CommandText = "select status from industry_master";
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
foreach (GridViewRow gr in GridView1.Rows)
{
dr.Read();
((CheckBox)gr.FindControl("StatusCheck")).Checked = true;
if (dr.GetInt32(0) == 0)
((CheckBox)gr.FindControl("StatusCheck")).Checked = false;
}
cn.Close();

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

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

Boolean chk = true;


foreach (GridViewRow gr in GridView1.Rows)
{

CheckBox cb =
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck"));
((TextBox)gr.FindControl("txtIndustryName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtCity")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtContact")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtIndustryType")).Visible =
!cb.Checked;
((DropDownList)gr.FindControl("IndustryList")).Visible =
cb.Checked;
((CheckBox)gr.FindControl("StatusCheck")).Enabled = cb.Checked;
((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked ;

}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{

52
CheckBox cb = ((CheckBox)gr.FindControl("RowCheck"));
if (cb.Checked == false)
chk = false;
((TextBox)gr.FindControl("txtIndustryName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtCity")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtContact")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtIndustryType")).Visible =
!cb.Checked;
((DropDownList )gr.FindControl("IndustryList")).Visible =
cb.Checked;
((CheckBox)gr.FindControl("StatusCheck")).Enabled = cb.Checked;

}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;

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

Industry ind = new Industry();


ind.IndustryName = ((TextBox)GridView1.FooterRow
.FindControl("txtFIndustryName")).Text;
ind.IndustryType =
((DropDownList)GridView1.FooterRow.FindControl("IndustryList")).Text;
ind.City =
((TextBox)GridView1.FooterRow.FindControl("txtFCity")).Text;
ind.Status = 1;
if (ind.IndustryName == "")
Label1.Text = "Some Required Fields are Blank";
else
{
if
(((CheckBox)GridView1.FooterRow.FindControl("StatusFCheck")).Checked == false)
ind.Status = 1;
IndustryHandle ih = new IndustryHandle();
int ret = ih.AddInsustry(ind);
Label1.Text = ret.ToString() + " Successfuly Inserted";
}
loadData();
LoadIndustry();
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
foreach (GridViewRow gr in GridView1.Rows)
{
Industry ind = new Industry();
ind.IndustryID = Convert.ToInt32
(((TextBox)gr.FindControl("txtIndustryId")).Text);
ind.IndustryName =
((TextBox)gr.FindControl("txtIndustryName")).Text;
ind.IndustryType =
((DropDownList)gr.FindControl("IndustryList")).Text;
ind.City = ((TextBox)gr.FindControl("txtCity")).Text;
ind.Status = 1;

53
if (ind.IndustryName == "")
Label1.Text = "Some Required Fields are Blank";
else
{
if (((CheckBox)gr.FindControl("StatusCheck")).Checked ==
false)
ind.Status = 1;
IndustryHandle ih = new IndustryHandle();
int ret = ih.UpdateInsustry(ind);
Label1.Text = ret.ToString() + " Successfuly Updated";
}
}
loadData();
LoadIndustry();

}
protected void LinkButton3_Click(object sender, EventArgs e)
{
loadData();
LoadIndustry();

IndustryCollegeView.aspx.css

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default5 : System.Web.UI.Page
{
OdbcConnection cn ;

protected void Page_Load(object sender, EventArgs e)


{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
LoadRegion();
LoadCollegeType();
LoadData("select * from college_master_view");
}
}

54
public void LoadRegion ()
{
RegionList.Items.Clear();
RegionList.Items.Add("All");
OdbcCommand cmd = new OdbcCommand("select * from region_view", cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
RegionList.Items.Add(dr.GetString(0));
cn.Close();
}

public void LoadLocation()


{
string reg = RegionList.Text;
int ofset = reg.IndexOf("-");
reg = reg.Substring(0, ofset);
//LocationList.Items.Clear();

OdbcCommand cmd = new OdbcCommand("select * from Location_view1 where


regionid="+reg, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
LocationList.Items.Add(dr.GetString(1));
cn.Close();
}

public void LoadCollegeType()


{

CollegeTypeList.Items.Clear();
CollegeTypeList.Items.Add("All");
OdbcCommand cmd = new OdbcCommand("select * from Collegetype_view",
cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
CollegeTypeList.Items.Add(dr.GetString(0));
cn.Close();
}
public void LoadData(string sq)
{
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();
}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{
if(((CheckBox )gr.FindControl ("RowCheck")).Checked ==false)
chk = false;

55
}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;
}
protected void HeadCheck_CheckedChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)GridView1.HeaderRow.FindControl ("HeadCheck");
foreach (GridViewRow gr in GridView1.Rows)
{

((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
int chk = 0;
string sq = "select * from college_master_view ";
if (RegionList.SelectedIndex > 0)
{
chk = 1;
if (LocationList.SelectedIndex > 0)
{
sq = sq + " where location='" + LocationList.Text + "'";
}
else
{
string reg = RegionList.Text;
int ofset = reg.IndexOf("-");
reg = reg.Substring(0, ofset);

sq = sq + " where location in (select location from


location_view1 where regionid = " + reg + ")";
}
}
if (CollegeTypeList.SelectedIndex > 0)
{

if (chk == 1)
sq = sq + " and collegetype = '" + CollegeTypeList.Text +"'" ;
else
sq = sq + " where collegetype ='" + CollegeTypeList.Text +
"'";
}
//Label119.Text = sq;
LoadData(sq);

}
protected void RegionList_SelectedIndexChanged(object sender, EventArgs e)
{
LocationList.Items.Clear();
LocationList.Items.Add("All");
if (RegionList.SelectedIndex > 0)
{
LoadLocation();
}
}

56
protected void LinkButton2_Click(object sender, EventArgs e)
{
Panel1.Visible = true;
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
string sq = "insert into message (msgsub ,msg)values('"+TextBox2.Text
+"','"+TextBox3.Text +"')";

OdbcCommand cmd = new OdbcCommand(sq, cn);


cn.Open();
cmd.ExecuteNonQuery();
//TextBox2.Text = sq;
cn.Close();
cmd.CommandText = "select max(msgid) from message";
cmd.Connection = cn;
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
int msgid=1;
if (dr.Read())
{
msgid= dr.GetInt32(0);
}
cn.Close();
foreach (GridViewRow gr in GridView1.Rows)
{
if(((CheckBox)gr.FindControl ("RowCheck")).Checked ==true)
{
sq = "insert into messagelog values(" +
Session["uid"].ToString() + ",'I'," + ((Label)gr.FindControl("Label112")).Text
+ ",'C'," + msgid.ToString() + ")";
cmd.CommandText = sq;
cmd.Connection = cn;
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

}
Response.Write ("<script> alert('Message succesfully
send')</script>");
Panel1.Visible = false;

}
}

57
IndustryProfile.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default5 : System.Web.UI.Page
{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{

cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{
loadPage();
LoadIndustry();
}
}

public void LoadIndustry()


{

OdbcCommand cmd = new OdbcCommand("select * from industrytype_master",


cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
DropDownList1.Items.Add(dr.GetString(0));

}
cn.Close();
}
public void loadPage()
{
string sq = "select * from industry_master where industryid=" +
Session["uid"].ToString();
//txtDesignation.Text = sq;
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
txtIndustryID.Text = Session["uid"].ToString();
try
{
txtIndustryName.Text = dr.GetString(1);
}
catch
{
txtIndustryName.Text = "";

58
}
try
{
txtIndustryType.Text = dr.GetString(2);
}
catch
{
txtIndustryType.Text = "";
}
try
{
txtAddress1.Text = dr.GetString(3);
}
catch
{
txtAddress1.Text = "";

}
try
{
txtAddress2.Text = dr.GetString(4);
}
catch
{
txtAddress2.Text = "";

}
try
{
txtCity.Text = dr.GetString(5);
}
catch
{
txtCity.Text = "";
}
try
{
txtState.Text = dr.GetString(6);
}
catch
{
txtState.Text = "";
}
try
{
txtPin.Text = dr.GetString(7);
}
catch {
txtPin.Text = "";
}
try
{
txtPhone.Text = dr.GetString(8);
}
catch {
txtPhone.Text = "";
}

59
try
{
txtFax.Text = dr.GetString(9);
}
catch {
txtFax.Text = "";
}
try
{
txtWebsite.Text = dr.GetString(10);
}
catch {
txtWebsite.Text = "";
}
try
{
txtEmail.Text = dr.GetString(11);
}
catch {
txtEmail.Text = "";
}
try
{
txtContactPerson.Text = dr.GetString(12);
}
catch {
txtContactPerson.Text = "";
}
try
{
txtDesignation.Text = dr.GetString(13);
}
catch {
txtDesignation.Text = "";
}

}
cn.Close();

}
protected void LinkButton2_Click(object sender, EventArgs e)
{
if (LinkButton2.Text == "Edit")
{
txtIndustryName.Enabled = true;
txtIndustryType.Visible = false;
DropDownList1.Visible = true;
DropDownList1.Text = txtIndustryType.Text;
txtPhone.Enabled = true;
txtPin.Enabled = true;
txtState.Enabled = true;
txtWebsite.Enabled = true;
txtAddress1.Enabled = true;
txtAddress2.Enabled = true;
txtState.Enabled = true;
txtCity.Enabled = true;
txtEmail.Enabled = true;

60
txtDesignation.Enabled = true;
txtContactPerson.Enabled = true;
txtCountry.Enabled = true;
txtContactPerson.Enabled = true;
txtFax.Enabled = true;
LinkButton2.Text = "Update";
}
else
{
string sq = "update industry_master set industryname='" +
txtIndustryName.Text + "' ,Industrytype='" + DropDownList1.Text + "' ";
sq = sq + ",address1='" + txtAddress1.Text + "',address2='" +
txtAddress2.Text + "', city ='" + txtCity.Text + "' where
industryid="+Session["uid"].ToString();
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();

cmd.ExecuteNonQuery();
cn.Close();
sq="update industry_master set state='" + txtState.Text + "'";
sq = sq + ",country='" + txtCountry.Text + "',pin='" +
txtPin.Text + "',contact='" + txtPhone.Text + "',fax='" + txtFax.Text + "'
where industryid="+Session["uid"].ToString () ;
cmd.CommandText = sq;
cmd.Connection=cn;
cn.Open();

cmd.ExecuteNonQuery();
cn.Close();

sq = "update industry_master set website='" + txtWebsite.Text +


"',email='" + txtEmail.Text + "',contactperson='" + txtContactPerson.Text +
"',designation='";
sq = sq + txtDesignation.Text + "' where industryid=" +
Session["uid"].ToString() ;
cmd.CommandText = sq;
cmd.Connection=cn;
cn.Open();

cmd.ExecuteNonQuery();
cn.Close();
//txtAddress1.Text = sq;
//Response.Write("<script>alert('Industry Profile Succesfully
Uodated')</script>");
Response.Write("<script>alert('Industry Profile Succesfully
Uodated')</script>");
LinkButton2.Text = "Edit";

Response.Redirect("industryprofile.aspx");

}
}
}

61
Location.aspx

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default3 : System.Web.UI.Page
{
OdbcConnection cn;
public void addRegioninList()
{

OdbcCommand cmd = new OdbcCommand("select * from region1", cn);


cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{

((DropDownList)GridView1.FooterRow.FindControl("RegionList")).Items.Add(dr.Get
String(0) );
foreach (GridViewRow gr in GridView1.Rows)
{

((DropDownList)gr.FindControl("RegionList")).Items.Add(dr.GetString(0));
}

}
cn.Close();

foreach (GridViewRow gr in GridView1.Rows)


{
((DropDownList)gr.FindControl("RegionList")).Text =
((TextBox)gr.FindControl("txtRegionId")).Text;
}
}
public void loadData()
{

OdbcCommand cmd = new OdbcCommand("select * from


Location_REgion_View", cn);
cn.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();

62
foreach (GridViewRow gr in GridView1.Rows)
{
((DropDownList)gr.FindControl("RegionList")).Text =
((TextBox)gr.FindControl("txtRegionId")).Text;
}
}
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
{loadData();
addRegioninList();
}

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

}
protected void HeadCheck_CheckedChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)GridView1.HeaderRow.FindControl("HeadCheck");
foreach (GridViewRow gr in GridView1.Rows)
{

((TextBox)gr.FindControl("txtLocationName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtDescription")).Enabled = cb.Checked;
((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked;
((DropDownList)gr.FindControl("RegionList")).Visible = cb.Checked;
((TextBox)gr.FindControl("txtRegionId")).Visible = !cb.Checked;

}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Location NewNode = new Location();
NewNode.LocationName =
((TextBox)GridView1.FooterRow.FindControl("ftxtLocationName")).Text;
NewNode.Description =
((TextBox)GridView1.FooterRow.FindControl("ftxtDescription")).Text;

string rid =
((DropDownList)GridView1.FooterRow.FindControl("RegionList")).Text;
int ofset = rid.IndexOf('-');
string regid = rid.Substring(0, ofset);
NewNode.RegionId = Convert.ToInt32(regid);

LocationHandle rh = new LocationHandle();


try
{
rh.AddLocation(NewNode);

loadData();
addRegioninList();

63
Label1.Text = "Successfully Inserted.";
}
catch
{

Label1.Text = "Error Occured";

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

Location NewNode = new Location();


try
{
foreach (GridViewRow gr in GridView1.Rows)
{

NewNode.LocationId =
Convert.ToInt32(((TextBox)gr.FindControl("txtLocationId")).Text);
NewNode.LocationName =
((TextBox)gr.FindControl("txtLocationName")).Text;
NewNode.Description =
((TextBox)gr.FindControl("txtDescription")).Text;
string rid =
((DropDownList)gr.FindControl("RegionList")).Text;
int ofset = rid.IndexOf('-');
string regid = rid.Substring(0,ofset);
NewNode.RegionId = Convert.ToInt32(regid);
LocationHandle rh = new LocationHandle();
rh.UpdateLocation(NewNode);

Label1.Text = "Successfully Inserted.";


}
loadData();
addRegioninList();
}
catch
{

Label1.Text = "Error Occured";

}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{

CheckBox cb = (CheckBox)gr.FindControl("RowCheck");
if (cb.Checked == false)
chk = false;
((TextBox)gr.FindControl("txtLocationName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtDescription")).Enabled = cb.Checked;

64
((DropDownList)gr.FindControl("RegionList")).Visible = cb.Checked;
((TextBox)gr.FindControl("txtRegionId")).Visible = !cb.Checked;

}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;
}
}

Login.aspx.cs

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

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


{string s="";
protected void Page_Load(object sender, EventArgs e)
{
s = Request.QueryString["val"];
if (s == "1")
{
Image3.Visible = true;
Image4.Visible = false;
Image5.Visible = false;
}
if (s == "2")
{
Image3.Visible = false;
Image4.Visible = true;
Image5.Visible = false;
}
if (s == "3")
{
Image3.Visible = false;
Image4.Visible = false;
Image5.Visible = true;
}

}
protected void Login11_Authenticate(object sender, AuthenticateEventArgs
e)
{
Session["uid"] = Login11.UserName;

65
checkLogin cl = new checkLogin();
LoginResult lr = new LoginResult ();
if (s == "2")
{
lr = cl.CollegeLogin(Login11.UserName, Login11.Password);
}
if (s == "1")
{
lr = cl.IndustryLogin(Login11.UserName, Login11.Password);
if (lr.status == 1)
{
Session["uname"] = lr.name;
//Session["uid"]=lr.LoginId ;
Response.Redirect("industryprofile.aspx");

}
}
if (s == "3")
{
lr = cl.StudentLogin(Login11.UserName, Login11.Password);
}
if (s == null)
{
lr = cl.PortalLogin(Login11.UserName, Login11.Password);
if (lr.status == 1)
{
Session["uname"] = lr.name;
//Session["uid"]=lr.LoginId ;
Response.Redirect("industry1.aspx");
}
}
if (s == "2")
{
lr = cl.CollegeLogin(Login11.UserName, Login11.Password);
if (lr.status == 1)
{
Session["uname"] = lr.name;
//Session["uid"]=lr.LoginId ;
Response.Redirect("Collegeprofile.aspx");
}
}

}
}

Logout.aspx.cs

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

66
using System.Web.UI;
using System.Web.UI.WebControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.RemoveAll();
Response.Redirect("login.aspx");
}
}

Region.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class Default3 : System.Web.UI.Page
{
OdbcConnection cn;
public void loadData()
{

OdbcCommand cmd = new OdbcCommand("select * from region_Master", cn);


cn.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cn.Close();
}
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
if (!Page.IsPostBack)
loadData();

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

}
protected void HeadCheck_CheckedChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)GridView1.HeaderRow.FindControl("HeadCheck");

67
foreach (GridViewRow gr in GridView1.Rows)
{

((TextBox)gr.FindControl("txtRegionName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtDescription")).Enabled = cb.Checked;
((CheckBox)gr.FindControl("RowCheck")).Checked = cb.Checked;

}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Region NewNode = new Region();
NewNode.RegionName =
((TextBox)GridView1.FooterRow.FindControl("ftxtRegionName")).Text;
NewNode.Description =
((TextBox)GridView1.FooterRow.FindControl("ftxtDescription")).Text;
RegionHandle rh = new RegionHandle();
try
{
rh.AddRegion(NewNode);
loadData();

Label1.Text = "Successfully Inserted.";


}
catch
{

Label1.Text = "Error Occured";

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

Region NewNode = new Region();


try{
foreach (GridViewRow gr in GridView1.Rows )
{

NewNode.RegionId = Convert.ToInt32
(((TextBox)gr.FindControl("txtRegionId")).Text);
NewNode.RegionName = ((TextBox)gr.FindControl("txtRegionName")).Text;
NewNode.Description =
((TextBox)gr.FindControl("txtDescription")).Text;
RegionHandle rh = new RegionHandle();
rh.UpdateRegion(NewNode);

Label1.Text = "Successfully Inserted.";


}
loadData();
}
catch
{

68
Label1.Text = "Error Occured";

}
protected void RowCheck_CheckedChanged(object sender, EventArgs e)
{
Boolean chk = true;
foreach (GridViewRow gr in GridView1.Rows)
{

CheckBox cb = (CheckBox)gr.FindControl("RowCheck");
if (cb.Checked == false)
chk = false;
((TextBox)gr.FindControl("txtRegionName")).Enabled = cb.Checked;
((TextBox)gr.FindControl("txtDescription")).Enabled = cb.Checked;

}
((CheckBox)GridView1.HeaderRow.FindControl("HeadCheck")).Checked =
chk;
}
}

ShowMsgText.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Odbc;
public partial class ShowMsgText : System.Web.UI.Page
{
OdbcConnection cn;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand ( "select msg from message where
msgid=" + Request["msgid"], cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
TextBox1.Text = dr.GetString(0);
cn.Close();
}
}

69
checkLogin.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Odbc;
/// <summary>
/// Summary description for checkLogin
/// </summary>
public class checkLogin
{
public LoginResult CollegeLogin(string uid, string pwd)
{
string sq = "select collegename from college_Master where
collegeid="+uid+" and password='"+pwd+"'";
LoginResult lr = new LoginResult();
lr.LoginId = Convert.ToInt32(uid);
lr.status = 0;
lr.name = "";
OdbcConnection cn;
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
lr.status = 1;
lr.name = dr.GetString(0);

}
cn.Close();

return lr;

public LoginResult IndustryLogin(string uid, string pwd)


{
string sq = "select Industryname from Industry_Master where
Industryid=" + uid + " and password='" + pwd + "'";
LoginResult lr = new LoginResult();
lr.LoginId = Convert.ToInt32(uid);
lr.status = 0;
lr.name = "";
OdbcConnection cn;
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
lr.status = 1;

70
lr.name = dr.GetString(0);

}
cn.Close();

return lr;

public LoginResult StudentLogin(string uid, string pwd)


{
string sq = "select studentname from stud_Master where studid=" + uid
+ " and password='" + pwd + "'";
LoginResult lr = new LoginResult();
lr.LoginId = Convert.ToInt32(uid);
lr.status = 0;
lr.name = "";
OdbcConnection cn;
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
lr.status = 1;
lr.name = dr.GetString(0);

}
cn.Close();

return lr;

public LoginResult PortalLogin(string uid, string pwd)


{
string sq = "select Loginname from portal_login where Loginid=" + uid
+ " and password='" + pwd + "'";
LoginResult lr = new LoginResult();
lr.status = 0;
lr.name = "";
OdbcConnection cn;
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
lr.status = 1;
lr.name = dr.GetString(0);

}
cn.Close();

71
return lr;
}

College.cs

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

/// <summary>
/// Summary description for College
/// </summary>
public class College
{
public int CollegeId { get; set; }
public string CollegeName { get; set; }
public string ContactPerson { get; set; }
public int LocationID { get; set; }
public int CollegeTypeId { get; set; }
public int Status { get; set; }

CollegeHandler.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Odbc;

/// <summary>
/// Summary description for CollegeHandler
/// </summary>
public class CollegeHandler
{
OdbcConnection cn;
public int AddCollege(College c)
{
string sq="";

cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
sq = "insert into college_master ( collegeName,
Contactperson,locationid, collegetypeid,status) values('" + c.CollegeName +
"','" + c.ContactPerson + "'," + c.LocationID.ToString() + "," +
c.CollegeTypeId.ToString() + "," + c.Status.ToString() + ")";
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
return 0;

72
}

public int UpdateCollege(College c)


{

try
{
cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
string sq = "update college_master set
collegeName='"+c.CollegeName + "',ContactPerson='"+c.ContactPerson
+"',locationid="+c.LocationID.ToString
()+",collegetypeid="+c.CollegeTypeId.ToString ()+",status="+c.Status +" where
collegeid ="+c.CollegeId.ToString ();
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteReader();
cn.Close();
return 1;
}
catch
{
return 0;
}

}
}

Industry.cs

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

/// <summary>
/// Summary description for Industry
/// </summary>
public class Industry
{
public int IndustryID { get; set; }
public int Status { get; set; }
public string IndustryName { get; set; }
public string IndustryType { get; set; }
public string Contact { get; set; }
public string City { get; set; }
}

IndustryHandler.cs

using System;
using System.Collections.Generic;

73
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Odbc;
/// <summary>
/// Summary description for IndustryHandle
/// </summary>
public class IndustryHandle
{
OdbcConnection cn;
public int AddInsustry(Industry ind)
{
int cnt = 1;

cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
//try
{
string sq = "insert into Industry_master(industryNAme,
IndustryType, contact, city, status)values('" + ind.IndustryName + "','" +
ind.IndustryType + "','" + ind.Contact + "','" + ind.City + "'," +
ind.Status.ToString() + ")";

OdbcCommand cmd = new OdbcCommand(sq, cn);


cn.Open();
cmd.ExecuteReader();
return 0;
}
/*catch
{
return 1;

}*/

public int UpdateInsustry(Industry ind)


{

cn = new OdbcConnection("dsn=C2COdbc;uid=c2c;pwd=c2c");
//try
{
string sq = "update industry_master set industryNAme = '" +
ind.IndustryName + "', IndustryType='" + ind.IndustryType + "', city='" +
ind.City + "', contact='" + ind.Contact + "',status=" + ind.Status.ToString ()
+ " where industryid=" + ind.IndustryID.ToString();

OdbcCommand cmd = new OdbcCommand(sq, cn);


cn.Open();
cmd.ExecuteNonQuery ();
return 0;
}
/* catch
{
return 1;

74
}
*/
}

Location.cs

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

/// <summary>
/// Summary description for Location
/// </summary>
public class Location
{
public int LocationId { get; set; }
public string LocationName { get; set; }
public string Description { get; set; }
public int RegionId { get; set; }
}

LocationHandler.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Odbc;
/// <summary>
/// Summary description for LocationHandle
/// </summary>
public class LocationHandle
{

public void AddLocation(Location r)


{
string sq = "insert into Location_Master ( LocationName,
Description,RegionID) values('" + r.LocationName + "','" + r.Description +
"'," + r.RegionId.ToString () +")";

OdbcConnection cn = new
OdbcConnection("dsn=C2cOdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);

75
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

}
public void UpdateLocation(Location r)
{
string sq = "update Location_Master set LocationName = '" +
r.LocationName + "', description ='" + r.Description + "',regionid=" +
r.RegionId.ToString() + " where Locationid=" + r.LocationId.ToString();
OdbcConnection cn = new OdbcConnection("dsn=C2cOdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

}
}

LoginResult.cs

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

public class LoginResult


{
public int status { get; set; }
public String name { get; set; }
public int LoginId { get; set; }
}

Region.cs

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

/// <summary>
/// Summary description for Region
/// </summary>
public class Region
{

public int RegionId { get; set; }


public string RegionName { get; set; }
public string Description { get; set; }
}

76
RegionHandler.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Odbc;
/// <summary>
/// Summary description for RegionHandle
/// </summary>
public class RegionHandle
{
public void AddRegion(Region r)
{
string sq = "insert into Region_Master ( RegionName, Description)
values('" + r.RegionName + "','" + r.Description + "')";
OdbcConnection cn = new
OdbcConnection("dsn=C2cOdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close()
}
public void UpdateRegion(Region r)
{
string sq = "update Region_Master set RegionName = '" + r.RegionName
+ "', description ='" + r.Description + "' where regionid=" +
r.RegionId.ToString();
OdbcConnection cn = new OdbcConnection("dsn=C2cOdbc;uid=c2c;pwd=c2c");
OdbcCommand cmd = new OdbcCommand(sq, cn);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();

}
}

77
CHAPTER 5

TESTING

Testing is done for following reasons:

1. Testing is the process of running a system with the intention of findingerrors.

2. Testing enhances the integrity of a system by detecting deviations indesign and errors in the
system.

3. Testing aims at detecting error-prone areas. This helps in the prevention of errors in a system.

4. Testing also add value to the product by confirming to the user requirements.

Test Cases Expected Actual Output Pass/Fail


Output
Non Registered User Not allowed Not allowed Pass

Wrong Username Show error Error message Pass


/password

Correct username/password Login successful Login Successful pass

Change password Update password New Password pass

Messaging Sent and recieved Correct message pass


found
Upload documents Gets uploaded Document found pass

78

You might also like