private void FetchValuesFromWebServer() { try { String WebHostSynchServerURL = PrefC.GetString(PrefName.WebHostSynchServerURL); textboxWebHostAddress.Text = WebHostSynchServerURL; butSave.Enabled = false; if ((WebHostSynchServerURL == WebFormL.SynchUrlStaging) || (WebHostSynchServerURL == WebFormL.SynchUrlDev)) { WebFormL.IgnoreCertificateErrors(); } 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; }
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); } }
/// <remarks/> public void SetPreferencesV2Async(string RegistrationKey, webforms_preference prefObj, object userState) { if ((this.SetPreferencesV2OperationCompleted == null)) { this.SetPreferencesV2OperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPreferencesV2OperationCompleted); } this.InvokeAsync("SetPreferencesV2", new object[] { RegistrationKey, prefObj}, this.SetPreferencesV2OperationCompleted, userState); }
/// <remarks/> public void SetPreferencesV2Async(string RegistrationKey, webforms_preference prefObj) { this.SetPreferencesV2Async(RegistrationKey, prefObj, null); }
public bool SetPreferencesV2(string RegistrationKey, webforms_preference prefObj) { object[] results = this.Invoke("SetPreferencesV2", new object[] { RegistrationKey, prefObj}); return ((bool)(results[0])); }