示例#1
0
        private int Des_Inser_UserAllotedQuestions()
        {
            int    res        = 0;
            long   UserId     = 0;
            int    ModuleId   = 0;
            string Ip_Address = string.Empty;

            long.TryParse(Session["UserId"].ToString(), out UserId);
            int.TryParse(Session["ModuleId"].ToString(), out ModuleId);
            Ip_Address = Request.ServerVariables["REMOTE_ADDR"].ToString().Trim();

            UserDetails dac = new UserDetails();

            res = dac.Des_Insert_UserAllotedQuestions(UserId, ModuleId, Ip_Address);
            dac = null;

            return(res);
        }
示例#2
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);
        }