Esempio n. 1
0
		private void menuItemSetup_Click(object sender,EventArgs e) {
			FormEServicesSetup formPPS=new FormEServicesSetup();
			formPPS.ShowDialog();
			if(formPPS.DialogResult==DialogResult.OK) {
				textPatientPortalURL.Text=PrefC.GetString(PrefName.PatientPortalURL);
			}
		}
Esempio n. 2
0
        private void menuItemSetup_Click(object sender, EventArgs e)
        {
            FormEServicesSetup formPPS = new FormEServicesSetup(FormEServicesSetup.EService.PatientPortal);

            formPPS.ShowDialog();
            textPatientPortalURL.Text = PrefC.GetString(PrefName.PatientPortalURL);
        }
        private void menuItemSetup_Click(object sender, EventArgs e)
        {
            FormEServicesSetup formPPS = new FormEServicesSetup(FormEServicesSetup.EService.PatientPortal);

            formPPS.ShowDialog();
            if (formPPS.DialogResult == DialogResult.OK)
            {
                VerifyInputs();                //Validates preferences that are necessary to sending notification emails.
            }
        }
Esempio n. 4
0
 /// <summary>When the user is trying to send a text message, if sending the text would exceed the users spending limit, this handles that error.
 /// If the user has permission to increase the spending limit, open a new FormEservicesSetup to allow them to increase their spending limit,
 /// otherwise warn them that they do not have permission. Returns true if the error passed in matches the spending limit error, false otherwise. </summary>
 public static bool ProcessSendSmsException(Exception ex)
 {
     if ((ex is ODException) && ((ODException)ex).ErrorCode == 1)
     {
         if (MsgBox.Show(typeof(FormEServicesSetup), MsgBoxButtons.YesNo, ex.Message + " Do you want to increase this spending limit?"))
         {
             if (Security.IsAuthorized(Permissions.EServicesSetup))
             {
                 FormEServicesSetup formEservice = new FormEServicesSetup();
                 formEservice.Show();
             }
         }
         return(true);
     }
     return(false);
 }
        //===============================================================================================


        private void butSetup_Click(object sender, EventArgs e)
        {
            FormEServicesSetup FormESS = new FormEServicesSetup(FormEServicesSetup.EService.eConfirmRemind);

            FormESS.Show();
        }
Esempio n. 6
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            string phone = textPhone.Text;

            if (!TelephoneNumbers.IsNumberValid(ref phone))
            {
                MessageBox.Show(Lan.g(this, "Invalid phone"));
                return;
            }
            string fax = textFax.Text;

            if (!TelephoneNumbers.IsNumberValid(ref fax))
            {
                MessageBox.Show(Lan.g(this, "Invalid fax"));
                return;
            }
            if (radioInsBillingProvSpecific.Checked && _selectedBillingProvNum < 1)
            {
                MsgBox.Show(this, "You must select a provider.");
                return;
            }
            if (listProvider.SelectedIndex == -1 &&      //practice really needs a default prov
                _listProviders.Count > 0)
            {
                listProvider.SelectedIndex = 0;
            }
            if (_listProviders.Count > 0 &&
                _listProviders[listProvider.SelectedIndex].FeeSched == 0)           //Default provider must have a fee schedule set.
            {
                MsgBox.Show(this, "The selected provider must have a fee schedule set before they can be the default provider.");
                return;
            }
            bool changed = false;

            if (Prefs.UpdateBool(PrefName.PracticeIsMedicalOnly, checkIsMedicalOnly.Checked)
                | Prefs.UpdateString(PrefName.PracticeTitle, textPracticeTitle.Text)
                | Prefs.UpdateString(PrefName.PracticeAddress, textAddress.Text)
                | Prefs.UpdateString(PrefName.PracticeAddress2, textAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticeCity, textCity.Text)
                | Prefs.UpdateString(PrefName.PracticeST, textST.Text)
                | Prefs.UpdateString(PrefName.PracticeZip, textZip.Text)
                | Prefs.UpdateString(PrefName.PracticePhone, phone)
                | Prefs.UpdateString(PrefName.PracticeFax, fax)
                | Prefs.UpdateBool(PrefName.UseBillingAddressOnClaims, checkUseBillingAddressOnClaims.Checked)
                | Prefs.UpdateString(PrefName.PracticeBillingAddress, textBillingAddress.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingAddress2, textBillingAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingCity, textBillingCity.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingST, textBillingST.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingZip, textBillingZip.Text)
                | Prefs.UpdateString(PrefName.PracticePayToAddress, textPayToAddress.Text)
                | Prefs.UpdateString(PrefName.PracticePayToAddress2, textPayToAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticePayToCity, textPayToCity.Text)
                | Prefs.UpdateString(PrefName.PracticePayToST, textPayToST.Text)
                | Prefs.UpdateString(PrefName.PracticePayToZip, textPayToZip.Text)
                | Prefs.UpdateString(PrefName.PracticeBankNumber, textBankNumber.Text))
            {
                changed = true;
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("CH"))             //CH is for switzerland. eg de-CH
            {
                if (Prefs.UpdateString(PrefName.BankRouting, textBankRouting.Text)
                    | Prefs.UpdateString(PrefName.BankAddress, textBankAddress.Text))
                {
                    changed = true;
                }
            }
            if (listProvider.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultProv, _listProviders[listProvider.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (listBillType.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultBillType
                                     , _listBillingTypeDefs[listBillType.SelectedIndex].DefNum))
                {
                    changed = true;
                }
            }
            if (Prefs.UpdateLong(PrefName.DefaultProcedurePlaceService, listPlaceService.SelectedIndex))
            {
                changed = true;
            }
            if (radioInsBillingProvDefault.Checked)            //default=0
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, 0))
                {
                    changed = true;
                }
            }
            else if (radioInsBillingProvTreat.Checked)            //treat=-1
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, -1))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, _selectedBillingProvNum))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            FormEServicesSetup.UploadPreference(PrefName.PracticeTitle);
            DialogResult = DialogResult.OK;
        }
