public List <JobHunt.Models.applicants> getWhileLoopDataList()
        {
            //get company id
            int           companyid             = Convert.ToInt32(Session["Cid"].ToString());
            int           jobidforapplicantlist = Convert.ToInt32(this.jobidforapplicantlist);
            int           no  = 1;
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();

            SqlCommand cmd = new SqlCommand("select * from ApplyforJob where job_id = " + jobidforapplicantlist + " and applystatus=0 ");

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

            while (reader.Read())
            {
                int applyid = reader.GetInt32(0);
                //int jid = reader.GetInt32(0);
                string Name = reader.GetString(5);
                JobHunt.Models.applicants applicants = new Models.applicants();

                applicants.no                  = no;
                applicants.apply_id            = applyid;
                applicants.applicant_firstname = Name;

                data.Add(applicants);
                no++;
            }
            con.Close();
            return(data);
        }
예제 #2
0
        public List <JobHunt.Models.applicants> getWhileLoopDataList()
        {
            int           applicantid = Convert.ToInt32(this.ApplicantId);
            SqlConnection con         = new SqlConnection(ConfigurationManager.ConnectionStrings["mycon"].ToString());

            con.Open();

            SqlCommand cmd = new SqlCommand("SELECT * FROM ApplyforJob where apply_id = " + applicantid);

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

            while (reader.Read())
            {
                int    aid   = reader.GetInt32(0);
                int    jobid = reader.GetInt32(2);
                string applicant_firstname = reader.GetString(5);
                string applicant_lastname  = reader.GetString(6);
                string email         = reader.GetString(7);
                string phoneno       = reader.GetString(8);
                string city          = reader.GetString(9);
                string addres        = reader.GetString(10);
                string qualification = reader.GetString(11);
                string experience    = reader.GetString(12);

                JobHunt.Models.applicants applicants = new Models.applicants();
                applicants.job_id              = jobid;
                applicants.apply_id            = aid;
                applicants.applicant_firstname = applicant_firstname;
                applicants.applicant_lastname  = applicant_lastname;
                applicants.email         = email;
                applicants.phoneno       = phoneno;
                applicants.city          = city;
                applicants.addres        = addres;
                applicants.qualification = qualification;
                applicants.experience    = experience;

                showtitle = jobid;

                data.Add(applicants);
            }
            con.Close();
            return(data);
        }