Sei sulla pagina 1di 124

Globsyn Skills, Globsyn Crystals, 1st Floor, XI 11 and 12, Block EP, Sector V, Salt Lake, Kolkata 700091

-:PROJECT TITLE :-

Online Student Enrollment System

Group Members:-

SAYANTAN SAMADDAR, HERITAGE INSTITUTE OF TECHNOLOGY, 131260120059 of 2013-14


RAKESH SHAW, COLLEGE OF ENGINEERING & MANAGEMENT,KOLAGHAT, 111070110097 of
2011-2012
PRASENJIT SAMANTA, COLLEGE OF ENGINEERING & MANAGEMENT,KOLAGHAT,
111070110093 of 2011-2012
TUHIN DEY, COLLEGE OF ENGINEERING & MANAGEMENT,KOLAGHAT, 111070110118 of
2011-2012

www.globsynskills.com

Table of Contents

Acknowledgement.................................................................................................................................4
Project Objective .................................................................................................................................. 5
Project Scope ........................................................................................................................................ 6
Requirement Specification .................................................................................................................... 7
Database Design .................................................................................................................................... 8
Application Work Flow .......................................................................................................................... 9
Screenshots .......................................................................................................................................... 10
Future Scope of Improvements ........................................................................................................... 11
Code...................................................................................................................................................... 12
Certificate ............................................................................................................................................ 13

www.globsynskills.com

Acknowledgement
I take this opportunity to express my profound gratitude and deep regards to my faculty Mr. RAKESH
KUMAR PANDIT for his exemplary guidance, monitoring and constant encouragement throughout
the course of this project. The blessing, help and guidance given by him/her time to time shall carry
me a long way in the journey of life on which I am about to embark.

I am obliged to my project team members for the valuable information provided by them in their
respective fields. I am grateful for their cooperation during the period of my assignment.

RAKESH SHAW
SAYANTAN SAMADDAR
PRASENJIT SAMANTA
TUHIN DEY

www.globsynskills.com

Project Objective

Develop and implement a Web based Student Enrollment System to help students, so that they can
have 24 x 7 access to enroll them in an institute.
The primary project goals consist of:

To enroll easily in an Institute.

Get a vast idea about the institute.

www.globsynskills.com

Project Scope

The broad scope of the Online Student Enrollment System project includes:

The system will be available on an online platform for 24x7 access to the students, the faculty
and the administration.

So students can enrollment themselves without physically present in the institute.

www.globsynskills.com

Requirement Specification

Domain Description

Problem Definition
-Design a Website that is used for Student Enrollment System.

Functional Requirements
-ASP.NET, ADO.NET, RDBMS, .NET Framework

Hardware /Software Requirements


Hardware requirement
Client side Any Computer with a Working Internet Connection
Server side- Any Server with Round the Clock Connectivity with
Internet.
Software Requirement
Client side Any Supported Web Browser. Example: Internet
Explorer, Mozilla Firefox, Google Chrome etc.
Server side- Microsoft Visual Studio 2010,SQL Express 2008,IIS
Express

www.globsynskills.com

Database Design

www.globsynskills.com

Application Work Flow

We have 3 Modules:
1. Admin
2. Faculty
3. Student

Features of Admin Module:


1. Register New Faculty
2. Manage Faculty Details
3. View Student Details

Features of Faculty Module:


1. Add New Course
2. Manage Course Details
3. Manage Student Details

Features of Student Module:


View Course Details

www.globsynskills.com

Screenshots

www.globsynskills.com

10

www.globsynskills.com

11

www.globsynskills.com

12

www.globsynskills.com

13

www.globsynskills.com

14

www.globsynskills.com

15

www.globsynskills.com

16

www.globsynskills.com

17

www.globsynskills.com

18

www.globsynskills.com

19

www.globsynskills.com

20

www.globsynskills.com

21

www.globsynskills.com

22

www.globsynskills.com

23

Future Scope of Improvements


To make a chat server so that students can interact among themselves.
To make a Change Password option for every user.
To have an Instant E-mail option, so that the Students registering can easily be contacted
through E-mail.
To make an Online Fees Payment option.

www.globsynskills.com

24

Code

FOR ADMIN

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btn_signout_Click(object sender, EventArgs e)

www.globsynskills.com

25

{
Response.Redirect("~/Login.aspx");
}
protected void btn_home_Click(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("~/Change_Password.aspx");
}
}

FOR ADMIN/DEFAULT

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

www.globsynskills.com

26

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void txt_viewstud_Click(object sender, EventArgs e)
{
Response.Redirect("View_Student.aspx");
}
protected void btn_managefac_Click(object sender, EventArgs e)
{
Response.Redirect("Manage_Fac.aspx");
}

www.globsynskills.com

27

protected void btn_adregfac_Click(object sender, EventArgs e)


{
Response.Redirect("Fac_Reg.aspx");
}
}
FACULTY_REGISTRATION
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

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


