/// <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);
            }
        }
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            if (chkUserLogin.Checked)
            {
                if (txtUserEmail.Text.Trim().Length > 0)
                {
                    bool usrstatus = Check_Candidate_Registration(txtUserEmail.Text.Trim());

                    if (!usrstatus)
                    {
                        lblerrorMessage.Text      = txtUserEmail.Text.Trim() + "  Your resume is not available in the NES website.  please post your resume @ www.nes.co.in and Try Again!! ";
                        lblerrorMessage.ForeColor = System.Drawing.Color.Red;
                        Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "alert('Your resume is not available in the NES website.  please post your resume @ www.nes.co.in and Try Again!!')", true);

                        return;
                    }
                }
                else
                {
                    lblerrorMessage.Text      = " Enter email address as user name ";
                    lblerrorMessage.ForeColor = System.Drawing.Color.Red;
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "alert('Enter email address as user name')", true);
                    return;
                }
            }

            if (Session["exammoduleid"] != null && Session["exammoduleid"].ToString() == "44")
            {
                if (!chkUserLogin.Checked)
                {
                    txtUserEmail.Text = Session["ExaminerName"].ToString();
                }
            }



            string         userName       = string.Empty;
            string         passWord       = string.Empty;
            string         strUserName    = string.Empty;
            DataSet        dsUserDetails  = new DataSet();
            DataTable      dtUserDetails  = new DataTable();
            DataTable      dtexamdetails  = new DataTable();
            UserManagement objUserListDTO = new UserManagement();
            UserManagement userBAL        = new UserManagement();

            try
            {
                objUserListDTO = new UserManagement();
                userBAL        = new UserManagement();
                dsUserDetails  = new DataSet();

                userName = txtUserEmail.Text.ToString();
                objUserListDTO.UserName = userName;

                bool   isStatus  = false;
                string strStatus = string.Empty;

                strUserName          = userName;
                Session["userEmail"] = userName;
                int result = 0;
                if (Session["exammoduleid"] != null)
                {
                    int exammoduleid = 0;
                    int.TryParse(Session["exammoduleid"].ToString(), out exammoduleid);
                    switch (exammoduleid)
                    {
                    case 36:     //EMP - Enhance Metadata Project EMP
                    {
                        dtexamdetails = userBAL.VerifyUserExamByUserEmail(objUserListDTO);
                        if (dtexamdetails != null && dtexamdetails.Rows.Count > 0)
                        {
                            lblerrorMessage.Text      = strUserName + "  You have already appeared for the test! ";
                            lblerrorMessage.ForeColor = System.Drawing.Color.Red;
                            Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "alert('You have already appeared for the test!')", true);
                        }
                        else
                        {
                            if (strUserName.Length > 0)
                            {
                                Page.Session["userEmail"] = strUserName;
                                result = ExamUserInsert();

                                if (result > 0)
                                {
                                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "window.open('UserDashboard.aspx','_parent');", true);
                                }
                            }
                        }
                        break;
                    }

                    case 18:
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 26:
                    case 29:
                    case 30:
                    case 31:
                    case 32:
                    case 35:
                    case 39:
                    case 45:
                    {
                        // Session["exammoduleid"].ToString() == "18"
                        // //|| Session["exammoduleid"].ToString() == "19"
                        // || Session["exammoduleid"].ToString() == "21"
                        // || Session["exammoduleid"].ToString() == "22"
                        // || Session["exammoduleid"].ToString() == "23" //ADPNET
                        // || Session["exammoduleid"].ToString() == "24"
                        // || Session["exammoduleid"].ToString() == "25" //python
                        // || Session["exammoduleid"].ToString() == "26"
                        // || Session["exammoduleid"].ToString() == "29"
                        // || Session["exammoduleid"].ToString() == "30"
                        // || Session["exammoduleid"].ToString() == "31"
                        // || Session["exammoduleid"].ToString() == "32"
                        // || Session["exammoduleid"].ToString() == "35"
                        // || Session["exammoduleid"].ToString() == "39" //PSP
                        /// || Session["exammoduleid"].ToString() == "41" //PCM
                        // || Session["exammoduleid"].ToString() == "45"
                        // ))

                        long UserId = InsertObj_UserDetails();
                        if (UserId > 0)
                        {
                            Session["UserId"]   = UserId;
                            Session["ModuleId"] = Session["exammoduleid"].ToString();
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "window.open('UserDashboard.aspx','_parent');", true);
                        }
                        break;
                    }

                    case 19:     // HelpDesk - Level: 2 desc
                    case 20:     //HelpDesk - Level: 3 desc
                    case 33:     //HelpDesk - Level: 3 desc
                    case 38:     // Content Specialist - Descriptive Test -2
                    case 41:     //Product Management Team -desc
                    {
                        int roleid = 3;
                        if (!chkUserLogin.Checked)
                        {
                            Session["UserId"] = 0;
                            UserDetails umbl = new UserDetails();

                            string UserType = umbl.GetUserRole(userName);
                            umbl = null;
                            Session["UserType"] = UserType;

                            if (UserType == "Administrator")
                            {
                                roleid = 1;
                            }
                            else if (UserType == "Evaluator")
                            {
                                roleid = 2;
                            }
                        }

                        long UserId = Des_Insert_UserDetails(roleid);
                        if (UserId > 0)
                        {
                            Session["UserId"]   = UserId;
                            Session["ModuleId"] = Session["exammoduleid"].ToString();
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "window.open('UserDashboard.aspx','_parent');", true);
                        }
                        break;
                    }

                    case 44:     //Cataloguing Online Test CAT
                    {
                        if (!chkUserLogin.Checked)
                        {
                            Session["UserId"]    = 0;
                            Session["LoginName"] = userName;
                            Session["userEmail"] = userName;

                            UserDetails umbl = new UserDetails();

                            string UserType = umbl.GetUserRole(userName);
                            umbl = null;

                            Session["UserType"] = UserType;
                            int roleid = 1;
                            if (UserType == "Administrator")
                            {
                                roleid = 1;
                            }
                            else if (UserType == "Evaluator")
                            {
                                roleid = 2;
                            }

                            long UserId = InsertCat_UserDetails(roleid);
                            Session["EvaluatorId"] = 0;
                            Session["UserId"]      = 0;
                            if (UserType == "Administrator")
                            {
                                Session["UserType"]        = "Administrator";
                                Session["AdministratorId"] = UserId;
                            }
                            else if (UserType == "Evaluator")
                            {
                                Session["UserType"]    = "Evaluator";
                                Session["EvaluatorId"] = UserId;
                            }
                            if (UserId > 0)
                            {
                                Session["UserId"]   = UserId;
                                Session["ModuleId"] = Session["exammoduleid"].ToString();
                                Response.Redirect("http://10.68.98.83/CataloguingTest/models/AdminHome.aspx?UserType=" + Session["UserType"].ToString() + "&UserId=" + Session["UserId"].ToString() + "&LoginName=" + Session["userEmail"].ToString() + "", false);

                                //ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "window.open('UserDashboard.aspx','_parent');", true);
                            }
                        }
                        else
                        {
                            Session["userEmail"] = userName;
                            Session["UserType"]  = "User";
                            Session["UserId"]    = 0;

                            long UserId = InsertCat_UserDetails(3);
                            if (UserId > 0)
                            {
                                Session["UserId"]   = UserId;
                                Session["ModuleId"] = Session["exammoduleid"].ToString();
                                ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "window.open('UserDashboard.aspx','_parent');", true);
                            }
                        }
                        break;
                    }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
        private long InsertObj_UserDetails()
        {
            long UserId   = 0;
            int  ModuleId = 0;

            int.TryParse(Session["exammoduleid"].ToString(), out ModuleId);

            string userEmail             = Session["userEmail"].ToString();
            string examinerName          = Session["ExaminerName"].ToString();
            string alloted_questions_tbl = "NES_questions_common";
            string examCode = "LIB";

            if (ModuleId == 18)
            {
                alloted_questions_tbl = "EBSCO_questions_english";
                examCode = "T1_Technical_Test";
            }
            //if (ModuleId == 19)
            //{
            //    alloted_questions_tbl = "EBSCO_ESL_questions";
            //    examCode = "T2_Technical_Test";
            //}
            if (ModuleId == 21)
            {
                alloted_questions_tbl = "EBSCO_questions_software";
                examCode = "OOPs_Java";
            }
            if (ModuleId == 22)
            {
                alloted_questions_tbl = "EBSCO_questions_CSharp";
                examCode = "CSharp";
            }
            if (ModuleId == 23)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "ASP.NET_Developer";
            }
            if (ModuleId == 24)
            {
                alloted_questions_tbl = "EBSCO_questions_DB";
                examCode = "DB";
            }
            if (ModuleId == 25)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "ASP.NET_Developer";
            }
            if (ModuleId == 26)
            {
                alloted_questions_tbl = "EBSCO_questions_TSRep";
                examCode = "TSP_Rep";
            }
            if (ModuleId == 29)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBR_References";
            }
            if (ModuleId == 30)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBC1_CINAHL1";
            }
            if (ModuleId == 31)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBC2_CINAHL2";
            }
            if (ModuleId == 32)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIB";
            }
            if (ModuleId == 35)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "Title_Loading";
            }
            if (ModuleId == 39) //PSP
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "PSP";
            }
            //if (ModuleId == 41) //PCM
            //{
            //    alloted_questions_tbl = "NES_questions_common";
            //    examCode = "PCM";
            //}
            if (ModuleId == 45)
            {
                alloted_questions_tbl = "questions_english";
                examCode = "STE";
            }

            UserDetails dac = new UserDetails();

            UserId = dac.InsertObj_UserDetails(userEmail, examinerName, alloted_questions_tbl, examCode, ModuleId);
            dac    = null;

            return(UserId);
        }
