예제 #1
0
 /*
  * private static void DeleteObjects(List<DeletedObject> dO,double totalCount,ref double currentVal) {
  *      int LocalBatchSize=BatchSize;
  *      if(IsTroubleshootMode) {
  *              LocalBatchSize=1;
  *      }
  *      for(int start=0;start<dO.Count;start+=LocalBatchSize) {
  *              try {
  *              if((start+LocalBatchSize)>dO.Count) {
  *                      mb.DeleteObjects(PrefC.GetString(PrefName.RegistrationKey),dO.ToArray()); //dennis check this - why is it not done in batches.
  *                      LocalBatchSize=dO.Count-start;
  *              }
  *              currentVal+=BatchSize;
  *              if(Application.OpenForms["FormProgress"]!=null) {// without this line the following error is thrown: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." or a null pointer exception is thrown when an automatic synch is done by the system.
  *                      FormP.Invoke(new PassProgressDelegate(PassProgressToDialog),
  *                              new object[] {currentVal,"?currentVal of ?maxVal records uploaded",totalCount,"" });
  *              }
  *                                              }
  *              catch(Exception e) {
  *                      if(IsTroubleshootMode) {
  *                              //string errorMessage="DeleteObjects with Primary Key = "+BlockPKNumList.First() + " failed to synch. " +  "\n" + e.Message;
  *                              //throw new Exception(errorMessage);
  *                      }
  *                      else {
  *                              throw e;
  *                      }
  *              }
  *      }//for loop ends here
  *
  * }
  */
 /// <summary>An empty method to test if the webservice is up and running. This was made with the intention of testing the correctness of the webservice URL. If an incorrect webservice URL is used in a background thread the exception cannot be handled easily to a point where even a correct URL cannot be keyed in by the user. Because an exception in a background thread closes the Form which spawned it.</summary>
 private static bool TestWebServiceExists()
 {
     try {
         mb.Url = PrefC.GetString(PrefName.MobileSyncServerURL);
         if (mb.ServiceExists())
         {
             return(true);
         }
     }
     catch {
         return(false);
     }
     return(false);
 }
예제 #2
0
 ///<summary>This takes about 3-5 seconds to run, so we don't run it automatically when first opening the form.</summary>
 private string GetPatientPortalLink()
 {
     mb.Url = PrefC.GetString(PrefName.MobileSyncServerURL);
     if (!mb.ServiceExists())
     {
         return("");
     }
     try {
         long   customerNum       = mb.GetCustomerNum(PrefC.GetString(PrefName.RegistrationKey));
         string patientPortalLink = mb.GetPatientPortalAddress(PrefC.GetString(PrefName.RegistrationKey)) + "?DentalOfficeID=" + customerNum;
         return(patientPortalLink);
     }
     catch {
         return("");
     }
 }