Esempio n. 1
0
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList()
        {
            int           no  = 1;
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();


            SqlCommand cmd = new SqlCommand("select Distinct Category from PostAJob");


            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())
            {
                string category = reader.GetString(0);
                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.category = category;


                data.Add(jobDetails);
                no++;
            }
            con.Close();
            return(data);
        }
Esempio n. 2
0
        public List <JobHunt.Models.JobDetails> getjobtitle()
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();

            SqlCommand cmd = new SqlCommand("SELECT job_title FROM PostAJob where job_id = " + showtitle);

            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Connection  = con;
            SqlDataReader reader = cmd.ExecuteReader();
            List <JobHunt.Models.JobDetails> data1 = new List <Models.JobDetails>();

            while (reader.Read())
            {
                string title = reader.GetString(0);
                JobHunt.Models.JobDetails applicant = new Models.JobDetails();

                applicant.Name = title;

                data1.Add(applicant);
                System.Diagnostics.Debug.WriteLine(applicant.Name);
            }


            con.Close();
            return(data1);
        }
Esempio n. 3
0
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList()
        {
            int no = 1;

            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();



            SqlCommand cmd = new SqlCommand("select * from PostAJob where Category LIKE '%" + this.category + "%'");


            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    id   = reader.GetInt32(1);
                int    jid  = reader.GetInt32(0);
                string Name = reader.GetString(2);
                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.jid  = jid;
                jobDetails.no   = no;
                jobDetails.id   = id;
                jobDetails.Name = Name;

                data.Add(jobDetails);
                no++;
            }
            con.Close();
            return(data);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList2()
        {
            int           jobid = Convert.ToInt32(this.id);
            SqlConnection con   = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();


            SqlCommand cmd1 = new SqlCommand("select DISTINCT Company.company_name, Company.company_details from Company join PostAJob on Company.company_id = PostAJob.company_id where Company.company_id in (select company_id from PostAJob where job_id = " + jobid + ")");

            cmd1.CommandType = System.Data.CommandType.Text;
            cmd1.Connection  = con;
            SqlDataReader reader1 = cmd1.ExecuteReader();
            List <JobHunt.Models.JobDetails> data = new List <Models.JobDetails>();

            while (reader1.Read())
            {
                string companyname    = reader1.GetString(0);
                string companydetails = reader1.GetString(1);
                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.companyname    = companyname;
                jobDetails.companydetails = companydetails;
                data.Add(jobDetails);
            }

            con.Close();
            return(data);
        }
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList()
        {
            int           jobid = Convert.ToInt32(this.id);
            SqlConnection con   = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();

            SqlCommand cmd = new SqlCommand("SELECT * FROM PostAJob where job_id = " + jobid);

            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    cid      = reader.GetInt32(1);
                string Name     = reader.GetString(2);
                string email    = reader.GetString(3);
                string radios   = reader.GetString(4);
                string location = reader.GetString(5);
                string descrptn = reader.GetString(6);
                string rqrmnts  = reader.GetString(7);
                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.jid      = jobid;
                jobDetails.id       = cid;
                jobDetails.Name     = Name;
                jobDetails.email    = email;
                jobDetails.radios   = radios;
                jobDetails.loation  = location;
                jobDetails.jobdesc  = descrptn;
                jobDetails.reqrmnts = rqrmnts;


                data.Add(jobDetails);
            }
            con.Close();
            return(data);
        }
Esempio n. 7
0
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList()
        {
            int           no     = 1;
            string        intrst = Session["interest"].ToString();
            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 not in  (select job_id  from ApplyforJob where jobseeker_id = "+jobseekerid+" and (applystatus=0 or applystatus=1) )  ");
            System.Diagnostics.Debug.WriteLine(jobseekerid);
            System.Diagnostics.Debug.WriteLine(intrst);

            SqlCommand cmd = new SqlCommand("select * from PostAJob where (requirment LIKE '%" + intrst + "%') AND (job_id not in (select job_id  from ApplyforJob where jobseeker_id =" + jobseekerid + " and(applystatus = 0 or 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    id   = reader.GetInt32(1);
                int    jid  = reader.GetInt32(0);
                string Name = reader.GetString(2);
                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.jid  = jid;
                jobDetails.no   = no;
                jobDetails.id   = id;
                jobDetails.Name = Name;

                data.Add(jobDetails);
                no++;
            }
            con.Close();
            return(data);
        }
Esempio n. 8
0
        public List <JobHunt.Models.JobDetails> getWhileLoopDataList()
        {
            int no = 1;

            int cid = Convert.ToInt32(Session["Cid"].ToString());

            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();

            SqlCommand cmd = new SqlCommand("SELECT * FROM PostAJob where company_id = " + cid);

            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);
                int    id   = reader.GetInt32(1);
                string Name = reader.GetString(2);


                JobHunt.Models.JobDetails jobDetails = new Models.JobDetails();
                jobDetails.jid  = jid;
                jobDetails.no   = no;
                jobDetails.id   = id;
                jobDetails.Name = Name;

                data.Add(jobDetails);
                no++;
            }
            con.Close();
            return(data);
        }