{
string eid;

www.globsynskills.com

28

private string autogenerate()

//Take Char(4) for empid

{
SqlUtility su = new SqlUtility();
query = "select Faculty_id from Faculty_Registration";
DataTable dt = su.getdatatable(query, null);
if (dt.Rows.Count == 0)
{
eid = "F001";
}
else
{
eid = dt.Rows[dt.Rows.Count - 1]["Faculty_id"].ToString();

string str = eid.Substring(1, 3);


int y = System.Convert.ToInt32(str);
if (y >= 1 && y < 9)
{
y = y + 1;

www.globsynskills.com

29

eid = "F00" + y;
}
if (y >= 9 && y < 99)
{
y = y + 1;
eid = "F0" + y;
}
if (y >= 99)
{
y = y + 1;
eid = "F" + y;
}
}
return eid;
}
protected void Page_Load(object sender, EventArgs e)
{
txt_fid.Text = autogenerate();

www.globsynskills.com

30

}
SqlUtility su = new SqlUtility();
string query,query1;
SqlParameter[] list, list1;
int x,x1;
protected void btn_regfac_Click(object sender, EventArgs e)
{
string Faculty;
if (rbtn_male.Checked)
{
Faculty = rbtn_male.Text;
}
else
{
Faculty = rbtn_female.Text;
}
SqlConnection con = su.getcon();

www.globsynskills.com

31

query = "Insert into


Faculty_Registration(Faculty_id,Firstname,Lastname,Address,Gender,Timing,Phone_no,Course)
values(@fid,@Firstname,@Lastname,@Address,@Gender,@Timing,@Phone_no,@Course)";
//query="Insert into
Student(S_id,name,address,phone_no)values(@S_id,@name,@address,@ph_no");
list = new SqlParameter[8];
list[0] = new SqlParameter("@fid", txt_fid.Text);
list[1] = new SqlParameter("@Firstname", txt_fname.Text);
list[2] = new SqlParameter("@Lastname", txt_lname.Text);
list[7] = new SqlParameter("@Phone_no", Convert.ToInt32(txt_phno.Text));
list[3] = new SqlParameter("@Address", txt_addr.Text);
list[4] = new SqlParameter("@Gender", Faculty);
list[5] = new SqlParameter("@Timing", lbx_timing.Text);
list[6] = new SqlParameter("@Course", ddl_course.SelectedItem.ToString());

x = su.ins_up_del(query, list);
query1="Insert into Login(E_mail,Password,Logon_Type)
Values(@E_mail,@Password,@Logon_Type)";
list1 = new SqlParameter[3];
list1[0] = new SqlParameter("@E_mail", txt_email.Text);

www.globsynskills.com

32

list1[1] = new SqlParameter("@Password", txt_pass.Text);


list1[2] = new SqlParameter("@Logon_Type","Faculty");
x1 = su.ins_up_del(query1, list1);
if ((x > 0)&&(x1>0))
{
Alert.Show("Details Successfully saved");
}

}
protected void btn_reset_Click(object sender, EventArgs e)
{
txt_fname.Text = "";
txt_lname.Text = "";
txt_addr.Text = "";
txt_email.Text = "";
txt_phno.Text = "";
rbtn_male.Checked = false;

www.globsynskills.com

33

rbtn_female.Checked = false;
}
}

MANAGE FACULTY

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.SqlClient;

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


{
DataSet ds;

www.globsynskills.com

34

SqlConnection con;
string x, query;
SqlDataAdapter da;
SqlUtility su = new SqlUtility();
protected void gv_faculty_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
ds.Clear();
query = "select * from Faculty_Registration order by " + e.SortExpression;
ds = su.getDataSet(query, "Faculty", null);
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);

www.globsynskills.com

35

}
protected void gv_faculty_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
int index = e.NewEditIndex;
gv_faculty.EditIndex = index;
gv_faculty.DataSource = ds;
gv_faculty.DataBind();

TextBox editbox = (TextBox)(gv_faculty.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;
TextBox editbox1 = (TextBox)(gv_faculty.Rows[index].Cells[5].Controls[0]);
editbox1.Enabled = false;
}
catch (Exception ex)

www.globsynskills.com

36

{
// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);
}

}
protected void gv_faculty_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
int index = e.RowIndex;
GridViewRow gvr = gv_faculty.Rows[index];
DataTable dt = ds.Tables["Faculty"];
DataRow dr = dt.Rows[index];
dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;

www.globsynskills.com

37

dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;
dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;
dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr[7] = ((TextBox)gvr.Cells[8].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Faculty_Registration", con);
//ds = su.getDataSet("select * from employees", "employees", null);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetUpdateCommand();
da.Update(ds, "Faculty");
gv_faculty.EditIndex = -1;
gv_faculty.DataSource = ds;
gv_faculty.DataBind();
}

www.globsynskills.com

38

catch (Exception ex)


{
Response.Write("Exception = " + ex);
}
}
protected void gv_faculty_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_faculty_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gv_faculty.EditIndex = -1;
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
protected void gv_faculty_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try

www.globsynskills.com

39

{
ds.Clear();
con = su.getcon();
con.Open();
ds = su.getDataSet("Select * from Faculty_Registration", "Faculty", null);
int index = e.RowIndex;
DataTable dt = ds.Tables["Faculty"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Faculty_Registration", con);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetDeleteCommand();
da.Update(dt);
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
catch (Exception ex)

www.globsynskills.com

40

{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);
}
}

