Exemple #1
0
        private void g_level_filtered_comms(string glevel)
        {
            AdvanceSearching LNEngine_AdvanceSearch = new AdvanceSearching();

            switch (type)
            {
            case 1:
                LNEngine_AdvanceSearch.perform_search("ID", adsearch_txtbox.Text, glevel);
                results_lv.Items.Clear();
                if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                {
                    for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                    {
                        DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                        ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                        fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                        fetched_data.SubItems.Add(dr["Author"].ToString());
                        //  fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                        fetched_data.SubItems.Add(dr["w_tags"].ToString());
                        results_lv.Items.Add(fetched_data);
                    }
                }
                break;

            case 2:
                LNEngine_AdvanceSearch.perform_search("Author", adsearch_txtbox.Text, glevel);
                results_lv.Items.Clear();
                if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                {
                    for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                    {
                        DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                        ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                        fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                        fetched_data.SubItems.Add(dr["Author"].ToString());
                        //   fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                        fetched_data.SubItems.Add(dr["w_tags"].ToString());

                        results_lv.Items.Add(fetched_data);
                    }
                }
                break;

            case 3:
                LNEngine_AdvanceSearch.perform_search("Tags", adsearch_txtbox.Text, glevel);
                results_lv.Items.Clear();
                if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                {
                    for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                    {
                        DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                        ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                        fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                        fetched_data.SubItems.Add(dr["Author"].ToString());
                        // fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                        fetched_data.SubItems.Add(dr["w_tags"].ToString());
                        results_lv.Items.Add(fetched_data);
                    }
                }
                break;
            }
        }
Exemple #2
0
        private void search_type()
        {
            AdvanceSearching LNEngine_AdvanceSearch = new AdvanceSearching();

            if (g_level_filt.SelectedItem.ToString() == "" | g_level_filt.SelectedItem.ToString() == "All"
                | String.IsNullOrWhiteSpace(g_level_filt.SelectedItem.ToString()))
            {
                switch (type)
                {
                case 1:
                    LNEngine_AdvanceSearch.perform_search("ID", adsearch_txtbox.Text, "");
                    results_lv.Items.Clear();
                    if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                        {
                            DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                            ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                            fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                            fetched_data.SubItems.Add(dr["Author"].ToString());
                            //  fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                            fetched_data.SubItems.Add(dr["w_tags"].ToString());
                            results_lv.Items.Add(fetched_data);
                        }
                    }
                    break;

                case 2:
                    LNEngine_AdvanceSearch.perform_search("Author", adsearch_txtbox.Text, "");
                    results_lv.Items.Clear();
                    if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                        {
                            DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                            ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                            fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                            fetched_data.SubItems.Add(dr["Author"].ToString());
                            //   fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                            fetched_data.SubItems.Add(dr["w_tags"].ToString());

                            results_lv.Items.Add(fetched_data);
                        }
                    }
                    break;

                case 3:
                    LNEngine_AdvanceSearch.perform_search("Tags", adsearch_txtbox.Text, "");
                    results_lv.Items.Clear();
                    if (LNEngine_AdvanceSearch.dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < LNEngine_AdvanceSearch.dt.Rows.Count; i++)
                        {
                            DataRow      dr           = LNEngine_AdvanceSearch.dt.Rows[i];
                            ListViewItem fetched_data = new ListViewItem(dr["ID"].ToString());
                            fetched_data.SubItems.Add(dr["ResourceN"].ToString());
                            fetched_data.SubItems.Add(dr["Author"].ToString());
                            // fetched_data.SubItems.Add(dr["GradeLevel"].ToString());
                            fetched_data.SubItems.Add(dr["w_tags"].ToString());
                            results_lv.Items.Add(fetched_data);
                        }
                    }
                    break;
                }
            }
            else
            {
                switch (glevel_int)
                {
                case 11:
                    g_level_filtered_comms("G7");
                    break;

                case 12:
                    g_level_filtered_comms("G8");
                    break;

                case 13:
                    g_level_filtered_comms("G9");
                    break;

                case 14:
                    g_level_filtered_comms("G10");
                    break;
                    //ADD CODES HERE
                }
            }
        }