Exemple #1
0
 private void FetchValuesFromWebServer()
 {
     try {
         String WebHostSynchServerURL = PrefC.GetString(PrefName.WebHostSynchServerURL);
         textboxWebHostAddress.Text = WebHostSynchServerURL;
         butSave.Enabled            = false;
         //#if DEBUG // ignore the certificate errors for the staging machine and development machine
         if ((WebHostSynchServerURL == SynchUrlStaging) || (WebHostSynchServerURL == SynchUrlDev))
         {
             IgnoreCertificateErrors();
         }
         //#endif
         Cursor = Cursors.WaitCursor;
         if (!TestWebServiceExists())
         {
             Cursor = Cursors.Default;
             MsgBox.Show(this, "Either the web service is not available or the WebHostSynch URL is incorrect");
             return;
         }
         DentalOfficeID = wh.GetDentalOfficeID(RegistrationKey);
         if (wh.GetDentalOfficeID(RegistrationKey) == 0)
         {
             Cursor = Cursors.Default;
             MsgBox.Show(this, "Registration key provided by the dental office is incorrect");
             return;
         }
         OpenDental.WebSheets.webforms_preference PrefObj = wh.GetPreferences(RegistrationKey);
         if (PrefObj == null)
         {
             Cursor = Cursors.Default;
             MsgBox.Show(this, "There has been an error retrieving values from the server");
         }
         butWebformBorderColor.BackColor = Color.FromArgb(PrefObj.ColorBorder);
         SheetDefAddress = wh.GetSheetDefAddress(RegistrationKey);
         //dennis: the below if statement is for backward compatibility only April 14 2011 and can be removed later.
         if (String.IsNullOrEmpty(PrefObj.CultureName))
         {
             PrefObj.CultureName = System.Globalization.CultureInfo.CurrentCulture.Name;
             wh.SetPreferencesV2(RegistrationKey, PrefObj);
         }
     }
     catch (Exception ex) {
         Cursor = Cursors.Default;
         MessageBox.Show(ex.Message);
     }
     FillGrid();            //Also gets sheet def list from server
     Cursor = Cursors.Default;
 }
Exemple #2
0
 private void ShowColorDialog()
 {
     colorDialog1.Color = butWebformBorderColor.BackColor;
     if (colorDialog1.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     butWebformBorderColor.BackColor = colorDialog1.Color;
     Cursor = Cursors.WaitCursor;
     if (!TestWebServiceExists())
     {
         Cursor = Cursors.Default;
         MsgBox.Show(this, "Either the web service is not available or the WebHostSynch URL is incorrect.");
         return;
     }
     try {
         if (wh.GetDentalOfficeID(RegistrationKey) == 0)
         {
             Cursor = Cursors.Default;
             MsgBox.Show(this, "Registration key incorrect.");
             return;
         }
         OpenDental.WebSheets.webforms_preference PrefObj = new OpenDental.WebSheets.webforms_preference();
         PrefObj.ColorBorder = butWebformBorderColor.BackColor.ToArgb();
         PrefObj.CultureName = System.Globalization.CultureInfo.CurrentCulture.Name;
         bool IsPrefSet = wh.SetPreferencesV2(RegistrationKey, PrefObj);
         Cursor = Cursors.Default;
         if (!IsPrefSet)
         {
             MsgBox.Show(this, "Error, color could not be saved to server.");
         }
     }
     catch (Exception ex) {
         Cursor = Cursors.Default;
         MessageBox.Show(ex.Message);
     }
 }
Exemple #3
0
		private void ShowColorDialog(){
			colorDialog1.Color=butWebformBorderColor.BackColor;
			if(colorDialog1.ShowDialog()!=DialogResult.OK) {
				return;
			}
			butWebformBorderColor.BackColor=colorDialog1.Color;
			Cursor=Cursors.WaitCursor;
			if(!TestWebServiceExists()) {
				Cursor=Cursors.Default;
				MsgBox.Show(this,"Either the web service is not available or the WebHostSynch URL is incorrect.");
				return;
			}
			try {
				if(wh.GetDentalOfficeID(RegistrationKey)==0) {
					Cursor=Cursors.Default;
					MsgBox.Show(this,"Registration key incorrect.");
					return;
				}
				OpenDental.WebSheets.webforms_preference PrefObj=new OpenDental.WebSheets.webforms_preference();
				PrefObj.ColorBorder=butWebformBorderColor.BackColor.ToArgb();
				PrefObj.CultureName=System.Globalization.CultureInfo.CurrentCulture.Name;
				bool IsPrefSet=wh.SetPreferencesV2(RegistrationKey,PrefObj);
				Cursor=Cursors.Default;
				if(!IsPrefSet) {
					MsgBox.Show(this,"Error, color could not be saved to server.");
				}
			}
			catch(Exception ex) {
				Cursor=Cursors.Default;
				MessageBox.Show(ex.Message);
			}
		}