protected void gv_faculty_SelectedIndexChanged(object sender, EventArgs e)


{

}
protected void Page_Load(object sender, EventArgs e)
{
try
{
query = "select * from Faculty_Registration";
ds = su.getDataSet(query, "Faculty", null);
if (!Page.IsPostBack)
{

www.globsynskills.com

41

gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}
}

VIEW STUDENT DETAILS

using System;
using System.Collections.Generic;

www.globsynskills.com

42

using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

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


{
DataSet ds;
SqlConnection con;
string x, query;
SqlDataAdapter da;
SqlUtility su = new SqlUtility();
protected void Page_Load(object sender, EventArgs e)
{
try
{

www.globsynskills.com

43

query = "select * from Student_Registration";


ds = su.getDataSet(query, "Student", null);
if (!Page.IsPostBack)
{
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

}
protected void gv_student_Sorting(object sender, GridViewSortEventArgs e)
{

www.globsynskills.com

44

try
{
ds.Clear();
query = "select * from Student_Registration order by " + e.SortExpression;
ds = su.getDataSet(query, "Student", null);
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

}
protected void gv_student_RowEditing(object sender, GridViewEditEventArgs e)
{
try

www.globsynskills.com

45

{
int index = e.NewEditIndex;
gv_student.EditIndex = index;
gv_student.DataSource = ds;
gv_student.DataBind();

TextBox editbox = (TextBox)(gv_student.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;
TextBox editbox1 = (TextBox)(gv_student.Rows[index].Cells[5].Controls[0]);
editbox1.Enabled = false;
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);
}

www.globsynskills.com

46

protected void gv_student_RowUpdating(object sender, GridViewUpdateEventArgs e)


{
try
{
int index = e.RowIndex;
GridViewRow gvr = gv_student.Rows[index];
DataTable dt = ds.Tables["Student"];
DataRow dr = dt.Rows[index];
dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;
dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;
dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;
dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr[7] = ((TextBox)gvr.Cells[8].Controls[0]).Text;
dr[8] = ((TextBox)gvr.Cells[9].Controls[0]).Text;

www.globsynskills.com

47

dr[9] = ((TextBox)gvr.Cells[10].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Student_Registration", con);
//ds = su.getDataSet("select * from employees", "employees", null);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetUpdateCommand();
da.Update(ds, "Student");
gv_student.EditIndex = -1;
gv_student.DataSource = ds;
gv_student.DataBind();
}
catch (Exception ex)
{
Response.Write("Exception = " + ex);
}

www.globsynskills.com

48

}
protected void gv_student_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_student_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gv_student.EditIndex = -1;
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}
protected void gv_student_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try
{
ds.Clear();
con = su.getcon();
con.Open();

www.globsynskills.com

49

ds = su.getDataSet("Select * from Student_Registration", "Student", null);


int index = e.RowIndex;
DataTable dt = ds.Tables["Student"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Student_Registration", con);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetDeleteCommand();
da.Update(dt);
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}
catch (Exception ex)
{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);
}

www.globsynskills.com

50

protected void gv_student_SelectedIndexChanged(object sender, EventArgs e)


{

}
}

ALERT.CS

using System.Web;
using System.Text;
using System.Web.UI;

/// <summary>
/// A JavaScript alert
/// </summary>
public static class Alert

www.globsynskills.com

51

/// <summary>
/// Shows a client-side JavaScript alert in the browser.
/// </summary>
/// <param name="message">The message to appear in the alert.</param>
public static void Show(string message)
{
// Cleans the message to allow single quotation marks
string cleanMessage = message.Replace("'", "\\'");
string script = "<script type=\"text/javascript\">alert('" + cleanMessage + "');</script>";

// Gets the executing web page


Page page = HttpContext.Current.CurrentHandler as Page;

// Checks if the handler is a Page and that the script isn't allready on the Page
if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
{

www.globsynskills.com

52

page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);


}
}

SQULITITY.CS

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
/// <summary>
/// Summary description for SqlUtility
/// </summary>

www.globsynskills.com

53

public class SqlUtility


{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader dr = null;
public SqlConnection getcon()
{
string constr = ConfigurationManager.ConnectionStrings["dbcon"].ToString();
SqlConnection con = new SqlConnection(constr);
return con;
}
public int ins_up_del(string query, SqlParameter[] list)
{
int rows = 0;
con = getcon();
cmd = new SqlCommand(query, con);
if (list != null)
cmd.Parameters.AddRange(list);

www.globsynskills.com

54

try
{
con.Open();
rows = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
return rows;
}

public DataTable getdatatable(string query, SqlParameter[] list)


{
con = getcon();
DataTable dt = new DataTable();

cmd = new SqlCommand(query, con);

www.globsynskills.com

55

if (list != null)
{
cmd.Parameters.AddRange(list);
}
try
{
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dt);
}
catch (Exception ex)
{
throw ex;
}
return dt;
}

DataSet ds = new DataSet();

www.globsynskills.com

56

public DataSet getDataSet(string query, string table, SqlParameter[] list)


{
con = getcon();
con.Open();
cmd = new SqlCommand(query, con);

if (list != null)
{
cmd.Parameters.AddRange(list);

}
try
{
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(ds, table);
}
catch (Exception ex)
{

www.globsynskills.com

57

throw ex;

}
return ds;
}

public SqlDataReader getData(string query, SqlParameter[] list)


{
con = getcon();
cmd = new SqlCommand(query, con);
if (list != null)
cmd.Parameters.AddRange(list);
try
{
//con.Open();
dr = cmd.ExecuteReader();

www.globsynskills.com

58

catch (Exception ex)


{
throw ex;
}
return dr;
}
public void closeAll()
{
if (cmd != null)
{
cmd.Dispose();
cmd = null;
}
if (con != null)
{
con.Close();
con = null;
}

www.globsynskills.com

59

if (dr != null)
{
dr.Close();
dr = null;
}

}
}

ADD_COURSE

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

www.globsynskills.com

60

using System.Data.SqlClient;

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


{
string eid;
private string autogenerate()
{
SqlUtility su = new SqlUtility();
query = "select Course_id from Add_Course";
DataTable dt = su.getdatatable(query, null);
if (dt.Rows.Count == 0)
{
eid = "C001";
}
else
{
eid = dt.Rows[dt.Rows.Count - 1]["Course_id"].ToString();

www.globsynskills.com

61

string str = eid.Substring(1, 3);


int y = System.Convert.ToInt32(str);
if (y >= 1 && y < 9)
{
y = y + 1;
eid = "C00" + y;
}
if (y >= 9 && y < 99)
{
y = y + 1;
eid = "C0" + y;
}
if (y >= 99)
{
y = y + 1;
eid = "C" + y;
}
}

www.globsynskills.com

62

return eid;
}
protected void Page_Load(object sender, EventArgs e)
{
txt_cid.Text = autogenerate();
}
SqlUtility su = new SqlUtility();
string query;
SqlParameter[] list;
int x;

protected void btn_addcourse_Click(object sender, EventArgs e)


{

SqlConnection con = su.getcon();


query = "Insert into Add_Course(Course_id,Course_Name,Total_Seat,Duration,Syllabus,Fees)
values(@cid,@Course_Name,@Total_Seat,@Duration,@Syllabus,@Fees)";

www.globsynskills.com

63

//query="Insert into
Student(S_id,name,address,phone_no)values(@S_id,@name,@address,@ph_no");
list = new SqlParameter[6];
list[0] = new SqlParameter("@cid", txt_cid.Text);
list[1] = new SqlParameter("@Course_Name",txt_cname.Text);
list[2] = new SqlParameter("@Total_Seat", Convert.ToInt32(txt_capacity.Text));
list[3] = new SqlParameter("@Duration", Convert.ToInt32(txt_Duration.Text));
list[4] = new SqlParameter("@Syllabus",txt_syllabus.Text);
list[5] = new SqlParameter("@Fees", Convert.ToInt32(txt_fees.Text));

x = su.ins_up_del(query, list);

if (x > 0)
{
Alert.Show("Details Successfully saved");
}
}

www.globsynskills.com

64

protected void btn_reset_Click(object sender, EventArgs e)


{
txt_cname.Text = "";
txt_capacity.Text = "";
txt_Duration.Text = "";
}
}

DEFAULT.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 Faculty_Default : System.Web.UI.Page


{

www.globsynskills.com

65

protected void Page_Load(object sender, EventArgs e)


{
lbl_welcome.Text = "Welcome Faculty";
}
protected void btn_managestud_Click(object sender, EventArgs e)
{
Response.Redirect("Manage_Students.aspx");
}
protected void tn_addcourse_Click(object sender, EventArgs e)
{
Response.Redirect("Add_Course.aspx");
}
protected void btn_managecourse_Click(object sender, EventArgs e)
{
Response.Redirect("Manage_Course.aspx");
}
}
FACULT_MASTER

www.globsynskills.com

66

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

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

www.globsynskills.com

67

FormsAuthentication.SignOut();
Session.Clear();
Response.Redirect("~/Login.aspx");
}

protected void btn_chpass_Click(object sender, EventArgs e)


{
Response.Redirect("~/Change_Password.aspx");
}
}

MANAGE_COURSE

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

www.globsynskills.com

68

using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

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


{
DataSet ds;
SqlConnection con;
string x, query;
SqlDataAdapter da;
SqlUtility su = new SqlUtility();
protected void gv_cms_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
ds.Clear();
query = "select * from Add_Course order by " + e.SortExpression;

www.globsynskills.com

69

ds = su.getDataSet(query, "Course", null);


gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

}
protected void gv_cms_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
int index = e.NewEditIndex;
gv_cms.EditIndex = index;
gv_cms.DataSource = ds;

www.globsynskills.com

70

gv_cms.DataBind();

TextBox editbox = (TextBox)(gv_cms.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;
TextBox editbox1 = (TextBox)(gv_cms.Rows[index].Cells[5].Controls[0]);
editbox1.Enabled = false;
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);
}

}
protected void gv_cms_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{

www.globsynskills.com

71

int index = e.RowIndex;


GridViewRow gvr = gv_cms.Rows[index];
DataTable dt = ds.Tables["Course"];
DataRow dr = dt.Rows[index];
dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;
dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;
dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;
dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Add_Course", con);
//ds = su.getDataSet("select * from employees", "employees", null);

www.globsynskills.com

72

SqlCommandBuilder scb = new SqlCommandBuilder(da);


scb.GetUpdateCommand();
da.Update(ds, "Course");
gv_cms.EditIndex = -1;
gv_cms.DataSource = ds;
gv_cms.DataBind();
}
catch (Exception ex)
{
Response.Write("Exception = " + ex);
}
}
protected void gv_cms_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_cms_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{

www.globsynskills.com

73

gv_cms.EditIndex = -1;
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}
protected void gv_cms_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try
{
ds.Clear();
con = su.getcon();
con.Open();
ds = su.getDataSet("Select * from Add_Course", "Course", null);
int index = e.RowIndex;
DataTable dt = ds.Tables["Course"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Add_Course", con);

www.globsynskills.com

74

SqlCommandBuilder scb = new SqlCommandBuilder(da);


scb.GetDeleteCommand();
da.Update(dt);
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}
catch (Exception ex)
{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);
}
}

