protected void setTable()
    {
        SearchModule mySearchModule = new SearchModule();
        DataTable myDataTable = new DataTable();

        myDataTable = mySearchModule.ratedListOfApplicantsForJobPosition3(Request["pId"]).Copy();
        myDataTable.Columns.Add("Select for Interview", typeof(String));
        myDataTable.Columns.Add("Photo", typeof(String)).SetOrdinal(1);

        ApplicantsListGridView.DataSource = myDataTable;
        ApplicantsListGridView.DataBind();

        foreach (GridViewRow row in ApplicantsListGridView.Rows)
        {
            HyperLink hp = new HyperLink();
            hp.Text = row.Cells[2].Text;
            hp.NavigateUrl = "~/SearchCandidates.aspx?userId=" + row.Cells[0].Text;
            row.Cells[2].Controls.Add(hp);

            CheckBox cb = new CheckBox();
            row.Cells[selectRow].Controls.Add(cb);

            row.Cells[1].Controls.Clear();
            Image img = new Image();
            img.ImageUrl = "~/ShowPhoto.aspx?userId=" + row.Cells[0].Text;
            img.Height = 60;
            row.Cells[1].Controls.Add(img);
        }
    }
Example #2
0
        private void InjectDGJ()
        {
            Assembly dgjAssembly = Assembly.GetAssembly(typeof(SearchModule)); //如果没有点歌姬插件,插件的构造方法会抛出异常,无需考虑这里的assembly == null的情况
            Assembly dmAssembly  = Assembly.GetAssembly(Application.Current.MainWindow.GetType());
            Type     appType     = dmAssembly.ExportedTypes.FirstOrDefault(p => p.FullName == "Bililive_dm.App");
            ObservableCollection <DMPlugin> Plugins = (ObservableCollection <DMPlugin>)appType.GetField("Plugins", BindingFlags.GetField | BindingFlags.Static | BindingFlags.Public).GetValue(null);
            DMPlugin dgjPlugin = Plugins.FirstOrDefault(p => p.ToString() == "DGJv3.DGJMain");
            object   dgjWindow = null;

            try
            {
                dgjWindow = dgjAssembly.DefinedTypes.FirstOrDefault(p => p.Name == "DGJMain").GetField("window", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(dgjPlugin);
            }
            catch (ReflectionTypeLoadException Ex) // 缺少登录中心时
            {
                dgjWindow = Ex.Types.FirstOrDefault(p => p.Name == "DGJMain").GetField("window", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(dgjPlugin);
            }
            object searchModules = dgjWindow.GetType().GetProperty("SearchModules", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public).GetValue(dgjWindow);
            ObservableCollection <SearchModule> searchModules2 = (ObservableCollection <SearchModule>)searchModules.GetType().GetProperty("Modules", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public).GetValue(searchModules);
            SearchModule nullModule = (SearchModule)searchModules.GetType().GetProperty("NullModule", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance).GetValue(searchModules);
            SearchModule lwlModule  = searchModules2.FirstOrDefault(p => p != nullModule);

            if (lwlModule != null)
            {
                Action <string> logHandler = (Action <string>)lwlModule.GetType().GetProperty("_log", BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(lwlModule);
                ExtendNeteaseModule.SetLogHandler(logHandler);
            }
            searchModules2.Insert(2, ExtendNeteaseModule);
        }
    protected void search()
    {
        DataTable myDataTable = new DataTable();

        String keyword = SearchByDropDownList.SelectedValue;
        switch (keyword)
        {
            case "Name":
                myDataTable = new SearchModule().searchApplicantsByName(KeywordBox.Text).Copy();
                break;
            case "ComputerLanguage":
                myDataTable = new SearchModule().searchApplicantsByComputerLanguage(KeywordBox.Text).Copy();
                break;
            case "SoftSkill":
                myDataTable = new SearchModule().searchApplicantsBySoftSkill(KeywordBox.Text).Copy();
                break;
            case "JobPosition":
                if (!JobTypeDropDownList.SelectedValue.Equals("-1"))
                {
                    myDataTable = new SearchModule().searchApplicantsByJob(KeywordBox.Text, JobTypeDropDownList.SelectedValue).Copy();
                }
                else
                {
                    myDataTable = new SearchModule().searchApplicantsByJob(KeywordBox.Text).Copy();
                }
                break;
        }

        myDataTable.Columns.Add("Photo", typeof(String)).SetOrdinal(0);

        ResultsGridView.DataSource = myDataTable;
        ResultsGridView.DataBind();

        if (myDataTable.Rows.Count <= 0)
        {
            MessageLabel.Text = "No results found.";
            return;
        }
        else
        {
            MessageLabel.Text = "";
        }

        ResultsGridView.GridLines = GridLines.Horizontal;

        foreach (GridViewRow row in ResultsGridView.Rows)
        {
            HyperLink hp = new HyperLink();
            hp.Text = row.Cells[2].Text;
            hp.NavigateUrl = "~/SearchCandidates.aspx?userId=" + row.Cells[1].Text;
            row.Cells[2].Controls.Add(hp);

            row.Cells[1].Controls.Clear();
            Image img = new Image();
            img.ImageUrl = "~/ShowPhoto.aspx?userId=" + row.Cells[1].Text;
            img.Height = 60;
            row.Cells[1].Controls.Add(img);
        }
    }
        public ActionResult SearchMedias()
        {
            ViewBag.Title = "Search Medias";

            var model = new SearchModule();

            return(View(model));
        }
        public ActionResult SearchBuildings()
        {
            ViewBag.Title = "Search Buildings";

            var model = new SearchModule();

            return(View("SearchBuildings", model));
        }
 private void CreateModule()
 {
     Search = new SearchModule(_cache.Object, _cpMock.Object, _plexRequestMock.Object, _availabilityMock.Object,
                               _rServiceMock.Object, _sonarrApiMock.Object, _sonarrSettingsMock.Object,
                               _sickRageSettingsMock.Object, _cpApi.Object, _srApi.Object, _notificationService.Object,
                               _music.Object, _hpAPi.Object, _headphonesSettings.Object, _cpCache.Object, _sonarrCache.Object,
                               _srCache.Object, _plexApi.Object, _plexSettingsMock.Object, _authMock.Object,
                               _userRepo.Object, _emailSettings.Object, _issueService.Object, _analytics.Object, RequestLimitRepo.Object);
 }
    protected void search()
    {
        SearchModule mySearchModule = new SearchModule();
        JobPositionsGridView.DataSource = mySearchModule.searchJobPositionByTitle(KeywordTextBox.Text);
        JobPositionsGridView.DataBind();

        foreach (GridViewRow row in JobPositionsGridView.Rows)
        {
            HyperLink hp = new HyperLink();
            hp.Text = row.Cells[1].Text;
            hp.NavigateUrl = "~/ShowJobPositionsManager.aspx?pId=" + row.Cells[0].Text;
            row.Cells[1].Controls.Add(hp);
        }
    }
 private void InjectDGJ()
 {
     try
     {
         Assembly dgjAssembly = Assembly.GetAssembly(typeof(SearchModule)); //如果没有点歌姬插件,插件的构造方法会抛出异常,无需考虑这里的assembly == null的情况
         DMPlugin dgjPlugin   = Douyulive_dm.App.Plugins.FirstOrDefault(p => p.GetType() == typeof(DGJMain));
         if (dgjPlugin == null)                                             // 没有点歌姬
         {
             throw new DllNotFoundException();
         }
         object dgjWindow = null;
         try
         {
             dgjWindow = dgjAssembly.DefinedTypes.FirstOrDefault(p => p.Name == "DGJMain").GetField("window", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(dgjPlugin);
         }
         catch (ReflectionTypeLoadException Ex) // 缺少登录中心时
         {
             dgjWindow = Ex.Types.FirstOrDefault(p => p.Name == "DGJMain").GetField("window", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(dgjPlugin);
         }
         object searchModules = dgjWindow.GetType().GetProperty("SearchModules", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public).GetValue(dgjWindow);
         ObservableCollection <SearchModule> searchModules2 = (ObservableCollection <SearchModule>)searchModules.GetType().GetProperty("Modules", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public).GetValue(searchModules);
         SearchModule nullModule = (SearchModule)searchModules.GetType().GetProperty("NullModule", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance).GetValue(searchModules);
         SearchModule coelModule = searchModules2.FirstOrDefault(p => p != nullModule);
         ExtendNeteaseModule = new ExtendNeteaseModule();
         if (coelModule != null)
         {
             Action <string> logHandler = (Action <string>)coelModule.GetType().GetProperty("_log", BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(coelModule);
             ExtendNeteaseModule.SetLogHandler(logHandler);
         }
         searchModules2.Insert(2, ExtendNeteaseModule);
     }
     catch (DllNotFoundException)
     {
         throw;
     }
     catch (Exception Ex)
     {
         MessageBox.Show($"注入到点歌姬失败了喵\n{Ex}", "本地网易云喵块", 0, MessageBoxImage.Error);
         throw;
     }
 }
        private void SetSearchManagerValues(bool spellCheck, SearchModule SModule)
        {
            _searchesManager.Portal = _portal;
            _searchesManager.User = _user;
            if (SModule != null)
            {
                _searchesManager.EnhancedNumericSearchEnabled = SModule.EnhancedNumericSearchEnabled;
                _searchesManager.searchType = SModule.SearchType;
                _searchesManager.MaxResults = SModule.MaxResults;
                _searchesManager.SpellCheckEnabled = SModule.SpellCheckEnabled;
                _searchesManager.SuggestedSearchesEnabled = SModule.SuggestedSearchesEnabled;
                _searchesManager.SynonymsEnabled = SModule.SynonymsEnabled;
                _searchesManager.SolutionFinders = string.IsNullOrEmpty(SModule.SolutionFinders) ? "" : SModule.SolutionFinders;
                _searchesManager.AutoSummarization = SModule.AutoSummarization;

                // Sort Key from Search Sort
                List<KeyValuePair<int, string>> SearchSorted = SModule.DefaultSort.ToList();
                SearchSorted.Sort((FirstValue, SecondValue) =>
                {
                    return FirstValue.Key.CompareTo(SecondValue.Key);
                }
                );
                _searchesManager.DefaultSort = SearchSorted.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
                //
                _searchesManager.HighlightEnabled = SModule.ResultsDisplay.HighlightTerm;
            }
            else
            {
                _searchesManager.EnhancedNumericSearchEnabled = false;
                _searchesManager.searchType = SearchType.AllWords;
                _searchesManager.MaxResults = 200;
                _searchesManager.SpellCheckEnabled = false;
                _searchesManager.SuggestedSearchesEnabled = false;
                _searchesManager.SynonymsEnabled = false;
                _searchesManager.SolutionFinders = "";
                _searchesManager.HighlightEnabled = false;
            }
            if (!spellCheck) { _searchesManager.SpellCheckEnabled = false; }
        }
 private FilterDisplayValues InitializeFilterDisplay(SearchModule SModule)
 {
     FilterDisplayValues filterDisplay = new FilterDisplayValues()
     {
         Kb = SModule.IsDisplayFilterEnabled(FilterDisplay.kb),
         Categories = SModule.IsDisplayFilterEnabled(FilterDisplay.categories),
         Attributes = SModule.IsDisplayFilterEnabled(FilterDisplay.attributes),
         ContentTypes = SModule.IsDisplayFilterEnabled(FilterDisplay.contentTypes),
         Formats = SModule.IsDisplayFilterEnabled(FilterDisplay.formats),
     };
     return filterDisplay;
 }
 private string GetAutoSummarizationEnabled(SearchModule searchModule, SearchItem results, string searchString)
 {
     string autoSummEnabled = string.Empty;
     if (searchModule.AutoSummarizationEnabled)
     {
         if (_portal.ArticleTemplateBodySecurity)
         {
             if (results.ArtTemplateId > 0)
             {
                 string groups = string.Join(",", _portal.ArticleGroups.Select(arr => arr.Id.ToString()));
                 autoSummEnabled = _searchesManager.GetArticleSecuredSummary(results.Id, results.KbId, groups, results.FileExtn, searchModule.AutoSummarization.MaxLength, searchString, searchModule.ResultsDisplay.HighlightTerm);
             }
             else
             {
                 autoSummEnabled = results.Summary;
             }
         }
         else
         {
             autoSummEnabled = results.Summary;
         }
     }
     return autoSummEnabled;
 }