Beispiel #1
0
        public DataTable GetExamByExamID(Enums.Aptitude_ExamType examType, int userID)
        {
            string SQL = "SELECT * FROM [MCQ_Exam] Ex WHERE ExamID NOT IN ( "
                         + "select ExamID from [MCQ_Performance] where UserID = "
                         + "'" + userID + "'" + ")";

            using (SqlConnection con = new SqlConnection(constr))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.CommandText = SQL;
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        using (DataSet ds = new DataSet())
                        {
                            DataTable dt = new DataTable();
                            sda.Fill(dt);
                            return(dt);
                        }
                    }
                }
            }
        }
        public DataTable GetExamByExamID(Enums.Aptitude_ExamType examType, int userID)
        {
            var UserDetails    = UserDAL.Instance.getInstalluserDetails(userID);
            var _designationId = "0";

            if (UserDetails.Tables[0].Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(Convert.ToString(UserDetails.Tables[0].Rows[0]["DesignationID"])))
                {
                    _designationId = Convert.ToString(UserDetails.Tables[0].Rows[0]["DesignationID"]);
                }
            }

            string SQL = @"SELECT * FROM [MCQ_Exam] Ex WHERE
                (',' + RTRIM(Ex.DesignationID) + ',') LIKE '%," + _designationId + ",%' AND ExamID NOT IN ( "
                         + "select ExamID from [MCQ_Performance] where UserID = "
                         + "'" + userID + "'" + ")";

            using (SqlConnection con = new SqlConnection(constr))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.CommandText = SQL;
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        using (DataSet ds = new DataSet())
                        {
                            DataTable dt = new DataTable();
                            sda.Fill(dt);
                            return(dt);
                        }
                    }
                }
            }
        }
 public DataTable GetExamByExamID(Enums.Aptitude_ExamType ExamType, int userID)
 {
     return(AptitudeTestDAL.Instance.GetExamByExamID(ExamType, userID));
 }