protected void gv_cms_SelectedIndexChanged(object sender, EventArgs e)


{

}
protected void Page_Load(object sender, EventArgs e)

www.globsynskills.com

75

{
try
{
query = "select * from Add_Course";
ds = su.getDataSet(query, "Course", null);
if (!Page.IsPostBack)
{
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}
}

www.globsynskills.com

76

}
MANAGE_STUDENT

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.SqlClient;

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


{
DataSet ds;
SqlConnection con;
string x, query;

www.globsynskills.com

77

SqlDataAdapter da;
SqlUtility su = new SqlUtility();

protected void gv_student_Sorting(object sender, GridViewSortEventArgs e)


{
try
{
ds.Clear();
query = "select * from Student_Registration order by " + e.SortExpression;
ds = su.getDataSet(query, "Student", null);
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

www.globsynskills.com

78

}
protected void gv_student_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
int index = e.NewEditIndex;
gv_student.EditIndex = index;
gv_student.DataSource = ds;
gv_student.DataBind();

TextBox editbox = (TextBox)(gv_student.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;
TextBox editbox1 = (TextBox)(gv_student.Rows[index].Cells[5].Controls[0]);
editbox1.Enabled = false;
}
catch (Exception ex)
{

www.globsynskills.com

79

// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);
}

}
protected void gv_student_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
int index = e.RowIndex;
GridViewRow gvr = gv_student.Rows[index];
DataTable dt = ds.Tables["Student"];
DataRow dr = dt.Rows[index];
dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;
dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;

www.globsynskills.com

80

dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;
dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr[7] = ((TextBox)gvr.Cells[8].Controls[0]).Text;
dr[8] = ((TextBox)gvr.Cells[9].Controls[0]).Text;
dr[9] = ((TextBox)gvr.Cells[10].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Student_Registration", con);
//ds = su.getDataSet("select * from employees", "employees", null);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetUpdateCommand();
da.Update(ds, "Student");
gv_student.EditIndex = -1;
gv_student.DataSource = ds;
gv_student.DataBind();

www.globsynskills.com

81

}
catch (Exception ex)
{
Response.Write("Exception = " + ex);
}
}
protected void gv_student_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_student_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gv_student.EditIndex = -1;
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}
protected void gv_student_RowDeleting(object sender, GridViewDeleteEventArgs e)
{

www.globsynskills.com

82

try
{
ds.Clear();
con = su.getcon();
con.Open();
ds = su.getDataSet("Select * from Student_Registration", "Student", null);
int index = e.RowIndex;
DataTable dt = ds.Tables["Student"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Student_Registration", con);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetDeleteCommand();
da.Update(dt);
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}

www.globsynskills.com

83

catch (Exception ex)


{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);
}
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
query = "select * from Student_Registration";
ds = su.getDataSet(query, "Student", null);
if (!Page.IsPostBack)
{
gv_student.DataSource = ds.Tables["Student"];
gv_student.DataBind();
}

www.globsynskills.com

84

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

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

}
}