示例#4
0
        /// <summary>
        /// To insert the Obj test user details
        /// </summary>
        private long InsertObj_UserDetails(long CanId)
        {
            long UserId   = 0;
            int  ModuleId = 0;

            int.TryParse(Session["exammoduleid"].ToString(), out ModuleId);

            string userEmail             = Session["userEmail"].ToString();
            string examinerName          = Session["ExaminerName"].ToString();
            string alloted_questions_tbl = "NES_questions_common";
            string examCode = "LIB";

            if (ModuleId == 18)
            {
                alloted_questions_tbl = "EBSCO_questions_english";
                examCode = "T1_Technical_Test";
            }
            if (ModuleId == 21)
            {
                alloted_questions_tbl = "EBSCO_questions_software";
                examCode = "OOPs_Java";
            }
            if (ModuleId == 22)
            {
                alloted_questions_tbl = "EBSCO_questions_CSharp";
                examCode = "CSharp";
            }
            if (ModuleId == 23)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "ASP.NET_Developer";
            }
            if (ModuleId == 24)
            {
                alloted_questions_tbl = "EBSCO_questions_DB";
                examCode = "DB";
            }
            if (ModuleId == 25)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "ASP.NET_Developer";
            }
            if (ModuleId == 26)
            {
                alloted_questions_tbl = "EBSCO_questions_TSRep";
                examCode = "TSP_Rep";
            }
            if (ModuleId == 29)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBR_References";
            }
            if (ModuleId == 30)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBC1_CINAHL1";
            }
            if (ModuleId == 31)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIBC2_CINAHL2";
            }
            if (ModuleId == 32)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "LIB";
            }
            if (ModuleId == 35)
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "Title_Loading";
            }
            if (ModuleId == 39) //PSP
            {
                alloted_questions_tbl = "NES_questions_common";
                examCode = "PSP";
            }
            //if (ModuleId == 41) //PCM
            //{
            //    alloted_questions_tbl = "NES_questions_common";
            //    examCode = "PCM";
            //}
            if (ModuleId == 45)
            {
                alloted_questions_tbl = "questions_english";
                examCode = "STE";
            }

            UserDetails dac = new UserDetails();

            UserId = dac.InsertObj_UserDetails(userEmail, examinerName, alloted_questions_tbl, examCode, ModuleId);
            if (UserId > 0)
            {
                string Ip_Address = Request.ServerVariables["REMOTE_ADDR"].ToString().Trim();
                int    res        = 0;
                res = dac.InsertObj_UserAllotedQuestions(UserId, ModuleId, Ip_Address);


                DateTime stdate  = Convert.ToDateTime(txtExamTime.Text + " " + ddlExamTime.SelectedValue);
                int      totTime = 20;
                int.TryParse(ddlTotMinutes.SelectedValue, out totTime);
                string linkId = GenerateRandomString(10);

                InsertCurrent_Candidates(UserId, ModuleId, CanId, stdate, totTime, linkId, Session["ExaminerName"].ToString());
            }
            dac = null;

            return(UserId);
        }
