0% found this document useful (0 votes)
74 views

Using Using Using Using Using Using Using Using Using Using Using Using Using

The document contains code for various pages of a job portal website. It includes code for registration, login, candidate profile, jobs listing pages. The code handles form submission, database operations like insert, select using SQL queries to manage user and job data.

Uploaded by

Rakesh Meena
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Using Using Using Using Using Using Using Using Using Using Using Using Using

The document contains code for various pages of a job portal website. It includes code for registration, login, candidate profile, jobs listing pages. The code handles form submission, database operations like insert, select using SQL queries to manage user and job data.

Uploaded by

Rakesh Meena
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 25

Registeration.aspx.cs using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.

Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Data.SqlClient; using System.Xml.Linq; public partial class Registeration : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { dobdate.Items.Clear(); dobmnth.Items.Clear(); dobyear.Items.Clear(); dobdate.Items.Add("Day"); dobyear.Items.Add("Year");

for(int dd = 1; dd <= System.DateTime.DaysInMonth(System.DateTime.Now.Year,Sy stem.DateTime.Now.Month); dd++) { dobdate.Items.Add(dd.ToString()); } for (int yy=System.DateTime.Now.Year-18; yy >= 1900; yy--) { dobyear.Items.Add(yy.ToString()); } } protected void regmenu_MenuItemClick(object sender, MenuEventArgs e) { } protected void dobmnth_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string name, email, uname, upass, gender,dob,ldegree; string per10, per12, pergrad, perlast, con_no; name = fname.Text + lname.Text;

email = efid.Text + iddomain.Text; con_no =contactno.Text.ToString(); gender = cmdgender.Text.ToString(); uname = duname.Text.ToUpper(); upass = dpass.Text; dob = dobdate.Text+"-"+ dobmnth.Text+"-"+ dobyear.Text; per10=Per10.Text.ToString(); per12 =Per12.Text.ToString(); pergrad =Pergrad.Text.ToString(); perlast =plast.Text.ToString(); ldegree = ldeg.Text.ToString(); string cstring; cstring = "Data Source=RAKESH-PC; Initial Catalog=JOBDATAS; Integrated security=true"; SqlConnection conn = new SqlConnection(cstring); conn.Open(); SqlCommand cmd = new SqlCommand("select * from jobseeker where [email_id]='"+email+"'", conn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { message.Text = "Profile Already Exists."; } else {

dr.Close(); string sql = "insert into jobseeker values('" + name + "','" + dob + "','" + email + "','" + con_no + "','" + gender +"','" + uname +"','"+"','" + upass +"','" + per10 + "','" + per12 + "','" + perlast + "','" + ldegree + "')"; SqlCommand cmd1 = new SqlCommand(sql, conn); cmd1.ExecuteNonQuery(); message.Text="Registeration successfully completed"; Response.Redirect("~/upload.aspx? email="+email); } } } CandMain.aspx.cs using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq;

using System.Data.SqlClient; public partial class candmain : System.Web.UI.Page { SqlConnection conn1 = new SqlConnection("Data Source=RAKESH-PC; Initial Catalog=JOBDATAS; Integrated security=true;"); DataSet ds; protected void Page_Load(object sender, EventArgs e) { conn1.Open(); string imgid = Request.QueryString[0]; candimg.ImageUrl ="~/images/users/"+ imgid +".jpg"; string name, dob, con_no; SqlCommand cmd = new SqlCommand("Select * from jobseeker where email_id='" + imgid +"'", conn1); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); name = dr.GetString(1); dob = dr.GetString(2); con_no = dr.GetString(4); lblename.Text = name; lbldob.Text = dob; lblcontact.Text = con_no; dr.Close(); } protected void cmdit_Click(object sender, EventArgs e) { string sql = "select * from jobs where job_fields='it'"; SqlDataAdapter adp = new SqlDataAdapter(sql, conn1); ds = new DataSet();

adp.Fill(ds); gview.DataSource = ds; gview.DataBind(); } protected void cmdgovt_Click(object sender, EventArgs e) { string sql = "select * from jobs where job_fields='govt'"; SqlDataAdapter adp = new SqlDataAdapter(sql, conn1); ds = new DataSet(); adp.Fill(ds); gview.DataSource = ds; gview.DataBind(); } protected void cmdother_Click(object sender, EventArgs e) { string sql = "select * from jobs where job_fields='other'"; SqlDataAdapter adp = new SqlDataAdapter(sql, conn1); ds = new DataSet(); adp.Fill(ds); gview.DataSource = ds; gview.DataBind(); } protected void cmdlogout_Click(object sender, EventArgs e) { conn1.Close(); Response.Redirect("~/index.aspx"); } }

Jobs.aspx.cs using using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq; System.Data.SqlClient;