STUDENT_DEFAULT

using System;
using System.Collections.Generic;

www.globsynskills.com

85

using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

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


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

protected void btn_viewcourse_Click(object sender, EventArgs e)


{
Response.Redirect("View_Course.aspx");
}
}

www.globsynskills.com

86

STUDENT_MASTER

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

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

www.globsynskills.com

87

Response.Redirect("~/Login.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("~/Change_Password.aspx");
}
}

VIEW _COURSE

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.SqlClient;

www.globsynskills.com

88

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


{
DataSet ds;
SqlConnection con;
string x, query;
SqlDataAdapter da;
SqlUtility su = new SqlUtility();
protected void gv_cms_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
ds.Clear();
query = "select * from Add_Course order by " + e.SortExpression;
ds = su.getDataSet(query, "Course", null);
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}

www.globsynskills.com

89

catch (Exception ex)


{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

}
protected void gv_cms_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
int index = e.NewEditIndex;
gv_cms.EditIndex = index;
gv_cms.DataSource = ds;
gv_cms.DataBind();

TextBox editbox = (TextBox)(gv_cms.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;

www.globsynskills.com

90

TextBox editbox1 = (TextBox)(gv_cms.Rows[index].Cells[5].Controls[0]);


editbox1.Enabled = false;
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);
}

}
protected void gv_cms_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
int index = e.RowIndex;
GridViewRow gvr = gv_cms.Rows[index];
DataTable dt = ds.Tables["Course"];
DataRow dr = dt.Rows[index];

