-
Notifications
You must be signed in to change notification settings - Fork 0
/
appliedjobs.aspx.cs
112 lines (84 loc) · 3.56 KB
/
appliedjobs.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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;
using System.Configuration;
namespace JobHunt
{
public partial class appliedjobs : System.Web.UI.Page
{
private String deleteid = "";
protected void Page_Load(object sender, EventArgs e)
{
this.deleteid = Request.QueryString["deleteId"];
if (Session["JName"] == null)
{
Response.Redirect("~/Jobseeker_login.aspx");
}
int jobseekerid = Convert.ToInt32(Session["jid"].ToString());
int delete = Convert.ToInt32(this.deleteid);
if (this.deleteid != null && this.deleteid != "")
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());
con.Open();
SqlCommand cmd1 = new SqlCommand("delete from ApplyforJob where job_id = "+delete+" and jobseeker_id = "+jobseekerid, con);
cmd1.ExecuteNonQuery();
con.Close();
}
}
public List<JobHunt.Models.JobDetails> getWhileLoopDataList()
{
int no = 1;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());
con.Open();
int jobseekerid = Convert.ToInt32(Session["jid"].ToString());
SqlCommand cmd = new SqlCommand("select * from PostAJob where job_id in (select job_id from ApplyforJob where jobseeker_id="+jobseekerid+" and applystatus=0)");
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = con;
SqlDataReader reader = cmd.ExecuteReader();
List<JobHunt.Models.JobDetails> data = new List<Models.JobDetails>();
while (reader.Read())
{
int jid = reader.GetInt32(0);
string Name = reader.GetString(2);
JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
jobDetails.jid = jid;
jobDetails.no = no;
jobDetails.Name = Name;
data.Add(jobDetails);
no++;
}
con.Close();
return data;
}
public List<JobHunt.Models.JobDetails> getWhileLoopDataList2()
{
int no = 1;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());
con.Open();
int jobseekerid = Convert.ToInt32(Session["jid"].ToString());
SqlCommand cmd = new SqlCommand("select * from PostAJob where job_id in (select job_id from ApplyforJob where jobseeker_id=" + jobseekerid + " and applystatus=1)");
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = con;
SqlDataReader reader = cmd.ExecuteReader();
List<JobHunt.Models.JobDetails> data = new List<Models.JobDetails>();
while (reader.Read())
{
int jid = reader.GetInt32(0);
string Name = reader.GetString(2);
JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
jobDetails.jid = jid;
jobDetails.no = no;
jobDetails.Name = Name;
data.Add(jobDetails);
no++;
}
con.Close();
return data;
}
}
}