public partial class Jobs : System.Web.UI.Page { DataSet ds; protected void Page_Load(object sender, EventArgs e) { string cstring; cstring = "Data Source=RAKESH-PC; Initial Catalog=JOBDATAS; Integrated security=true"; SqlConnection conn = new SqlConnection(cstring); conn.Open(); string sql = "select * from jobs"; ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter(sql,

conn);

adp.Fill(ds); gviewJobs.DataSource = ds; gviewJobs.DataBind(); }

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

Login.aspx.cs using using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq; System.Data.SqlClient;

public partial class login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void rdtohome_Click(object sender, EventArgs e) { Response.Redirect("~/Index.aspx"); } protected void cmdlog_Click(object sender, EventArgs e) {

SqlConnection conn = new SqlConnection("Data Source=RAKESH-PC; Initial Catalog=JOBDATAS; Integrated security=true;"); conn.Open(); string choice; if (RadioButtonList1.Items[0].Selected) choice = "Jobseeker"; else choice = "employer"; string email, pass; email = txtmail.Text; pass = txtupass.Text; SqlCommand cmd = new SqlCommand("Select * from " + choice + " where email_id='" + email + "' and password='" + pass + "'", conn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { if (RadioButtonList1.Items[0].Selected) { Response.Redirect("candmain.aspx? email=" + email); } else if (RadioButtonList1.Items[1].Selected) { Response.Redirect("empmain.aspx? email=" + email); } } else { Label1.Text = "Invalid User Name & Password"; } conn.Close(); } }

Upload.aspx.cs using using using using using using using using using using using using using System; System.Collections; System.Configuration; System.Data; System.Linq; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.HtmlControls; System.Web.UI.WebControls; System.Web.UI.WebControls.WebParts; System.Xml.Linq; System.IO;

public partial class upload : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void cmdupload_Click(object sender, EventArgs e) { string eid; eid=Request.QueryString[0]; if (fupload.HasFile) { string fpath; fpath = fupload.FileName; string fname; fname = Path.GetFileName(fpath); string npath = Server.MapPath("~/images/users/") + fname; string nfname = "~/images/users/" + fname; fupload.SaveAs(npath); lblmessage.Text = "File uploaded successfully";

Response.Redirect("~/candmain.aspx?"+eid); } } }

Slidetron.css #foobar { width: 697px; height: 1121px; position: relative; top: 0px; left: 78px; } #foobar .navigation { position: absolute; display: block; z-index: 100; color: #ffffff; bottom: 775px; right: 3px; margin: 10px; padding: 10px; background-color: #303030; opacity: 0.75; height: 24px; width: 175px; } #foobar .navigation a { color: #ffffff; text-decoration: none; outline: none; } #foobar .viewer

{ }

width: 685px; height: 385px;

#foobar .viewer .reel .slide { position: relative; width: 758px; height: 353px; top: 39px; left: 62px; } #foobar .viewer .reel .slide span { position: absolute; display: block; width: 696px; opacity: 0.90; padding: 20px; background-color: #404040; color: #ffffff; bottom: 9px; left: 6px; } Style.css

body { margin: 0px; padding: 0; background: #42a8d9; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #fff; text-align: center; } h1, h2, h3 {

margin: 0; text-transform: uppercase; font-weight: normal; color: #FFFFFF; } h1 { } h2 { } h3 { } p, ul, ol { margin-top: 0; line-height: 240%; text-align: justify; height: 48 px; } ul, ol { } blockquote { } a { } a:hover { text-decoration: none; } a img { border: none; } img.left { color: #ffffff; font-size: 18px; font-size: 44px;

float: left; margin: 7px 30px 0 0; } img.right { float: right; margin: 7px 0 0 30px; } hr { } display: none;

.list1 { } .list1 li { float: left; line-height: normal; } .list1 li img { margin: 0 30px 30px 0; } .list1 li.alt img { margin-right: 0; } #wrapper { background: #073b63; } /* Header */ #header { width: 597px; height: 106px; margin: 0 auto; background: url(images/img02.jpg) no-repeat left top; }

/* Menu */ #menu { float: right; width: 610px; height: 47px; text-align: left; } #menu ul { margin: 0; list-style: none; line-height: normal; width: 760px; } #menu li { display: block; float: left; width: 125px; height: 45px; } #menu a { display: block; float: right; height: 37px; margin-right: 1px; padding: 15px 20px 0px 20px; background: #073b63; text-decoration: none; text-align: center; text-transform: capitalize; font-size: 14px; color: #FFFFFF; width: 107px; } #menu a:hover { text-decoration: none; background: #245ec0; color: #FFFFFF; }