www.globsynskills.com

91

dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;
dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;
dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;
dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Add_Course", con);
//ds = su.getDataSet("select * from employees", "employees", null);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetUpdateCommand();
da.Update(ds, "Course");
gv_cms.EditIndex = -1;

www.globsynskills.com

92

gv_cms.DataSource = ds;
gv_cms.DataBind();
}
catch (Exception ex)
{
Response.Write("Exception = " + ex);
}
}
protected void gv_cms_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_cms_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gv_cms.EditIndex = -1;
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}

www.globsynskills.com

93

protected void gv_cms_RowDeleting(object sender, GridViewDeleteEventArgs e)


{
try
{
ds.Clear();
con = su.getcon();
con.Open();
ds = su.getDataSet("Select * from Add_Course", "Course", null);
int index = e.RowIndex;
DataTable dt = ds.Tables["Course"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Add_Course", con);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetDeleteCommand();
da.Update(dt);
gv_cms.DataSource = ds.Tables["Course"];

www.globsynskills.com

94

gv_cms.DataBind();
}
catch (Exception ex)
{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);
}
}

protected void Page_Load(object sender, EventArgs e)


{
try
{
query = "select * from Add_Course";
ds = su.getDataSet(query, "Course", null);

www.globsynskills.com

95

if (!Page.IsPostBack)
{
gv_cms.DataSource = ds.Tables["Course"];
gv_cms.DataBind();
}

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}
}
protected void gv_cms_SelectedIndexChanged(object sender, EventArgs e)
{

}
}

www.globsynskills.com

96

FACULTY_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.SqlClient;

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


{
DataSet ds;
SqlConnection con;
string x, query;
SqlDataAdapter da;

www.globsynskills.com

97

SqlUtility su = new SqlUtility();


protected void gv_faculty_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
ds.Clear();
query = "select * from Faculty_Registration order by " + e.SortExpression;
ds = su.getDataSet(query, "Faculty", null);
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Response.Write(" " + ex);
}

www.globsynskills.com

98

protected void gv_faculty_RowEditing(object sender, GridViewEditEventArgs e)


{
try
{
int index = e.NewEditIndex;
gv_faculty.EditIndex = index;
gv_faculty.DataSource = ds;
gv_faculty.DataBind();

TextBox editbox = (TextBox)(gv_faculty.Rows[index].Cells[1].Controls[0]);


editbox.Enabled = false;
TextBox editbox1 = (TextBox)(gv_faculty.Rows[index].Cells[5].Controls[0]);
editbox1.Enabled = false;
}
catch (Exception ex)
{
// Alert.Show("Exception Caught");
Console.WriteLine("Exception = " + ex);

www.globsynskills.com

99

}
protected void gv_faculty_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
int index = e.RowIndex;
GridViewRow gvr = gv_faculty.Rows[index];
DataTable dt = ds.Tables["Faculty"];
DataRow dr = dt.Rows[index];
dr.BeginEdit();
x = ((TextBox)gvr.Cells[1].Controls[0]).Text;
dr[1] = ((TextBox)gvr.Cells[2].Controls[0]).Text;
dr[2] = ((TextBox)gvr.Cells[3].Controls[0]).Text;
dr[3] = ((TextBox)gvr.Cells[4].Controls[0]).Text;
dr[4] = ((TextBox)gvr.Cells[5].Controls[0]).Text;
dr[5] = ((TextBox)gvr.Cells[6].Controls[0]).Text;

www.globsynskills.com

10
0

dr[6] = ((TextBox)gvr.Cells[7].Controls[0]).Text;
dr[7] = ((TextBox)gvr.Cells[8].Controls[0]).Text;
dr.EndEdit();
con = su.getcon();
con.Open();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("Select * from Faculty_Registration", con);
//ds = su.getDataSet("select * from employees", "employees", null);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetUpdateCommand();
da.Update(ds, "Faculty");
gv_faculty.EditIndex = -1;
gv_faculty.DataSource = ds;
gv_faculty.DataBind();
}
catch (Exception ex)
{
Response.Write("Exception = " + ex);

www.globsynskills.com

10
1

}
}
protected void gv_faculty_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{

}
protected void gv_faculty_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gv_faculty.EditIndex = -1;
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
protected void gv_faculty_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try
{
ds.Clear();
con = su.getcon();

www.globsynskills.com

10
2

con.Open();
ds = su.getDataSet("Select * from Faculty_Registration", "Faculty", null);
int index = e.RowIndex;
DataTable dt = ds.Tables["Faculty"];
DataRow dr = dt.Rows[index];
dr.Delete();
da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from Faculty_Registration", con);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
scb.GetDeleteCommand();
da.Update(dt);
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}
catch (Exception ex)
{
//Alert.Show("Exception caught");
Response.Write("Exception = " + ex);

www.globsynskills.com

10
3

}
}

