• No results found

Course.aspx.cs using System;

In document Online Learning Portal (Page 118-147)

using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient;

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

{

Connct c = new Connct();

protected void Page_Load(object sender, EventArgs e)

{

if (Session["uid"] == null) {

Response.Redirect("login.aspx?log=n"); }

else

{

if (Request.QueryString["sub"] == null) { if (!Page.IsPostBack) { Table1.Visible = false; Label1.Visible = false; Table2.Visible = false; Label2.Visible = false; Table3.Visible = false; Label3.Visible = false; Table4.Visible = false; Label4.Visible = false; } } else { Table1.Visible = false; Label1.Visible = false; Table2.Visible = false; Label2.Visible = false; Table3.Visible = false; Label3.Visible = false; Table4.Visible = false; Label4.Visible = false; if (Request.QueryString["sub"] == "cs") { Table1.Visible = true; Label1.Visible = true; c.con.Open();

string str = "select * from material where mat_subject='Computer Science'";

SqlCommand cmd = new SqlCommand(str, c.con); SqlDataReader dr = cmd.ExecuteReader(); int i = 0; int a = 1; while (dr.Read()) {

TableRow R = new TableRow(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell();

c1.Text = a.ToString();

System.Web.UI.WebControls.HyperLink h1 = new

HyperLink();

h1.NavigateUrl = "courseopen.aspx?mid=" + dr["mat_id"];

h1.Text = dr["mat_fname"].ToString(); c3.Controls.Add(h1);

c2.Text = dr["mat_des"].ToString(); c4.Text = dr["mat_dttm"].ToString(); R.Cells.Add(c1);

R.Cells.Add(c2); R.Cells.Add(c3); R.Cells.Add(c4);

c1.HorizontalAlign = HorizontalAlign.Center; c2.HorizontalAlign = HorizontalAlign.Left; c3.HorizontalAlign = HorizontalAlign.Left; c4.HorizontalAlign = HorizontalAlign.Center; Table1.Rows.Add(R); i = i + 1; a = a + 1; } if (i > 0) { Label1.Visible = false; Table1.Visible = true; } else { Label1.Visible = true; Table1.Visible = false; } dr.Close(); c.con.Close(); } if (Request.QueryString["sub"] == "m") { Table3.Visible = true; Label3.Visible = true; c.con.Open();

string str = "select * from material where mat_subject='Maths'";

SqlCommand cmd = new SqlCommand(str, c.con); SqlDataReader dr = cmd.ExecuteReader(); int i = 0; int a = 1; while (dr.Read()) {

TableRow R = new TableRow(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell(); c1.Text = a.ToString();

System.Web.UI.WebControls.HyperLink h1 = new

HyperLink();

h1.NavigateUrl = "courseopen.aspx?mid=" + dr["mat_id"];

h1.Text = dr["mat_orgname"].ToString(); c3.Controls.Add(h1);

c2.Text = dr["mat_des"].ToString(); c4.Text = dr["mat_dttm"].ToString(); R.Cells.Add(c1);

R.Cells.Add(c2); R.Cells.Add(c3); R.Cells.Add(c4);

c1.HorizontalAlign = HorizontalAlign.Center; c2.HorizontalAlign = HorizontalAlign.Left; c3.HorizontalAlign = HorizontalAlign.Left; c4.HorizontalAlign = HorizontalAlign.Center; Table3.Rows.Add(R); i = i + 1; a = a + 1; } if (i > 0) { Label3.Visible = false; Table3.Visible = true; } else { Label3.Visible = true; Table3.Visible = false; } dr.Close(); c.con.Close(); } if (Request.QueryString["sub"] == "p") { Table4.Visible = true; Label4.Visible = true; c.con.Open();

string str = "select * from material where mat_subject='Physics'";

SqlCommand cmd = new SqlCommand(str, c.con); SqlDataReader dr = cmd.ExecuteReader(); int i = 0; int a = 1; while (dr.Read()) {

TableRow R = new TableRow(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell(); c1.Text = a.ToString();

System.Web.UI.WebControls.HyperLink h1 = new

HyperLink();

h1.NavigateUrl = "courseopen.aspx?mid=" + dr["mat_id"];

h1.Text = dr["mat_orgname"].ToString(); c3.Controls.Add(h1);

c2.Text = dr["mat_des"].ToString(); c4.Text = dr["mat_dttm"].ToString(); R.Cells.Add(c1);

R.Cells.Add(c2); R.Cells.Add(c3); R.Cells.Add(c4);

c1.HorizontalAlign = HorizontalAlign.Center; c2.HorizontalAlign = HorizontalAlign.Left; c3.HorizontalAlign = HorizontalAlign.Left; c4.HorizontalAlign = HorizontalAlign.Center; Table4.Rows.Add(R); i = i + 1; a = a + 1; } if (i > 0) { Label4.Visible = false; Table4.Visible = true; } else { Label4.Visible = true; Table4.Visible = false; } dr.Close(); c.con.Close(); }

if (Request.QueryString["sub"] == "eng") {

Table2.Visible = true; Label2.Visible = true; c.con.Open();

string str = "select * from material where mat_subject='English'";

SqlDataReader dr = cmd.ExecuteReader(); int i = 0;

int a = 1;

while (dr.Read()) {

TableRow R = new TableRow(); TableCell c1 = new TableCell(); TableCell c2 = new TableCell(); TableCell c3 = new TableCell(); TableCell c4 = new TableCell(); c1.Text = a.ToString();

System.Web.UI.WebControls.HyperLink h1 = new

HyperLink();

h1.NavigateUrl = "courseopen.aspx?mid=" + dr["mat_id"];

h1.Text = dr["mat_orgname"].ToString(); c3.Controls.Add(h1);

c2.Text = dr["mat_des"].ToString(); c4.Text = dr["mat_dttm"].ToString(); R.Cells.Add(c1);

R.Cells.Add(c2); R.Cells.Add(c3); R.Cells.Add(c4);

c1.HorizontalAlign = HorizontalAlign.Center; c2.HorizontalAlign = HorizontalAlign.Left; c3.HorizontalAlign = HorizontalAlign.Left; c4.HorizontalAlign = HorizontalAlign.Center; Table2.Rows.Add(R); i = i + 1; a = a + 1; } if (i > 0) { Label2.Visible = false; Table2.Visible = true; } else { Label2.Visible = true; Table2.Visible = false; } dr.Close(); c.con.Close(); } } } } } Adsendmail.aspx

<%@ Page Language="C#" MasterPageFile="~/admin.master"

AutoEventWireup="true" CodeFile="adsendmail.aspx.cs"

Inherits="adsendmail" Title="::ADMIN ONLINE RECRUITMENT SYSTEM ::" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"

Runat="Server">

<asp:Label ID="Label1" runat="server" Text=""

Visible="false"></asp:Label><br />

<asp:Label ID="lbl_ID" runat="server" Text="Label"></asp:Label><br

/>

<br />

<asp:Label ID="lbl_name" runat="server" Text="Label"></asp:Label><br

/>

<br />

<br />

<asp:Label ID="lbl_pwd" runat="server" Text="Label"></asp:Label><br

/> <br /> <br /> <br /> <br /> <br /> </asp:Content> Adsendmail.aspx.cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient;

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

{

Connct c = new Connct();

protected void Page_Load(object sender, EventArgs e)

{

if (Session["aid"] == null) { Response.Redirect("index.aspx?q=n"); } if (Request.QueryString["us_id"] != "") { int i;

string[] quid = Request.QueryString["us_id"].Split(','); for (i = 0; i < quid.Length - 1; i++) ;

int val = Convert.ToInt32(quid[i]); for (i = 0; i < quid.Length; i++)

{

Session["quid"] = quid[i].ToString(); c.con.Open();

string str = "select * from usr where u_id=" + quid[i]; SqlCommand cmd = new SqlCommand(str, c.con);

SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read())

{

lbl_ID.Text = dr["u_id"].ToString(); lbl_name.Text = dr["u_name"].ToString(); lbl_pwd.Text = dr["u_pwd"].ToString(); }

dr.Close(); c.con.Close(); c.con.Open();

string str2 = "select * from usr_mail order by m_id"; SqlCommand cmd2 = new SqlCommand(str2, c.con);

SqlDataReader dr2 = cmd2.ExecuteReader(); int i1 = 0;

while (dr2.Read()) {

int a = 0;

a = Convert.ToInt32(dr2["m_id"].ToString()); ViewState["mid"] = a.ToString();

i1 = i1 + 1; }

if (i1 > 0) {

int a =

Convert.ToInt32(ViewState["mid"].ToString()); a = a + 1;

ViewState ["id"] = a.ToString(); }

else

ViewState ["id"] = "10201"; c.con.Close();

c.con.Open();

string body = "Hi " + lbl_name.Text + ",\r\nYou are selected for the written test.\r\n Your login details are : \r\n\r\n ID:- " + lbl_ID.Text + "\r\nPassword: " + lbl_pwd.Text + "\r\nBest Of Luck.\r\n \r\nThanks & Regards, \r\nAdmin";

string abc = "insert into

usr_mail(m_id,m_usrid,m_sendby,m_dttm,m_sub,m_body) values(" + ViewState["id"].ToString() + ",'" + quid[i] + "','Admin','" +

System.DateTime.Now.ToString() + "','Admit Card Details','" + body +

"')";

SqlCommand cmd1 = new SqlCommand(abc, c.con); cmd1.ExecuteNonQuery(); if (i == 0) Label1.Text += quid[i]; else Label1.Text += "," + quid[i]; //i = i + 1; c.con.Close(); } }

Response.Redirect("adsearch.aspx?com=" + Label1.Text); }

}

Front master

<%@ Master Language="C#" AutoEventWireup="true"

CodeFile="front.master.cs" Inherits="front" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" >

<head id="Head1" runat="server"> <style type ="text/css">

body { valign="top"; margin:0px; } </style>

<script language="JavaScript1.1" type="text/javascript">

//specify interval between slide (in mili seconds)

var slidespeed=3000

//specify images

var slideimages=new Array("images/1.JPG","images/2.JPG","images/3.JPG")

//specify corresponding links

var slidelinks=new Array("#","#","#")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()

var ie=document.all

for (i=0;i<slideimages.length;i++){ imageholder[i]=new Image()

imageholder[i].src=slideimages[i] } function gotoshow(){ if (newwindow) window.open(slidelinks[whichlink]) else window.location=slidelinks[whichlink] } function DL1_onclick() { } //--> </script>

<title>:: ONLINE RECRUITMENT SYSTEM ::</title> </head>

<body background="images/bg.jpg" style="font-size: 10pt">

<form id="form1" runat="server">

<div>

<table width="100%" border="1" cellpadding ="0" cellspacing ="0"

bordercolor="black">

<tr><td colspan ="2" height="60">

<table width="100%" cellpadding ="0" cellspacing ="0"><tr><td

align="left"><img src ="images/logo.jpg" height="60" width="150" /></td><td align="center">

<span style="font-family: Times New Roman">

<FONT COLOR="WHITE" size="6">

ONLINE RECRUITMENT SYSTEM</FONT> </span>

</td><td align="right">

<img src ="images/logo.JPG" height="60" width="150" /></td></tr></table>

</td></tr>

<tr><td align="left" valign ="top" width="17%">

<table><tr><td valign="middle" height="25"><font color="black"

size="1">>></font></td>

<td><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl

="~/home.aspx">Home</asp:HyperLink></td></tr>

<tr><td valign="middle" height="25"><font color="black"

size="1">>></font></td>

<td><asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl

="~/login.aspx">Login</asp:HyperLink></td></tr>

<tr><td valign="middle" height="25"><font color="black"

size="1">>></font></td>

<td><asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl

="~/newuser.aspx">New User</asp:HyperLink></td></tr> <tr><td valign="middle" height="25"><font color="black"

size="1">>></font></td>

<td><asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl

="~/testlogin.aspx">Online Test</asp:HyperLink></td></tr> <tr><td valign="middle" height="25"><font color="black"

size="1">>></font></td>

<td><asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl

="~/report.aspx">Report</asp:HyperLink></td></tr>

</table> </td>

<td width="83%" valign="top">

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</td>

</tr>

<tr><td colspan ="2" align="center"><font size="1">!!....Online Recruitment System....!!</font></td></tr>

<tr><td colspan ="2" align="center"><font size="1">!!....Best Viewed in 1024x768....!!</font></td></tr> </table> </div> </form> </body> </html>

Front master.cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

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

{

protected void Page_Load(object sender, EventArgs e)

{ } }

Logout.aspx

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"

AutoEventWireup="true" CodeFile="logout.aspx.cs" Inherits="logout"

Title=":: Online Learning Portal ::" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"

Runat="Server"> </asp:Content> Logout.aspx.cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

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

protected void Page_Load(object sender, EventArgs e) {

Session["aid"] = null; Session["uid"] = null;

Session["stud"] = null;

Response.Redirect("home.aspx"); }

}

Newusr.aspx

<%@ Page Language="C#" MasterPageFile="~/front.master"

AutoEventWireup="true" CodeFile="newuser.aspx.cs" Inherits="newuser"

Title=":: ONLINE RECRUITMENT SYSTEM ::" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"

Runat="Server">

<span style="color: #000000">

<br />

&gt;&gt;&nbsp; New User<br />

<hr color="black" size="2" width="100%" />

</span>

<table id="Table2" align="center" style="color: #ffffff">

<tr>

<td align="center" colspan="3" height="25">

<asp:Label ID="Label9" runat="server" Font-Bold="True"

ForeColor="Red" Visible="False"></asp:Label></td>

</tr>

<tr style="color: #000000">

<td align="right" height="25">

<asp:Label ID="Label1" runat="server" Text="User ID :"></asp:Label></td>

<td colspan="2">

<span style="font-size: 7pt; color: #ff0000">&nbsp;</span><asp:TextBox ID="txt_cid"

runat="server" ReadOnly="true"

Width="93px"></asp:TextBox>

</td>

</tr>

<tr style="color: #000000">

<td align="right" height="25">

<asp:Label ID="Label2" runat="server"

Text="Password :"></asp:Label></td>

<td colspan="2">

&nbsp;<asp:TextBox ID="txt_pass" runat="server"

MaxLength="15" TabIndex="1" TextMode="Password"

Width="93px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator4"

runat="server" ControlToValidate="txt_pass"

ErrorMessage="*"></asp:RequiredFieldValidator></td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label3" runat="server" ForeColor="Black"

Text="Name :"></asp:Label>

<td colspan="2">

&nbsp;<asp:TextBox ID="txt_cname" runat="server"

CausesValidation="True" MaxLength="30"

TabIndex="2" Width="230px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1"

runat="server" ControlToValidate="txt_cname"

ErrorMessage="*"></asp:RequiredFieldValidator></td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label6" runat="server" ForeColor="Black"

Text="Father's Name :"></asp:Label>

</td>

<td colspan="2">

&nbsp;<asp:TextBox ID="txt_fname" runat="server"

CausesValidation="True" MaxLength="30"

TabIndex="3" Width="230px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator3"

runat="server" ControlToValidate="txt_fname"

ErrorMessage="*"></asp:RequiredFieldValidator></td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label13" runat="server" ForeColor="Black"

Text="Date Of Birth :"></asp:Label>

</td>

<td colspan="2">

&nbsp;<asp:DropDownList ID="ddl_dte" runat="server"

TabIndex="4">

<asp:ListItem Text="----Date----"></asp:ListItem>

<asp:ListItem Text="01"></asp:ListItem>

<asp:ListItem Text="02"></asp:ListItem>

<asp:ListItem Text="03"></asp:ListItem>

<asp:ListItem Text="04"></asp:ListItem>

<asp:ListItem Text="05"></asp:ListItem>

<asp:ListItem Text="06"></asp:ListItem>

<asp:ListItem Text="07"></asp:ListItem> <asp:ListItem Text="08"></asp:ListItem>

<asp:ListItem Text="09"></asp:ListItem>

<asp:ListItem Text="10"></asp:ListItem>

<asp:ListItem Text="11"></asp:ListItem>

<asp:ListItem Text="12"></asp:ListItem>

<asp:ListItem Text="13"></asp:ListItem>

<asp:ListItem Text="14"></asp:ListItem>

<asp:ListItem Text="15"></asp:ListItem>

<asp:ListItem Text="16"></asp:ListItem>

<asp:ListItem Text="17"></asp:ListItem>

<asp:ListItem Text="18"></asp:ListItem>

<asp:ListItem Text="19"></asp:ListItem>

<asp:ListItem Text="20"></asp:ListItem>

<asp:ListItem Text="21"></asp:ListItem>

<asp:ListItem Text="22"></asp:ListItem>

<asp:ListItem Text="23"></asp:ListItem>

<asp:ListItem Text="24"></asp:ListItem>

<asp:ListItem Text="25"></asp:ListItem>

<asp:ListItem Text="26"></asp:ListItem>

<asp:ListItem Text="28"></asp:ListItem>

<asp:ListItem Text="29"></asp:ListItem>

<asp:ListItem Text="30"></asp:ListItem>

<asp:ListItem Text="31"></asp:ListItem>

</asp:DropDownList>

&nbsp;<asp:DropDownList ID="ddl_mon" runat="server"

TabIndex="5">

<asp:ListItem Text="----Month----"></asp:ListItem>

<asp:ListItem Text="Jan"></asp:ListItem>

<asp:ListItem Text="Feb"></asp:ListItem>

<asp:ListItem Text="Mar"></asp:ListItem>

<asp:ListItem Text="Apr"></asp:ListItem>

<asp:ListItem Text="May"></asp:ListItem>

<asp:ListItem Text="Jun"></asp:ListItem>

<asp:ListItem Text="Jul"></asp:ListItem>

<asp:ListItem Text="Aug"></asp:ListItem>

<asp:ListItem Text="Sep"></asp:ListItem>

<asp:ListItem Text="Oct"></asp:ListItem>

<asp:ListItem Text="Nov"></asp:ListItem>

<asp:ListItem Text="Dec"></asp:ListItem>

</asp:DropDownList>

&nbsp;<asp:DropDownList ID="ddl_dobyr" runat="server"

TabIndex="6">

<asp:ListItem Text="----Year----"></asp:ListItem>

<asp:ListItem Text="1980"></asp:ListItem>

<asp:ListItem Text="1981"></asp:ListItem>

<asp:ListItem Text="1982"></asp:ListItem>

<asp:ListItem Text="1983"></asp:ListItem>

<asp:ListItem Text="1984"></asp:ListItem>

<asp:ListItem Text="1985"></asp:ListItem>

<asp:ListItem Text="1986"></asp:ListItem>

<asp:ListItem Text="1987"></asp:ListItem>

<asp:ListItem Text="1988"></asp:ListItem>

<asp:ListItem Text="1989"></asp:ListItem>

<asp:ListItem Text="1990"></asp:ListItem>

</asp:DropDownList>

</td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label4" runat="server" ForeColor="Black"

Text="Address :"></asp:Label>

</td>

<td colspan="2">

&nbsp;<asp:TextBox ID="txt_cadd" runat="server"

CausesValidation="True" Height="58px"

MaxLength="250" TabIndex="7" TextMode="MultiLine"

Width="230px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2"

runat="server" ControlToValidate="txt_cadd"

ErrorMessage="*"></asp:RequiredFieldValidator></td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label5" runat="server" ForeColor="Black"

Text="Contact No :"></asp:Label>

<td colspan="2">

&nbsp;<asp:TextBox ID="txt_ccno" runat="server"

CausesValidation="True" MaxLength="10"

TabIndex="8" Width="230px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator6"

runat="server" ControlToValidate="txt_ccno"

ErrorMessage="*"></asp:RequiredFieldValidator>

<asp:RegularExpressionValidator

ID="RegularExpressionValidator2" runat="server"

ControlToValidate="txt_ccno"

ErrorMessage="Enter only Numbers"

ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>&nbsp;

</td>

</tr>

<tr>

<td align="right" height="25">

<asp:Label ID="Label7" runat="server" ForeColor="Black"

Text="Course/Degree :"></asp:Label></td>

<td colspan="2">

&nbsp;<asp:DropDownList ID="ddl_degree" runat="server"

TabIndex="9">

<asp:ListItem Text="----Select----"

Value="n"></asp:ListItem>

<asp:ListItem Text="BA"></asp:ListItem>

<asp:ListItem Text="BCom"></asp:ListItem>

<asp:ListItem Text="BSC"></asp:ListItem>

<asp:ListItem Text="BBA"></asp:ListItem>

<asp:ListItem Text="BCA"></asp:ListItem>

<asp:ListItem Text="BED"></asp:ListItem>

<asp:ListItem Text="BIT"></asp:ListItem>

<asp:ListItem Text="BTech"></asp:ListItem>

<asp:ListItem Text="MA"></asp:ListItem>

<asp:ListItem Text="MCA"></asp:ListItem>

In document Online Learning Portal (Page 118-147)

Related documents