示例#1
0
 private void FormWebForms_Load(object sender, EventArgs e)
 {
     textDateStart.Text = DateTime.Today.ToShortDateString();
     textDateEnd.Text   = DateTime.Today.ToShortDateString();
     if (!PrefC.HasClinicsEnabled)
     {
         groupFilters.Width = 240;              //Shrink to better fit just the date range pickers.
     }
     if (WebForms_Preferences.TryGetPreference(out _webFormPref))
     {
         if (string.IsNullOrEmpty(_webFormPref.CultureName))                //Just in case.
         {
             _webFormPref.CultureName = System.Globalization.CultureInfo.CurrentCulture.Name;
         }
     }
     FillGrid();
 }
示例#2
0
 private bool SavePrefs(bool includeAutoFillBirthdatePref = false)
 {
     Cursor = Cursors.WaitCursor;
     if (!WebForms_Preferences.SetPreferences(_webFormPref, urlOverride: textboxWebHostAddress.Text.Trim()))
     {
         Cursor = Cursors.Default;
         MsgBox.Show(this, "Either the registration key provided by the dental office is incorrect or the Host Server Address cannot be found.");
         return(false);
     }
     _webFormPrefOld = _webFormPref.Copy();
     if (Prefs.UpdateString(PrefName.WebHostSynchServerURL, textboxWebHostAddress.Text.Trim()) ||
         (includeAutoFillBirthdatePref && Prefs.UpdateBool(PrefName.WebFormsAutoFillNameAndBirthdate, checkAutoFillNameAndBirthdate.Checked)))
     {
         DataValid.SetInvalid(InvalidType.Prefs);
     }
     Cursor = Cursors.Default;
     return(true);
 }
示例#3
0
 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;
         _dentalOfficeID = WebUtils.GetDentalOfficeID();
         if (_dentalOfficeID == 0)
         {
             Cursor = Cursors.Default;
             MsgBox.Show(this, "Either the registration key provided by the dental office is incorrect or the Host Server Address cannot be found.");
             return;
         }
         if (WebForms_Preferences.TryGetPreference(out _webFormPref))
         {
             butWebformBorderColor.BackColor = _webFormPref.ColorBorder;
             _sheetDefAddress = WebUtils.GetSheetDefAddress();
             checkDisableWebFormSignatures.Checked = _webFormPref.DisableSignatures;
             if (string.IsNullOrEmpty(_webFormPref.CultureName))                    //Just in case.
             {
                 _webFormPref.CultureName = System.Globalization.CultureInfo.CurrentCulture.Name;
                 WebForms_Preferences.SetPreferences(_webFormPref);
             }
             _webFormPrefOld = _webFormPref.Copy();
         }
     }
     catch (Exception ex) {
         Cursor = Cursors.Default;
         MessageBox.Show(ex.Message);
     }
     FillGrid();            //Also gets sheet def list from server
     Cursor = Cursors.Default;
 }