protected void gv_faculty_SelectedIndexChanged(object sender, EventArgs e)


{

}
protected void Page_Load(object sender, EventArgs e)
{
try
{
query = "select * from Faculty_Registration";
ds = su.getDataSet(query, "Faculty", null);
if (!Page.IsPostBack)
{
gv_faculty.DataSource = ds.Tables["Faculty"];
gv_faculty.DataBind();
}

www.globsynskills.com

10
4

}
catch (Exception ex)
{
//Alert.Show("Exception Caught");
Response.Write(" " + ex);
}
}
}
HOME_PAGE

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

www.globsynskills.com

10
5

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btn_reg_Click(object sender, EventArgs e)
{
Response.Redirect("Registration.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Home.aspx");
}

www.globsynskills.com

10
6

protected void Button2_Click(object sender, EventArgs e)


{
Response.Redirect("About_Us.aspx");
}
protected void btn_course_Click(object sender, EventArgs e)
{
Response.Redirect("Contact_Us.aspx");
}
protected void btn_home_Click(object sender, EventArgs e)
{
Response.Redirect("Home.aspx");
}
protected void btn_course2_Click(object sender, EventArgs e)
{
Response.Redirect("Courses.aspx");
}
protected void btn_gallery_Click(object sender, EventArgs e)
{

www.globsynskills.com

10
7

Response.Redirect("Gallery.aspx");
}
protected void btn_faculty_Click(object sender, EventArgs e)
{
Response.Redirect("Faculty.aspx");
}
protected void btn_admission_Click(object sender, EventArgs e)
{
Response.Redirect("Admission.aspx");
}
}

LOG_IN

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

www.globsynskills.com

10
8

using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

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


{
string strConnString = ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString;
string str = null;
SqlCommand com;
protected void Page_Load(object sender, EventArgs e)
{

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

www.globsynskills.com

10
9

object obj = null;


SqlConnection con = new SqlConnection(strConnString);
con.Open();
if (ddl_login.SelectedItem.ToString() == "Admin")
{
Session["E_mail"] = txt_email.Text;
str = "select count(*) from Admin where E_mail=@E_mail and Password =@Password";
com = new SqlCommand(str, con);
com.CommandType = CommandType.Text;
com.Parameters.AddWithValue("@E_mail", Session["E_mail"]);
com.Parameters.AddWithValue("@Password", txt_password.Text);
obj = com.ExecuteScalar();
if ((int)(obj) != 0)
{
Response.Redirect("Admin/Default.aspx");
}
else
{

www.globsynskills.com

11
0

lbl_note.Text = "Invalid Username and Password";


}
con.Close();
}
else if (ddl_login.SelectedItem.ToString() == "Faculty")
{
Session["E_mail"] = txt_email.Text;
str = "select count(*) from Login where E_mail=@E_mail and Password =@Password";
com = new SqlCommand(str, con);
com.CommandType = CommandType.Text;
com.Parameters.AddWithValue("@E_mail", Session["E_mail"]);
com.Parameters.AddWithValue("@Password", txt_password.Text);
obj = com.ExecuteScalar();
if ((int)(obj) != 0)
{
Response.Redirect("Faculty/Default.aspx");
}
else

www.globsynskills.com

11
1

{
lbl_note.Text = "Invalid Username and Password";
}
con.Close();
}
else if (ddl_login.SelectedItem.ToString() == "Student")
{
Session["E_mail"] = txt_email.Text;
str = "select count(*) from Login where E_mail=@E_mail and Password =@Password";
com = new SqlCommand(str, con);
com.CommandType = CommandType.Text;
com.Parameters.AddWithValue("@E_mail", Session["E_mail"]);
com.Parameters.AddWithValue("@Password", txt_password.Text);
obj = com.ExecuteScalar();
if ((int)(obj) != 0)
{
Response.Redirect("Student/Default.aspx");
}

www.globsynskills.com

11
2

else
{
lbl_note.Text = "Invalid Username and Password";
}
con.Close();
}

}
protected void btn_reset_Click(object sender, EventArgs e)
{
txt_email.Text = "";
txt_password.Text = "";
}
}

REGISTATION_ASPX

www.globsynskills.com

11
3

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.SqlClient;

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


