예제 #1
0
 /// <summary>
 /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
 protected override void OnPreRender(EventArgs e)
 {
     if (loadSearchResults)
     {
         grdMatches.DataSource = IntegrationManager.GetMatches();
         grdMatches.DataBind();
     }
     SetViewDisplay();
     InitializeScript();
 }
    /// <summary>
    /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event.
    /// </summary>
    /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
    protected override void OnPreRender(EventArgs e)
    {
        InitializeScript();
        rdbCreateNew.Attributes.Add("onClick", "return advancedSearchOptions.clearTargetSelection();");
        rdbRefineSearch.Attributes.Add("onClick", "return advancedSearchOptions.clearTargetSelection();");
        string error = String.Empty;

        if (_loadSearchResults)
        {
            grdMatches.DataSource = IntegrationManager.GetMatches(out error);
            grdMatches.DataBind();
        }
        SetViewDisplay(error);
    }
    /// <summary>
    /// Handles the OnClick event of the btnReloadGrid control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void btnReloadGrid_OnClick(object sender, EventArgs e)
    {
#pragma warning disable 612,618
        var filters = (JavaScriptArray)JavaScriptConvert.DeserializeObject(txtFilters.Text);
        List <MatchingExpression> expressions = (from JavaScriptObject filter in filters
                                                 select
                                                 new MatchingExpression(filter["fieldName"].ToString(),
                                                                        (MatchingOperation)
                                                                        Convert.ToInt16(filter["operator"]),
                                                                        filter["searchValue"].ToString())).ToList();
#pragma warning restore 612,618
        grdMatches.DataSource = IntegrationManager.GetMatches(expressions);
        grdMatches.DataBind();
        _loadSearchResults = false;
    }
예제 #4
0
 /// <summary>
 /// Raises the <see cref="E:System.Web.UI.Control.PreRender"/> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
 protected override void OnPreRender(EventArgs e)
 {
     try
     {
         InitializeScript();
         rdbCreateNew.Attributes.Add("onClick", "return advancedSearchOptions.clearTargetSelection();");
         rdbRefineSearch.Attributes.Add("onClick", "return advancedSearchOptions.clearTargetSelection();");
         string error = String.Empty;
         if (_loadSearchResults)
         {
             grdMatches.DataSource = IntegrationManager.GetMatches(out error);
             grdMatches.DataBind();
         }
         SetViewDisplay(error);
     }
     catch (Exception ex)
     {
         rdbRefineSearch.Visible = false;
         //SetViewDisplay will update UI to display the appropriate error
     }
 }