Example #1
0
        //this executes _off_ the UI thread
        static void CustomerSearchOnExecute(CustomerSearchArgs state)
        {
// ReSharper disable InconsistentNaming
            using (var Customer_Search = new Proc("Customer_Search"))
// ReSharper restore InconsistentNaming
                state.ResultTable = Customer_Search.AssignValues(state.Values).ExecuteDataSet(state).Tables[0];
        }
Example #2
0
        void CustomerSearchOnCompleted(CustomerSearchArgs state)
        {
            if (state.Success)
            {
                gridCustomerSearch.ItemsSource = state.ResultTable.DefaultView;

                //if (multiple) client search results correspond to the same sponsor, then automatically open that household tab
                var sponsorGUIDs = state.ResultTable.AsEnumerable().GroupBy(r => r["SponsorGUID"]).Select(g => g.Key.ToString());
// ReSharper disable PossibleMultipleEnumeration
                if (sponsorGUIDs.Count() == 1)
                {
                    RoutedCommands.OpenSponsor.Execute(sponsorGUIDs.First(), null);                    //for user convenience, automatically fire up the sponsor page if we only got one hit
                }
// ReSharper restore PossibleMultipleEnumeration
            }
            else
            {
                lblCustomerSearchError.Text = state.Text;
            }
        }
    void CustomerSearchOnCompleted(CustomerSearchArgs state)
    {
      if (state.Success)
      {
        gridCustomerSearch.ItemsSource = state.ResultTable.DefaultView;

        //if (multiple) client search results correspond to the same sponsor, then automatically open that household tab
        var sponsorGUIDs = state.ResultTable.AsEnumerable().GroupBy(r => r["SponsorGUID"]).Select(g => g.Key.ToString());
// ReSharper disable PossibleMultipleEnumeration
        if (sponsorGUIDs.Count() == 1) RoutedCommands.OpenSponsor.Execute(sponsorGUIDs.First(), null); //for user convenience, automatically fire up the sponsor page if we only got one hit
// ReSharper restore PossibleMultipleEnumeration
      }
      else
        lblCustomerSearchError.Text = state.Text;
    }
    //this executes _off_ the UI thread
    static void CustomerSearchOnExecute(CustomerSearchArgs state)
    {
// ReSharper disable InconsistentNaming
      using (var Customer_Search = new Proc("Customer_Search"))
// ReSharper restore InconsistentNaming
        state.ResultTable = Customer_Search.AssignValues(state.Values).ExecuteDataSet(state).Tables[0];
    }