示例#5
0
        /// <summary>
        /// To insert the Des test user details
        /// </summary>
        private long Des_Insert_UserDetails(long CanId, int roleid)
        {
            long UserId   = 0;
            int  ModuleId = 0;

            int.TryParse(Session["exammoduleid"].ToString(), out ModuleId);

            string userEmail    = Session["userEmail"].ToString();
            string examinerName = Session["ExaminerName"].ToString();

            string alloted_questions_tbl = "NES_questions_common";
            string examCode = "LIB";

            if (ModuleId == 19)
            {
                alloted_questions_tbl = "EBSCO_ESL_questions";
                examCode = "T2_Technical_DesTest";
            }
            if (ModuleId == 20)
            {
                alloted_questions_tbl = "EBSCO_ESL_questions";
                examCode = "T3_Technical_DesTest";
            }
            if (ModuleId == 28)
            {
                alloted_questions_tbl = "NES_DESCRIPTIVE_questions";
                examCode = "TS_Test";
            }
            if (ModuleId == 33)
            {
                alloted_questions_tbl = "NES_DESCRIPTIVE_questions";
                examCode = "LIB_Desc";
            }
            if (ModuleId == 38)
            {
                alloted_questions_tbl = "NES_DESCRIPTIVE_questions";
                examCode = "ContentSpecialist_DesTest";
            }
            if (ModuleId == 41)
            {
                alloted_questions_tbl = "NES_DESCRIPTIVE_questions";
                examCode = "Product_Management";
            }
            UserDetails dac = new UserDetails();

            UserId = dac.Des_Insert_UserDetails(userEmail, roleid, examinerName, alloted_questions_tbl, examCode, ModuleId);
            if (UserId > 0)
            {
                string Ip_Address = Request.ServerVariables["REMOTE_ADDR"].ToString().Trim();
                int    res        = 0;
                res = dac.Des_Insert_UserAllotedQuestions(UserId, ModuleId, Ip_Address);

                DateTime stdate  = Convert.ToDateTime(txtExamTime.Text + " " + ddlExamTime.SelectedValue);
                int      totTime = 20;
                int.TryParse(ddlTotMinutes.SelectedValue, out totTime);
                string linkId = GenerateRandomString(10);
                InsertCurrent_Candidates(UserId, ModuleId, CanId, stdate, totTime, linkId, Session["ExaminerName"].ToString());
            }
            dac = null;
            return(UserId);
        }
