Exemple #1
0
        public List <Review> GetReviews(int courseID)
        {
            var query = "select cor_id ReviewID, cor_cou_id CourseID, cor_user_id UserID, cor_text ReviewText, cor_creation_date ReviewCreationDate from courses_reviews where cor_cou_id = " + courseID;
            var list  = db.GetList <Review>(query);

            return(list);
        }
        public List <Question> GetList()
        {
            var query = "select qns.qns_id QuestionID, qns.qns_likes QuestionLikes, qns.qns_views QuestionViews, qns.qns_comments QuestionAnswers, qns.qns_text QuestionText, qns.qns_name QuestionName, qns.qns_creation_date QuestionCreationDate from questions qns";
            var list  = db.GetList <Question>(query);

            return(list);
        }
        public List <Question> GetSortedList(string key)
        {
            var query = "select qns.qns_id QuestionID, qns.qns_likes QuestionLikes, qns.qns_views QuestionViews, qns.qns_comments QuestionAnswers, qns.qns_text QuestionText, qns.qns_name QuestionName, qns.qns_creation_date QuestionCreationDate from questions qns";
            var list  = db.GetList <Question>(query);

            key.ToLower();
            for (int i = 0; i < list.Count; i++)
            {
                string name = list[i].QuestionName.ToLower();
                if (!name.Contains(key))
                {
                    list.RemoveAt(i);
                    i--;
                }
            }
            return(list);
        }
        public List <Course> GetList()
        {
            var query = "select cou_id CourseID, cou_name CourseName, cou_difficulty CourseDifficulty, cou_description CourseDescription, cou_creation_date CourseCreationDate from courses";
            var list  = db.GetList <Course>(query);

            //CheckList.ReplaceList(questionList);
            return(list);
        }