{
string eid;
private string autogenerate()

//Take Char(4) for empid

{
SqlUtility su = new SqlUtility();
query = "select Student_id from Student_Registration";
DataTable dt = su.getdatatable(query, null);
if (dt.Rows.Count == 0)

www.globsynskills.com

11
4

{
eid = "S001";
}
else
{
eid = dt.Rows[dt.Rows.Count - 1]["Student_id"].ToString();

string str = eid.Substring(1, 3);


int y = System.Convert.ToInt32(str);
if (y >= 1 && y < 9)
{
y = y + 1;
eid = "S00" + y;
}
if (y >= 9 && y < 99)
{
y = y + 1;
eid = "S0" + y;

www.globsynskills.com

11
5

}
if (y >= 99)
{
y = y + 1;
eid = "S" + y;
}
}
return eid;
}
protected void Page_Load(object sender, EventArgs e)
{
txt_sid.Text = autogenerate();
}

protected void btn_reset_Click(object sender, EventArgs e)


{
txt_fname.Text = "";
txt_lname.Text = "";

www.globsynskills.com

11
6

txt_addr.Text = "";
txt_email.Text = "";
txt_phno.Text = "";
rbtn_male.Checked = false;
rbtn_female.Checked = false;
}
SqlUtility su = new SqlUtility();
string query, query1;
SqlParameter[] list, list1;
int x, x1;

protected void btn_register_Click1(object sender, EventArgs e)


{
string Student;
if (rbtn_male.Checked)
{
Student = rbtn_male.Text;
}

www.globsynskills.com

11
7

else
{
Student = rbtn_female.Text;
}
try
{
SqlConnection con = su.getcon();
query = "Insert into
Student_Registration(Student_id,Firstname,Lastname,Address,Gender,Timing,Phone_no,Course)
values(@sid,@Firstname,@Lastname,@Address,@Gender,@Timing,@Phone_no,@Course)";
//query="Insert into
Student(S_id,name,address,phone_no)values(@S_id,@name,@address,@ph_no");
list = new SqlParameter[8];
list[0] = new SqlParameter("@sid", txt_sid.Text);
list[1] = new SqlParameter("@Firstname", txt_fname.Text);
list[2] = new SqlParameter("@Lastname", txt_lname.Text);
list[3] = new SqlParameter("@Address", txt_addr.Text);
list[4] = new SqlParameter("@Gender", Student);
list[5] = new SqlParameter("@Timing", lbx_timing.Text);

www.globsynskills.com

11
8

list[6] = new SqlParameter("@Course", ddl_course.SelectedItem.ToString());


list[7] = new SqlParameter("@Phone_no", Convert.ToInt32(txt_phno.Text));
x = su.ins_up_del(query, list);
query1 = "Insert into Login(E_mail,Password,Logon_Type)
values(@E_mail,@Password,@Logon_Type)";
list1 = new SqlParameter[3];
list1[0] = new SqlParameter("@E_mail", txt_email.Text);
list1[1] = new SqlParameter("@Password", txt_pass.Text);
list1[2] = new SqlParameter("@Logon_Type", "Student");
x1 = su.ins_up_del(query1, list1);

if ((x > 0) && (x1 > 0))


{
Alert.Show("Details Successfully saved");
}
else
{
Alert.Show("Error in Saving");

www.globsynskills.com

11
9

}
}
catch (Exception ex)
{
Alert.Show("Exception :" + ex);
}

}
}

www.globsynskills.com

12
0

Certificate

This is to certify that Mr. RAKESH SHAW, of COLLEGE OF ENGINEERING & MANAGEMENT,
KOLAGHAT, Registration number: 111070110097 of 2011-2012, has successfully completed a
project on ONLINE STUDENT ENROLLMENT SYSTEM using .NET under the guidance of Mr.
RAKESH KUMAR PANDIT.
--- --------------------------------------------------MR.RAKESH KUMAR PANDIT

Globsyn Finishing School


(a division of Globsyn Skills)

www.globsynskills.com

12
1

Certificate

This is to certify that Mr. SAYANTAN SAMADDAR, of , HERITAGE INSTITUTE OF TECHNOLOGY,


Registration number: , 131260120059 of 2013-14, has successfully completed a project on
ONLINE STUDENT ENROLLMENT SYSTEM using .NET under the guidance of Mr. RAKESH
KUMAR PANDIT.
--- --------------------------------------------------MR.RAKESH KUMAR PANDIT

Globsyn Finishing School


(a division of Globsyn Skills)

www.globsynskills.com

12
2

Certificate

This is to certify that Mr. PRASENJIT SAMANTA, of COLLEGE OF ENGINEERING &


MANAGEMENT, KOLAGHAT, Registration number: 111070110093 of 2011-2012, has
successfully completed a project on ONLINE STUDENT ENROLLMENT SYSTEM using .NET
under the guidance of Mr. RAKESH KUMAR PANDIT.
--- --------------------------------------------------MR.RAKESH KUMAR PANDIT

Globsyn Finishing School


(a division of Globsyn Skills)

www.globsynskills.com

12
3

Certificate

This is to certify that Mr. TUHIN DEY, of COLLEGE OF ENGINEERING & MANAGEMENT,
KOLAGHAT, Registration number: 111070110118 of 2011-2012, has successfully
completed a project on ONLINE STUDENT ENROLLMENT SYSTEM using .NET under
the guidance of Mr. RAKESH KUMAR PANDIT.

--- --------------------------------------------------MR.RAKESH KUMAR PANDIT

Globsyn Finishing School


(a division of Globsyn Skills)

www.globsynskills.com

12
4

Potrebbero piacerti anche