示例#6
0
        /// <summary>
        /// To insert the DAO test user details
        /// </summary>
        private long DAO_Insert_UserDetails(long CanId, int roleid)
        {
            long UserId   = 0;
            int  ModuleId = 0;

            int.TryParse(Session["exammoduleid"].ToString(), out ModuleId);

            string userEmail    = Session["userEmail"].ToString();
            string examinerName = Session["ExaminerName"].ToString();

            string alloted_questions_tbl = "NES_questions_DAO";
            string examCode = "TS_DAO";

            if (ModuleId == 50)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "TS_DAO";
            }
            //Anil 20200611
            if (ModuleId == 52)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "INS"; // Insurance Test
            }
            if (ModuleId == 54)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "ANA"; // Analytical Test
            }

            if (ModuleId == 56)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "EBK_XML"; // EBook XML Test
            }

            if (ModuleId == 57)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "EBK_EPUB"; // Ebook EPUB Test
            }

            if (ModuleId == 59)
            {
                alloted_questions_tbl = "NES_questions_DAO";
                examCode = "EDT"; // English Descriptive Test for PCM
            }

            if (ModuleId == 61) // 20200723 Anil
            {
                alloted_questions_tbl = "User_Questions_CINAHL";
                examCode = "CINAHL"; // CINAHL Indexing Test
            }

            List <int> ExcludeModules = new List <int>();

            ExcludeModules.Add(52);
            ExcludeModules.Add(54);
            ExcludeModules.Add(56);
            ExcludeModules.Add(57);
            ExcludeModules.Add(59);
            ExcludeModules.Add(61);

            UserDetails dac = new UserDetails();

            UserId = dac.DAO_Insert_UserDetails(userEmail, roleid, examinerName, alloted_questions_tbl, examCode, ModuleId);
            if (UserId > 0)
            {
                string Ip_Address = Request.ServerVariables["REMOTE_ADDR"].ToString().Trim();
                int    res        = 0;
                if (!ExcludeModules.Contains(ModuleId))
                {
                    res = dac.DAO_Insert_UserAllotedQuestions(UserId, ModuleId, Ip_Address);
                }

                DateTime stdate  = Convert.ToDateTime(txtExamTime.Text + " " + ddlExamTime.SelectedValue);
                int      totTime = 20;
                int.TryParse(ddlTotMinutes.SelectedValue, out totTime);
                string linkId = GenerateRandomString(10);
                InsertCurrent_Candidates(UserId, ModuleId, CanId, stdate, totTime, linkId, Session["ExaminerName"].ToString());
            }
            dac = null;
            return(UserId);
        }