コード例 #1
0
        public static List <Course> search_course(string query)
        {
            List <SearchToken> search_tokens = SearchToken.getTokens(query);

            List <Course> courses = new List <Course>();

            courses.AddRange(search_courses_by_course_tag(search_tokens));
            courses.AddRange(search_courses_by_course_type_tag(search_tokens));
            courses.AddRange(search_courses_by_specialization_tag(search_tokens));


            return(courses);
        }
コード例 #2
0
        public static void add(long center_id, string input)
        {
            List <SearchToken> searchTokens = SearchToken.getTokens(input);

            using (SqlConnection con = new SqlConnection(Database.connection_string))
            {
                con.Open();
                foreach (SearchToken st in searchTokens)
                {
                    SqlCommand com = new SqlCommand("CenterTag", con);
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.AddWithValue("@center_id", center_id);
                    com.Parameters.AddWithValue("@tag", st.tag);
                    com.Parameters.AddWithValue("@soundex", st.soundex);
                    com.Parameters.AddWithValue("@source", st.source);
                    com.Parameters.AddWithValue("@Action", "Insert");

                    SQL_Utility.Stored_Procedure(ref com);

                    com.ExecuteNonQuery();
                }
            }
        }
コード例 #3
0
 public void test()
 {
     List <Course>      courses        = Search_crud.search_course("Android كيمياء");
     List <SearchToken> search_tokeens = SearchToken.getTokens("Android اندرويد Software سوفوير Course كورس using java جافا or swift سويفت");
 }