Esempio n. 7
0
		private void menuItemListenerService_Click(object sender,EventArgs e) {
			FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.ListenerService);
			FormESS.ShowDialog();
		}
Esempio n. 8
0
		private void menuItemWebSched_Click(object sender,EventArgs e) {
			FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.WebSched);
			FormESS.ShowDialog();
		}
Esempio n. 9
0
		private void menuItemPatientPortal_Click(object sender,EventArgs e) {
			FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.PatientPortal);
			FormESS.ShowDialog();
		}
Esempio n. 10
0
		private void menuMobileWeb_Click(object sender,EventArgs e) {
			FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.MobileNew);
			FormESS.ShowDialog();
		}
Esempio n. 11
0
		private void menuItemMobileSync_Click(object sender,EventArgs e) {
			FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.MobileOld);
			FormESS.ShowDialog();
		}
Esempio n. 12
0
 /// <summary>May be called from other parts of the program without showing this form. You must still create an instance of this form though.
 /// Checks CallFire bridge, if it is OK to send a text, etc. (Buttons to load this form are usually disabled if it is not OK,
 /// but this is needed for Confirmations, Recalls, etc.). CanIncreaseLimit will prompt the user to increase the spending limit if sending the
 /// text would exceed that limit. Should only be true when this method is called from this form. </summary>
 public bool SendText(long patNum, string wirelessPhone, string message, YN txtMsgOk, long clinicNum, SmsMessageSource smsMessageSource, bool canIncreaseLimit = false)
 {
     if (Plugins.HookMethod(this, "FormTxtMsgEdit.SendText_Start", patNum, wirelessPhone, message, txtMsgOk))
     {
         return(false);
     }
     if (Plugins.HookMethod(this, "FormTxtMsgEdit.SendText_Start2", patNum, wirelessPhone, message, txtMsgOk))
     {
         return(true);
     }
     if (wirelessPhone == "")
     {
         MsgBox.Show(this, "Please enter a phone number.");
         return(false);
     }
     if (SmsPhones.IsIntegratedTextingEnabled())
     {
         if (!PrefC.HasClinicsEnabled && PrefC.GetDateT(PrefName.SmsContractDate).Year < 1880)                //Checking for practice (clinics turned off).
         {
             MsgBox.Show(this, "Integrated Texting has not been enabled.");
             return(false);
         }
         else if (PrefC.HasClinicsEnabled && !Clinics.IsTextingEnabled(clinicNum))                  //Checking for specific clinic.
         //This is likely to happen a few times per office until they setup texting properly.
         {
             if (clinicNum != 0)
             {
                 MessageBox.Show(Lans.g(this, "Integrated Texting has not been enabled for the following clinic") + ":\r\n" + Clinics.GetClinic(clinicNum).Description + ".");
             }
             else
             {
                 //Should never happen. This message is precautionary.
                 MsgBox.Show(this, "The default texting clinic has not been set.");
             }
             return(false);
         }
     }
     else if (!Programs.IsEnabled(ProgramName.CallFire))
     {
         MsgBox.Show(this, "CallFire Program Link must be enabled.");
         return(false);
     }
     if (patNum != 0 && txtMsgOk == YN.Unknown && PrefC.GetBool(PrefName.TextMsgOkStatusTreatAsNo))
     {
         MsgBox.Show(this, "It is not OK to text this patient.");
         return(false);
     }
     if (patNum != 0 && txtMsgOk == YN.No)
     {
         MsgBox.Show(this, "It is not OK to text this patient.");
         return(false);
     }
     if (SmsPhones.IsIntegratedTextingEnabled())
     {
         try {
             SmsToMobiles.SendSmsSingle(patNum, wirelessPhone, message, clinicNum, smsMessageSource, user: Security.CurUser);                //Can pass in 0 as PatNum if no patient selected.
             return(true);
         }
         catch (Exception ex) {
             //ProcessSendSmsException handles the spending limit has been reached error, or returns false if the exception is different.
             if (!canIncreaseLimit || !FormEServicesSetup.ProcessSendSmsException(ex))
             {
                 MsgBox.Show(this, ex.Message);
             }
             return(false);
         }
     }
     else
     {
         if (message.Length > 160)           //only a limitation for CallFire
         {
             MsgBox.Show(this, "Text length must be less than 160 characters.");
             return(false);
         }
         return(SendCallFire(patNum, wirelessPhone, message));               //Can pass in 0 as PatNum if no patient selected.
     }
 }
