Example #1
0
 private void checkPatientPortalPayEnabled_Click(object sender, EventArgs e)
 {
     if (checkPatientPortalPayEnabled.Checked)
     {
         long clinicNum = 0;
         if (PrefC.HasClinicsEnabled)
         {
             clinicNum = _listUserClinicNums[comboClinic.SelectedIndex];
         }
         OpenDentBusiness.WebTypes.Shared.XWeb.WebPaymentProperties xwebProperties = new OpenDentBusiness.WebTypes.Shared.XWeb.WebPaymentProperties();
         try {
             ProgramProperties.GetXWebCreds(clinicNum, out xwebProperties);
         }
         catch (Exception ex) {
             ex.DoNothing();
         }
         string msg = "Online payments is already enabled for XWeb and must be disabled in order to use PayConnect online payments.  "
                      + "Would you like to disable XWeb online payments?";
         if (xwebProperties != null && xwebProperties.IsPaymentsAllowed && MessageBox.Show(msg, "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
         {
             checkPatientPortalPayEnabled.Checked = false;
             return;
         }
         //User wants to disable XWeb online payments and use PayConnect online payments
         ProgramProperty ppOnlinePaymentEnabled = ProgramProperties.GetWhere(x =>
                                                                             x.ProgramNum == Programs.GetCur(ProgramName.Xcharge).ProgramNum &&
                                                                             x.ClinicNum == clinicNum &&
                                                                             x.PropertyDesc == "IsOnlinePaymentsEnabled")
                                                  .FirstOrDefault();
         if (ppOnlinePaymentEnabled == null)
         {
             return;                    //Should never happen since we successfully found it in the GetXWebCreds method.
         }
         _listXWebWebPayProgProps.Add(ppOnlinePaymentEnabled);
     }
 }