public void LoadModel(FilterModel model)
 {
     _model = model;
     chkIncludeNoEstimate.Checked = model.IncludeNoEstimate;
     cmboNarrowSearch.Text = model.UserSearch;
     chkIgnoreBaseSearch.Checked = model.IgnoreBaseSearch;
     txtBaseSearch.Enabled = !model.IgnoreBaseSearch;
     txtBaseSearch.Text = model.BaseSearch;
 }
Beispiel #2
0
        private void ShowFilterDialog()
        {
            Utils.Log.Debug("Showing filter dialog");
            FilterDialog f = new FilterDialog(this, _fb);
            f.LoadModel(_filter);
            if (f.ShowDialog() == DialogResult.OK)
            {
                _filter = f.SaveModel();
                _filter.History.PushSearch(_filter.UserSearch);
                if (_filter.Cases != null)
                    updateCaseDropdown(_filter.Cases);
                else
                    updateCases();

                _filter.History.Save();
            }
            Utils.Log.Debug("Closing filter dialog");
        }
 private void DoSearch()
 {
     _model = SaveModel();
     try
     {
         testSearchAsync(new RunWorkerCompletedEventHandler(delegate(object sender, RunWorkerCompletedEventArgs args)
         {
             if (args.Error == null)
             {
                 _model.Cases = (Case[])args.Result;
                 listTestResults.Items.Clear();
                 foreach (Case c in _model.Cases)
                     listTestResults.Items.Add(c);
             }
             else
                 Utils.ShowErrorMessage("Error while executing search.\n" + args.Error.ToString());
         }));
     }
     catch (ECommandFailed x)
     {
         Utils.Log.Error(x.Message);
         Utils.ShowErrorMessage(x.Message, "Error in search syntax");
     }
 }