private bool Check_Candidate_Registration(string userEmail)
        {
            bool        Candidate_Registration = false;
            UserDetails umbl = new UserDetails();

            Candidate_Registration = umbl.Check_Candidate_Registration(userEmail);
            umbl = null;
            return(Candidate_Registration);
        }
        /// <summary>
        /// To save the user registration details to tables
        /// </summary>
        protected void btnPostResume_Click(object sender, EventArgs e)
        {
            if (!mainCheck.Checked)
            {
                mainCheck.Focus();
                Page.ClientScript.RegisterStartupScript(typeof(Page), "marin1", "alert('you have to accept the declaration, please check check box.!');", true);
                return;
            }

            string[] strEmpty = { "firstName", "lastName", "mobile", "email", "date_of_birth", "Address", "city", "pin", "notice_period" };

            foreach (string str in strEmpty)
            {
                var ctrl = form1.FindControl(str);
                if (ctrl != null)
                {
                    TextBox txt = ctrl as TextBox;
                    if (txt != null && txt.Text.Trim().Length == 0)
                    {
                        txt.Focus();
                        Page.ClientScript.RegisterStartupScript(typeof(Page), "marin1", "alert('" + str + " cannot be empty.!');", true);
                        return;
                    }
                }
            }

            if (email.Text.Trim().Length > 0)
            {
                bool        usrstatus = false;
                UserDetails umbl      = new UserDetails();
                usrstatus = umbl.Check_Candidate_Registration(email.Text.Trim());
                umbl      = null;

                if (usrstatus)
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "alert('Your registration details already exist, you cannot register again!!');", true);
                    return;
                }
            }



            if (applying_for.SelectedIndex == 0)
            {
                experience.Focus();
                Page.ClientScript.RegisterStartupScript(typeof(Page), "marinexp1", "alert('Please select the Applying For drop down.!');", true);
                return;
            }

            if (experience.SelectedIndex == 0)
            {
                experience.Focus();
                Page.ClientScript.RegisterStartupScript(typeof(Page), "marinexp1", "alert('Please select the experience drop down.!');", true);
                return;
            }

            string strMonth    = DateTime.Now.Date.ToString("MM_yyyy");
            string updPath     = Path.Combine(ResumePath, strMonth);
            string resume_path = string.Empty;

            if (upload_resume.HasFile)
            {
                string extension = Path.GetExtension(upload_resume.PostedFile.FileName);
                if (extension.ToLower() == ".pdf" || extension.ToLower() == ".docx")
                {
                    string resumename = email.Text + extension;

                    if (!Directory.Exists(updPath))
                    {
                        Directory.CreateDirectory(updPath);
                    }
                    resume_path = Path.Combine(updPath, resumename);
                    upload_resume.SaveAs(resume_path);
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "marin1", "alert('upload resume allowed only pdf/docx extension');", true);
                    return;
                }
            }
            //check validations;

            RegistrationEntity regEntity = GetControlData();

            if (resume_path != string.Empty)
            {
                regEntity.resume_path = resume_path;
            }

            DataTable tblEducation = GetEducationData();

            if (tblEducation == null || tblEducation.Rows.Count == 0)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "marined", "alert('Please enter the Education Details.');", true);
                return;
            }

            //string[] strNames = { "Id", "DegreeName", "Specialization", "CollegeName", "UniversityName", "YearofPassing", "pcntofmarks" };
            foreach (DataRow dr in tblEducation.Rows)
            {
                if (dr["DegreeName"].ToString() == "" || dr["DegreeName"].ToString() == null)
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "marin1", "alert('Please select the Degree Name.');", true);
                    return;
                }
                if ((dr["CollegeName"].ToString().Length == 0) ||
                    (dr["UniversityName"].ToString().Length == 0) ||
                    (dr["YearofPassing"].ToString().Length == 0) ||
                    (dr["pcntofmarks"].ToString().Length == 0))
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "marincu", "alert('CollegeName, UniversityName,YearofPassing,%ofmarks cannot be empty.');", true);
                    return;
                }
            }


            DataTable tblExperence = GetExperenceData();

            Registration blReg          = new Registration();
            int          ExectuteStatus = 0;
            string       Result         = string.Empty;


            int res = blReg.InsertCandidateRegistration(regEntity, tblEducation, tblExperence, out ExectuteStatus, out Result);

            blReg = null;
            if (ExectuteStatus == 1)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "ressuss", "alert('User registration form submitted successfully');", true);

                System.Threading.Thread.Sleep(10000);

                //Response.Redirect("UserRegistration.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "reserro", "alert('" + Result.Replace("'", "") + "');", true);
            }
        }