Esempio n. 13
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormEServicesSetup FormESS = new FormEServicesSetup(FormEServicesSetup.EService.SmsService);

            FormESS.ShowDialog();
        }
Esempio n. 14
0
		private void panelWebSched_MouseClick(object sender,MouseEventArgs e) {
			if(!PrefC.GetBool(PrefName.WebSchedService)) {
				//Office has yet to enable the Web Sched service.
				//Send them to a promotional web site so that they can learn about how great it is.
				try {
					Process.Start(Recalls.GetWebSchedPromoURL());
				}
				catch(Exception) {
					//The promotional web site can't be shown, most likely due to the computer not having a default browser.  Simply do nothing.
				}
				//Automatically open the eService Setup window so that they can easily click the Enable button if they call us to sign up or are already signed up and just need to enable it.
				FormEServicesSetup FormESS=new FormEServicesSetup(FormEServicesSetup.EService.WebSched);
				FormESS.ShowDialog();
				if(!PrefC.GetBool(PrefName.WebSchedService)) {
					//User might not have enabled the Web Sched.
					//No need to waste the time calling our web service if they didn't enable it.
					return;
				}
			}
			//Either the Web Sched service was enabled or they just enabled it.
			//Send off a web request to  WebServiceCustomersUpdates to verify that the office is still valid and is currently paying for the eService.  
			Cursor.Current=Cursors.WaitCursor;
			StringBuilder strbuild=new StringBuilder();
			#region Web Service Call
#if DEBUG
			OpenDental.localhost.Service1 updateService=new OpenDental.localhost.Service1();
#else
			OpenDental.customerUpdates.Service1 updateService=new OpenDental.customerUpdates.Service1();
			updateService.Url=PrefC.GetString(PrefName.UpdateServerAddress);
#endif
			if(PrefC.GetString(PrefName.UpdateWebProxyAddress) !="") {
				IWebProxy proxy = new WebProxy(PrefC.GetString(PrefName.UpdateWebProxyAddress));
				ICredentials cred=new NetworkCredential(PrefC.GetString(PrefName.UpdateWebProxyUserName),PrefC.GetString(PrefName.UpdateWebProxyPassword));
				proxy.Credentials=cred;
				updateService.Proxy=proxy;
			}
			XmlWriterSettings settings = new XmlWriterSettings();
			settings.Indent = true;
			settings.IndentChars = ("    ");
			using(XmlWriter writer=XmlWriter.Create(strbuild,settings)) {
				writer.WriteStartElement("RegistrationKey");
				writer.WriteString(PrefC.GetString(PrefName.RegistrationKey));
				writer.WriteEndElement();
			}
			#endregion
			string result="";
			try {
				result=updateService.ValidateWebSched(strbuild.ToString());
			}
			catch { 
				//Do nothing.  Leaving result empty will display correct error messages later on.
			}
			Cursor.Current=Cursors.Default;
			string error="";
			int errorCode=0;
			if(Recalls.IsWebSchedResponseValid(result,out error,out errorCode)) {
				//Everything went good, the office is active on support and has an active Web Sched repeating charge.
				//Send recall notifications to the selected patients.
				SendWebSchedNotifications();
				return;
			}
			#region Error Handling
			//At this point we know something went wrong.  So we need to give the user a hint as to why they can't enable
			if(errorCode==110) {//Customer not registered for Web Sched monthly service
				//We want to launch our Web Sched page if the user is not signed up:
				try {
					Process.Start(Recalls.GetWebSchedPromoURL());
				}
				catch(Exception) {
					//The promotional web site can't be shown, most likely due to the computer not having a default browser.  Simply do nothing.
				}
			}
			//For every error message returned, we'll show it to the user in a pop up.
			MessageBox.Show(error);
			#endregion
		}
Esempio n. 15
0
		private void menuItemSetup_Click(object sender,EventArgs e) {
			FormEServicesSetup formPPS=new FormEServicesSetup();
			formPPS.ShowDialog();
			if(formPPS.DialogResult==DialogResult.OK) {
				VerifyInputs();
			}
		}