Professional Documents
Culture Documents
C2cproject Report
C2cproject Report
SUBMITTED BY
XYZ
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
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.
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.
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
6
LIST OF TABLES
7
INTRODUCTION
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.
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.
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 -
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#
2.3.4 ADO.Net
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:
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.
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
17
Table Name: College_Master
Primary Key: CollegeId
Description: To keep details of colleges
18
Table Name: Region_Master
Primary Key: RegionId
Description: To keep details of different regions.
19
Table Name: Industry_Master
Primary Key: IndustryId
Description: To keep details of industries
20
Table Name: College_Master
Primary Key: CollegeId
Description: To keep details of colleges
21
Table Name: Message
Primary Key: MsgId
Description: To keep details of all the messages
22
Activity Diagrams
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:
27
Admin viewing college details:
28
College Login Page:
29
College details:
30
College change password:
31
Industry login:
32
Company details:
33
Company sending message to college:
34
Student Login:
35
Student Details:
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;
((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();
}
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();
}
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;
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;
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;
}
}
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()
{
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);
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;
49
{
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);
}
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();
}
}
((DropDownList)GridView1.FooterRow.FindControl("IndustryList")).Items.Add(dr.G
etString(0));
((DropDownList)gr.FindControl("IndustryList")).Items.Add(dr.GetString(0));
}
}
cn.Close();
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)
{
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)
{
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 ;
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();
}
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);
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 +"')";
}
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();
}
}
}
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();
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()
{
((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();
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);
loadData();
addRegioninList();
63
Label1.Text = "Successfully Inserted.";
}
catch
{
}
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
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);
}
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;
}
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;
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()
{
}
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();
}
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
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);
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;
70
lr.name = dr.GetString(0);
}
cn.Close();
return lr;
}
cn.Close();
return lr;
}
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
}
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() + ")";
}*/
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();
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
{
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;
Region.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for Region
/// </summary>
public class Region
{
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
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.
78