Example #1
0
        /// <summary>
        /// To insert the Other test user details
        /// </summary>
        private long InsertOther_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 = "EMP_Questions";
            string examCode = "EMP";

            if (ModuleId == 36)
            {
                alloted_questions_tbl = "EMP_Questions";
                examCode = "EMP";
            }
            if (ModuleId == 40)
            {
                alloted_questions_tbl = "BookProcessing_Questions";
                examCode = "BPAI";
            }
            if (ModuleId == 46)
            {
                alloted_questions_tbl = "PIR_Questions";
                examCode = "PIR";
            }
            if (ModuleId == 49)
            {
                alloted_questions_tbl = "JP_Questions";
                examCode = "JP";
            }


            UserDetails dac = new UserDetails();

            UserId = dac.InsertOther_UserDetails(userEmail, examinerName, alloted_questions_tbl, examCode, ModuleId, RoleId);
            if (UserId > 0)
            {
                if (ModuleId != 46 && ModuleId != 49)
                {
                    string Ip_Address = Request.ServerVariables["REMOTE_ADDR"].ToString().Trim();
                    int    res        = 0;
                    //res = dac.InsertObj_UserAllotedQuestions(UserId, ModuleId, Ip_Address);

                    res = dac.InsertOther_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);
        }