public static void CreateDataServiceMethod(DataFetchArguments Fetch, RunWorkerCompletedEventHandler OnComplete)
 {
     try
     {
         //error checks
         if (Fetch.SqlCommandArguments != null)
         {
             foreach (object obj in Fetch.SqlCommandArguments)
             {
                 if ((string)obj == "")
                 {
                     MessageBox.Show("Blank message sent");
                     return;
                 }
             }
         }
         if (Fetch.SqlCommandArgumentNames != null)
         {
             foreach (string obj in Fetch.SqlCommandArgumentNames)
             {
                 if ((string)obj == "")
                 {
                     MessageBox.Show("Blank message name sent");
                     return;
                 }
             }
         }
         BackgroundWorker AsyncWorker = new BackgroundWorker();
         AsyncWorker.WorkerSupportsCancellation = true;
         waitPage = new Waiting();
         waitPage.Show();
         AsyncWorker.DoWork += Services.DataServices.Worker_DoWork;
         AsyncWorker.RunWorkerCompleted += OnComplete;
         AsyncWorker.RunWorkerCompleted += UIWorker_RunWorkerCompleted;
         AsyncWorker.RunWorkerAsync(Fetch);
     }
     catch(Exception er)
     {
         MessageBox.Show("There was an error processing this request; the string may be in the incorrect format.");
         return;
     }
 }
Exemple #2
0
 public static void CreateDataServiceMethod(DataFetchArguments Fetch, RunWorkerCompletedEventHandler OnComplete)
 {
     try
     {
         //error checks
         if (Fetch.SqlCommandArguments != null)
         {
             foreach (object obj in Fetch.SqlCommandArguments)
             {
                 if ((string)obj == "")
                 {
                     MessageBox.Show("Blank message sent");
                     return;
                 }
             }
         }
         if (Fetch.SqlCommandArgumentNames != null)
         {
             foreach (string obj in Fetch.SqlCommandArgumentNames)
             {
                 if ((string)obj == "")
                 {
                     MessageBox.Show("Blank message name sent");
                     return;
                 }
             }
         }
         BackgroundWorker AsyncWorker = new BackgroundWorker();
         AsyncWorker.WorkerSupportsCancellation = true;
         waitPage = new Waiting();
         waitPage.Show();
         AsyncWorker.DoWork             += Services.DataServices.Worker_DoWork;
         AsyncWorker.RunWorkerCompleted += OnComplete;
         AsyncWorker.RunWorkerCompleted += UIWorker_RunWorkerCompleted;
         AsyncWorker.RunWorkerAsync(Fetch);
     }
     catch (Exception er)
     {
         MessageBox.Show("There was an error processing this request; the string may be in the incorrect format.");
         return;
     }
 }