#menu .current_page_item a { background: #245ec0; color: #FFFFFF; } #menu .first { } /* Search */ #search { float: right; padding: 10px 10px 0px 0px; } #search form { float: right; margin: 0; padding: 4px 0px 0 0; } #search fieldset { margin: 0; padding: 0; border: none; } #search input { float: left; font: 12px Arial, Helvetica, sans-serif; } #search-text { width: 170px; margin-top: 8px; margin-left: 60px; margin-right: 40px; padding: 6px 0 0 7px; border: none; background: none; font-family: Arial, Helvetica, sans-serif; color: #838383;

} #search-submit { width: 82px; height: 28px; margin-left: 10px; padding: 0px 5px; background: url(images/img03.jpg) no-repeat left top; border: none; text-indent: -9999px; color: #FFFFFF; } /* Page */ #page { width: 960px; margin: 0px auto 20px auto; padding: 40px 0px 0px 0px; height: 93px; } #page-bgtop { } /** LOGO */ #logo { float: left; height: 50px; margin: 0 auto; padding-top: 5px; width: 914px; } #logo h1, #logo p { float: left; margin: 0px; line-height: normal; text-transform: lowercase; font-weight: normal; color: #FFFFFF;

} #logo p { padding: 13px 0px 0px 5px; text-transform: lowercase; font-family: Georgia, "Times New Roman", Times, serif; font-size: 13px; color: #000000; } #logo h1 { letter-spacing: -1px; font-size: 30px; color: #245EC0; width: 912px; height: 29px; text-align: left; } #logo a { text-decoration: none; color: #FFFFFF; } #banner { padding-bottom: 20px; } /* Content */ #content { float: right; width: 620px; } /* Post */ .post { margin-bottom: 10px; } .post .title {

padding: 4px 0px 0px 0px; border-bottom: 1px solid #292929; } .post .title a { text-decoration: none; text-transform: capitalize; font-size: 30px; color: #FFFFFF; } .post .date { display: inline-block; margin: 0px; padding: 0px 10px 0px 0px; color: #000; } .post .meta { margin-left: 2px; padding: 10px 30px 0px 0px; font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; color: #fff; text-decoration:none; } .post .meta span { margin: 0px; } .post .meta a { padding: 8px 10px 5px 0px; text-decoration: none; color: #fff; } .post .entry { padding: 30px 0px 20px 0px; } .post .links {

display: block; width: 120px; height: 25px; margin: 0px; padding: 10px 0px 0px 20px; background: #161616 url(images/img10.jpg) norepeat right top; text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; font-weight: bold; color: #FFFFFF; } .post .comments { display: block; width: 120px; height: 18px; margin: 0px; padding: 3px 0px 0px 40px; background: #90BF35; border: 1px dashed #1D1D1D; text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; font-weight: bold; color: #FFFFFF; } /* Sidebar */ #sidebar { float: left; width: 280px; font-family: Arial, Helvetica, sans-serif; } #sidebar ul { margin: 0; padding: 0;

list-style: none; line-height: normal; } #sidebar li { margin-bottom: 30px; padding: 0 0 10px 0px; } #sidebar li ul { margin: 0px 0px; } #sidebar li li { margin: 0px; padding: 8px 0px 8px 0px; border-bottom: 1px dotted #fff; } #sidebar li li a { padding: 0px 20px; font-weight: normal; } #sidebar li li a:hover { color: #fff; } #sidebar p { margin: 0; padding: 0px 14px; } #sidebar h2 { height: 30px; margin: 0 0 30px 0px; padding: 6px 20px 2px 0px; border-bottom: 1px dotted #fff; text-transform: capitalize; font-size: 24px; font-weight: normal; color: #FFFFFF; }

#sidebar p { line-height: 200%; } #sidebar a { text-align: left; text-decoration: none; font-weight: bold; color: #fff; } /* Calendar */ #calendar { } #calendar caption { padding-bottom: 5px; font-weight: bold; } #calendar table { width: 100%; border-collapse: collapse; border-bottom: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #fff; } #calendar thead th { padding: 5px 0; text-align: center; border-top: 1px solid #fff; border-left: 1px solid #fff; background: #24130F; } #calendar tbody td { padding: 5px 0; text-align: center; border-top: 1px solid #fff; border-left: 1px solid #fff;

border-bottom: 1px solid #fff;

#calendar tfoot td { padding: 5px; border-left: 1px solid #fff; border-bottom: 1px solid #fff; } #calendar tfoot #next { border-top: 1px solid #fff; text-align: right; } #calendar tfoot #prev { border-top: 1px solid #fff; } #calendar .pad { border-bottom: 1px solid #fff; } #calendar #today { background: #24130F; } /* Footer */ #footer { height: 100px; padding: 0; background: #245ec0; width:100%;

#bfooter { height:auto; padding: 0; background: #245ec0;

width:100%;

#footer p { margin: 0; padding: 30px 0px 0px 30px; text-align: center; text-transform: capitalize; line-height: normal; font-size: 14px; color:#FFFFFF; } #footer a { } #two-columns { width: 914px; height: 225px; margin: 0px auto; } #two-columns .col1 { float: left; width: 8px; height: 385px; background: #245ec0; } #two-columns .col2 { float: right; width: 121px; height: 335px; padding: 50px 30px 0px 30px; background: #245ec0; line-height: 135%; letter-spacing: -1px; font-family: Georgia, "Times New Roman", Times, serif; font-size: 34px; font-style: italic; color: #FFFFFF; }

#two-columns .col2 blockquote { margin: 0px; padding: 0px; }

You might also like