private void FormApptViews_FormClosing(object sender, FormClosingEventArgs e)
        {
            int newIncrement = 15;

            if (radioFive.Checked)
            {
                newIncrement = 5;
            }
            if (radioTen.Checked)
            {
                newIncrement = 10;
            }
            if (Prefs.UpdateInt(PrefName.AppointmentTimeIncrement, newIncrement))
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            if (viewChanged)
            {
                DataValid.SetInvalid(InvalidType.Views);
            }
        }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (textInsBenefitEligibilityDays.errorProvider1.GetError(textInsBenefitEligibilityDays) != "")
            {
                MsgBox.Show(this, "The number entered for insurance benefit eligibility was not a valid number.  Please enter a valid number to continue.");
                return;
            }
            if (textPatientEnrollmentDays.errorProvider1.GetError(textPatientEnrollmentDays) != "")
            {
                MsgBox.Show(this, "The number entered for patient enrollment was not a valid number.  Please enter a valid number to continue.");
                return;
            }
            if (textScheduledAppointmentDays.errorProvider1.GetError(textScheduledAppointmentDays) != "")
            {
                MsgBox.Show(this, "The number entered for scheduled appointments was not a valid number.  Please enter a valid number to continue.");
                return;
            }
            if (textPastDueDays.errorProvider1.GetError(textPastDueDays) != "")
            {
                MsgBox.Show(this, "The number entered for appointment days past due was not a valid number.  Please enter a valid number to continue.");
                return;
            }
            int insBenefitEligibilityDays = PIn.Int(textInsBenefitEligibilityDays.Text);
            int patientEnrollmentDays     = PIn.Int(textPatientEnrollmentDays.Text);
            int scheduledAppointmentDays  = PIn.Int(textScheduledAppointmentDays.Text);
            int pastDueDays = PIn.Int(textPastDueDays.Text);

            if (Prefs.UpdateInt(PrefName.InsVerifyBenefitEligibilityDays, insBenefitEligibilityDays)
                | Prefs.UpdateInt(PrefName.InsVerifyPatientEnrollmentDays, patientEnrollmentDays)
                | Prefs.UpdateInt(PrefName.InsVerifyAppointmentScheduledDays, scheduledAppointmentDays)
                | Prefs.UpdateInt(PrefName.InsVerifyDaysFromPastDueAppt, pastDueDays)
                | Prefs.UpdateBool(PrefName.InsVerifyExcludePatVerify, checkInsVerifyExcludePatVerify.Checked)
                | Prefs.UpdateBool(PrefName.InsVerifyExcludePatientClones, checkExcludePatientClones.Checked)
                | Prefs.UpdateBool(PrefName.InsVerifyFutureDateBenefitYear, checkFutureDateBenefitYear.Checked)
                | Prefs.UpdateBool(PrefName.InsVerifyDefaultToCurrentUser, checkInsVerifyUseCurrentUser.Checked))
            {
                _hasChanged = true;
            }
            DialogResult = DialogResult.OK;
        }
        private void butOK_Click(object sender, EventArgs e)
        {
            bool isPrefsInvalid         = false;
            int  unschedDaysPastValue   = -1;
            int  unschedDaysFutureValue = -1;

            if (!string.IsNullOrWhiteSpace(textDaysPast.Text))
            {
                unschedDaysPastValue = PIn.Int(textDaysPast.Text, false);
            }
            if (!string.IsNullOrWhiteSpace(textDaysFuture.Text))
            {
                unschedDaysFutureValue = PIn.Int(textDaysFuture.Text, false);
            }
            isPrefsInvalid = Prefs.UpdateInt(PrefName.UnschedDaysPast, unschedDaysPastValue)
                             | Prefs.UpdateInt(PrefName.UnschedDaysFuture, unschedDaysFutureValue);
            if (isPrefsInvalid)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            DialogResult = DialogResult.OK;
        }
Exemple #4
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (IsSelectionMode)
     {
         if (gridMain.GetSelectedIndex() == -1)
         {
             MsgBox.Show(this, "Please select an email address.");
             return;
         }
         EmailAddressNum = _listEmailAddresses[gridMain.GetSelectedIndex()].EmailAddressNum;
     }
     else              //The following fields are only visible when not in selection mode.
     {
         if (textInboxComputerName.Text.Trim().ToLower() == "localhost" || textInboxComputerName.Text.Trim() == "127.0.0.1")
         {
             //If we allowed localhost, then there would potentially be email duplication in the db when emails are pulled in.
             MsgBox.Show(this, "Computer name to fetch new email from cannot be localhost or 127.0.0.1 or any other loopback address.");
             return;
         }
         int inboxCheckIntervalMinuteCount = 0;
         try {
             inboxCheckIntervalMinuteCount = int.Parse(textInboxCheckInterval.Text);
             if (inboxCheckIntervalMinuteCount < 1 || inboxCheckIntervalMinuteCount > 60)
             {
                 throw new ApplicationException("Invalid value.");                        //User never sees this message.
             }
         }
         catch {
             MsgBox.Show(this, "Inbox check interval must be between 1 and 60 inclusive.");
             return;
         }
         if (Prefs.UpdateString(PrefName.EmailInboxComputerName, textInboxComputerName.Text)
             | Prefs.UpdateInt(PrefName.EmailInboxCheckInterval, inboxCheckIntervalMinuteCount))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     DialogResult = DialogResult.OK;
 }
        private void butClose_Click(object sender, System.EventArgs e)
        {
            if (textReportComputerName.Text.Trim().ToLower() == "localhost" || textReportComputerName.Text.Trim() == "127.0.0.1")
            {
                MsgBox.Show(this, "Computer name to fetch new reports from cannot be localhost or 127.0.0.1 or any other loopback address.");
                return;
            }
            int reportCheckIntervalMinuteCount = 0;

            try {
                reportCheckIntervalMinuteCount = PIn.Int(textReportCheckInterval.Text);
                if (textReportCheckInterval.Enabled && (reportCheckIntervalMinuteCount < 5 || reportCheckIntervalMinuteCount > 60))
                {
                    throw new ApplicationException("Invalid value.");                    //User never sees this message.
                }
            }
            catch {
                MsgBox.Show(this, "Report check interval must be between 5 and 60 inclusive.");
                return;
            }
            if (radioTime.Checked && (textReportCheckTime.Text == "" || !textReportCheckTime.IsEntryValid))
            {
                MsgBox.Show(this, "Please enter a time to receive reports.");
                return;
            }
            bool doRestartToShowChanges = false;
            bool doInvalidateCache      = false;

            if (Prefs.UpdateString(PrefName.ClaimReportComputerName, textReportComputerName.Text))
            {
                doRestartToShowChanges = true;
                //No point in invalidating prefs since this only affects a workstation on startup.
            }
            if (Prefs.UpdateInt(PrefName.ClaimReportReceiveInterval, reportCheckIntervalMinuteCount))
            {
                doInvalidateCache = true;
            }
            if (radioTime.Checked)
            {
                if (Prefs.UpdateDateT(PrefName.ClaimReportReceiveTime, PIn.DateT(textReportCheckTime.Text)))
                {
                    doInvalidateCache = true;
                }
            }
            else if (textReportCheckTime.Text == "" && Prefs.UpdateDateT(PrefName.ClaimReportReceiveTime, DateTime.MinValue))
            {
                doInvalidateCache = true;
            }
            if (Prefs.UpdateBool(PrefName.ClaimReportReceivedByService, checkReceiveReportsService.Checked))
            {
                if (checkReceiveReportsService.Checked)
                {
                    doInvalidateCache = true;
                }
                else
                {
                    doRestartToShowChanges = true;
                }
            }
            if (doRestartToShowChanges)
            {
                MsgBox.Show(this, "You will need to restart the program for changes to take effect.");
            }
            if (doInvalidateCache)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            Close();
        }
 private void butResetReplicationFailureAtServer_id_Click(object sender, EventArgs e)
 {
     Prefs.UpdateInt(PrefName.ReplicationFailureAtServer_id, 0);
 }
Exemple #7
0
 ///<summary>Returns false if validation failed.  This also makes sure the web service exists, the customer is paid, and the registration key is correct.</summary>
 private bool SavePrefs()
 {
     //validation
     if (textSynchMinutes.errorProvider1.GetError(textSynchMinutes) != "" ||
         textDateBefore.errorProvider1.GetError(textDateBefore) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return(false);
     }
     //yes, workstation is allowed to be blank.  That's one way for user to turn off auto synch.
     //if(textMobileSynchWorkStation.Text=="") {
     //	MsgBox.Show(this,"WorkStation cannot be empty");
     //	return false;
     //}
     // the text field is read because the keyed in values have not been saved yet
     if (textMobileSyncServerURL.Text.Contains("192.168.0.196") || textMobileSyncServerURL.Text.Contains("localhost"))
     {
         IgnoreCertificateErrors();                // done so that TestWebServiceExists() does not thow an error.
     }
     // if this is not done then an old non-functional url prevents any new url from being saved.
     Prefs.UpdateString(PrefName.MobileSyncServerURL, textMobileSyncServerURL.Text);
     if (!TestWebServiceExists())
     {
         MsgBox.Show(this, "Web service not found.");
         return(false);
     }
     if (mb.GetCustomerNum(PrefC.GetString(PrefName.RegistrationKey)) == 0)
     {
         MsgBox.Show(this, "Registration key is incorrect.");
         return(false);
     }
     if (!VerifyPaidCustomer())
     {
         return(false);
     }
     //Minimum 10 char.  Must contain uppercase, lowercase, numbers, and symbols. Valid symbols are: !@#$%^&+=
     //The set of symbols checked was far too small, not even including periods, commas, and parentheses.
     //So I rewrote it all.  New error messages say exactly what's wrong with it.
     if (textMobileUserName.Text != "")           //allowed to be blank
     {
         if (textMobileUserName.Text.Length < 10)
         {
             MsgBox.Show(this, "User Name must be at least 10 characters long.");
             return(false);
         }
         if (!Regex.IsMatch(textMobileUserName.Text, "[A-Z]+"))
         {
             MsgBox.Show(this, "User Name must contain an uppercase letter.");
             return(false);
         }
         if (!Regex.IsMatch(textMobileUserName.Text, "[a-z]+"))
         {
             MsgBox.Show(this, "User Name must contain an lowercase letter.");
             return(false);
         }
         if (!Regex.IsMatch(textMobileUserName.Text, "[0-9]+"))
         {
             MsgBox.Show(this, "User Name must contain a number.");
             return(false);
         }
         if (!Regex.IsMatch(textMobileUserName.Text, "[^0-9a-zA-Z]+"))                //absolutely anything except number, lower or upper.
         {
             MsgBox.Show(this, "User Name must contain punctuation or symbols.");
             return(false);
         }
     }
     if (textDateBefore.Text == "")          //default to one year if empty
     {
         textDateBefore.Text = DateTime.Today.AddYears(-1).ToShortDateString();
         //not going to bother informing user.  They can see it.
     }
     //save to db------------------------------------------------------------------------------------
     if (Prefs.UpdateString(PrefName.MobileSyncServerURL, textMobileSyncServerURL.Text)
         | Prefs.UpdateInt(PrefName.MobileSyncIntervalMinutes, PIn.Int(textSynchMinutes.Text))                        //blank entry allowed
         | Prefs.UpdateString(PrefName.MobileExcludeApptsBeforeDate, POut.Date(PIn.Date(textDateBefore.Text), false)) //blank
         | Prefs.UpdateString(PrefName.MobileSyncWorkstationName, textMobileSynchWorkStation.Text)
         | Prefs.UpdateString(PrefName.MobileUserName, textMobileUserName.Text)
         )
     {
         changed = true;
         Prefs.RefreshCache();
     }
     //Username and password-----------------------------------------------------------------------------
     mb.SetMobileWebUserPassword(PrefC.GetString(PrefName.RegistrationKey), textMobileUserName.Text.Trim(), textMobilePassword.Text.Trim());
     return(true);
 }
        private void UpdatePreferenceChanges()
        {
            bool hasChanges = false;

            if (Prefs.UpdateBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily, checkAgingMonthly.Checked)
                | Prefs.UpdateBool(PrefName.ApptSecondaryProviderConsiderOpOnly, checkUseOpHygProv.Checked)
                | Prefs.UpdateBool(PrefName.ApptsRequireProc, checkApptsRequireProcs.Checked)
                | Prefs.UpdateBool(PrefName.BillingShowSendProgress, checkBillingShowProgress.Checked)
                | Prefs.UpdateBool(PrefName.BillingShowTransSinceBalZero, checkBillShowTransSinceZero.Checked)
                | Prefs.UpdateBool(PrefName.ClaimReportReceivedByService, checkReceiveReportsService.Checked)
                | Prefs.UpdateBool(PrefName.CloneCreateSuperFamily, checkSuperFamCloneCreate.Checked)
                | Prefs.UpdateBool(PrefName.EnterpriseApptList, checkEnterpriseApptList.Checked)
                | Prefs.UpdateBool(PrefName.EnterpriseNoneApptViewDefaultDisabled, checkEnableNoneView.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsMustBeStrong, checkPasswordsMustBeStrong.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsStrongIncludeSpecial, checkPasswordsStrongIncludeSpecial.Checked)
                | Prefs.UpdateBool(PrefName.PasswordsWeakChangeToStrong, checkPasswordForceWeakToStrong.Checked)
                | Prefs.UpdateBool(PrefName.PaymentWindowDefaultHideSplits, checkHidePaysplits.Checked)
                | Prefs.UpdateBool(PrefName.PaymentsPromptForPayType, checkPaymentsPromptForPayType.Checked)
                | Prefs.UpdateBool(PrefName.SecurityLockIncludesAdmin, checkLockIncludesAdmin.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeaturePatientClone, checkPatClone.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeatureSuperfamilies, checkSuperFam.Checked)
                | Prefs.UpdateBool(PrefName.ShowFeeSchedGroups, checkShowFeeSchedGroups.Checked)
                | Prefs.UpdateBool(PrefName.UserNameManualEntry, checkUserNameManualEntry.Checked)
                | Prefs.UpdateInt(PrefName.BillingElectBatchMax, PIn.Int(textBillingElectBatchMax.Text))
                | Prefs.UpdateString(PrefName.ClaimIdPrefix, textClaimIdentifier.Text)
                | Prefs.UpdateInt(PrefName.ClaimReportReceiveInterval, PIn.Int(textReportCheckInterval.Text))
                | Prefs.UpdateDateT(PrefName.ClaimReportReceiveTime, PIn.DateT(textReportCheckTime.Text))
                | Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, PIn.Long(textSigInterval.Text))
                //SecurityLockDate and SecurityLockDays are handled in FormSecurityLock
                //| Prefs.UpdateString(PrefName.SecurityLockDate,POut.Date(PIn.Date(textDateLock.Text),false))
                //| Prefs.UpdateInt(PrefName.SecurityLockDays,PIn.Int(textDaysLock.Text))
                | Prefs.UpdateInt(PrefName.SecurityLogOffAfterMinutes, PIn.Int(textLogOffAfterMinutes.Text))
                | Prefs.UpdateLong(PrefName.SignalInactiveMinutes, PIn.Long(textInactiveSignal.Text))
                | Prefs.UpdateInt(PrefName.AutoSplitLogic, comboAutoSplitPref.SelectedIndex)
                | Prefs.UpdateInt(PrefName.PayPlansVersion, comboPayPlansVersion.SelectedIndex + 1)
                | Prefs.UpdateInt(PrefName.PaymentClinicSetting, comboPaymentClinicSetting.SelectedIndex)
                | Prefs.UpdateInt(PrefName.PatientSelectSearchMinChars, PIn.Int(textPatSelectMinChars.Text))
                | Prefs.UpdateInt(PrefName.PatientSelectSearchPauseMs, PIn.Int(textPatSelectPauseMs.Text))
                | Prefs.UpdateBool(PrefName.PatientSelectFilterRestrictedClinics, checkPatientSelectFilterRestrictedClinics.Checked)
                )
            {
                hasChanges = true;
            }
            if (checkPatSearchEmptyParams.CheckState != CheckState.Indeterminate)
            {
                hasChanges |= Prefs.UpdateInt(PrefName.PatientSelectSearchWithEmptyParams, (int)(checkPatSearchEmptyParams.Checked ? YN.Yes : YN.No));
            }
            if (checkUsePhoneNumTable.CheckState != CheckState.Indeterminate)
            {
                hasChanges |= Prefs.UpdateYN(PrefName.PatientPhoneUsePhonenumberTable, checkUsePhoneNumTable.Checked ? YN.Yes : YN.No);
            }
            int prefRigorousAccounting = PrefC.GetInt(PrefName.RigorousAccounting);

            //Copied logging for RigorousAccounting and RigorousAdjustments from FormModuleSetup.
            if (Prefs.UpdateInt(PrefName.RigorousAccounting, comboRigorousAccounting.SelectedIndex))
            {
                hasChanges = true;
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Rigorous accounting changed from " +
                                          ((RigorousAccounting)prefRigorousAccounting).GetDescription() + " to "
                                          + ((RigorousAccounting)comboRigorousAccounting.SelectedIndex).GetDescription() + ".");
            }
            int prefRigorousAdjustments = PrefC.GetInt(PrefName.RigorousAdjustments);

            if (Prefs.UpdateInt(PrefName.RigorousAdjustments, comboRigorousAdjustments.SelectedIndex))
            {
                hasChanges = true;
                SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Rigorous adjustments changed from " +
                                          ((RigorousAdjustments)prefRigorousAdjustments).GetDescription() + " to "
                                          + ((RigorousAdjustments)comboRigorousAdjustments.SelectedIndex).GetDescription() + ".");
            }
            hasChanges |= UpdateReportingServer();
            hasChanges |= UpdateClaimSnapshotRuntime();
            hasChanges |= UpdateClaimSnapshotTrigger();
            if (hasChanges)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
        }
 private void listBoxWebSchedProviderPref_SelectedIndexChanged(object sender, EventArgs e)
 {
     Prefs.UpdateInt(PrefName.WebSchedProviderRule, listBoxWebSchedProviderPref.SelectedIndex);
 }
Exemple #10
0
        //private void butTreatProv_Click(object sender, System.EventArgs e) {
        //	listBillProv.SelectedIndex=-1;
        //}

        private void butOK_Click(object sender, System.EventArgs e)
        {
            string phone = textPhone.Text;

            if (Application.CurrentCulture.Name == "en-US" ||
                CultureInfo.CurrentCulture.Name.Substring(3) == "CA")
            {
                phone = phone.Replace("(", "");
                phone = phone.Replace(")", "");
                phone = phone.Replace(" ", "");
                phone = phone.Replace("-", "");
                if (phone.Length != 0 && phone.Length != 10)
                {
                    MessageBox.Show(Lan.g(this, "Invalid phone"));
                    return;
                }
            }
            if (radioInsBillingProvSpecific.Checked && comboInsBillingProv.SelectedIndex == -1)
            {
                MsgBox.Show(this, "You must select a provider.");
                return;
            }
            bool changed = false;

            if (Prefs.UpdateString("PracticeTitle", textPracticeTitle.Text)
                | Prefs.UpdateString("PracticeAddress", textAddress.Text)
                | Prefs.UpdateString("PracticeAddress2", textAddress2.Text)
                | Prefs.UpdateString("PracticeCity", textCity.Text)
                | Prefs.UpdateString("PracticeST", textST.Text)
                | Prefs.UpdateString("PracticeZip", textZip.Text)
                | Prefs.UpdateString("PracticePhone", phone)
                | Prefs.UpdateString("PracticeBankNumber", textBankNumber.Text))
            {
                changed = true;
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("CH"))             //CH is for switzerland. eg de-CH
            {
                if (Prefs.UpdateString("BankRouting", textBankRouting.Text)
                    | Prefs.UpdateString("BankAddress", textBankAddress.Text))
                {
                    changed = true;
                }
            }
            if (listProvider.SelectedIndex == -1 &&      //practice really needs a default prov
                Providers.List.Length > 0)
            {
                listProvider.SelectedIndex = 0;
            }
            if (listProvider.SelectedIndex != -1)
            {
                if (Prefs.UpdateInt("PracticeDefaultProv", Providers.List[listProvider.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (listBillType.SelectedIndex != -1)
            {
                if (Prefs.UpdateInt("PracticeDefaultBillType"
                                    , DefB.Short[(int)DefCat.BillingTypes][listBillType.SelectedIndex].DefNum))
                {
                    changed = true;
                }
            }
            if (Prefs.UpdateInt("DefaultProcedurePlaceService", listPlaceService.SelectedIndex))
            {
                changed = true;
            }
            if (radioInsBillingProvDefault.Checked)            //default=0
            {
                if (Prefs.UpdateInt("InsBillingProv", 0))
                {
                    changed = true;
                }
            }
            else if (radioInsBillingProvTreat.Checked)            //treat=-1
            {
                if (Prefs.UpdateInt("InsBillingProv", -1))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateInt("InsBillingProv", Providers.List[comboInsBillingProv.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidTypes.Prefs);
            }
            DialogResult = DialogResult.OK;
        }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textRight.errorProvider1.GetError(textRight) != "" ||
                textDown.errorProvider1.GetError(textDown) != "" ||
                textDaysPast.errorProvider1.GetError(textDaysPast) != "" ||
                textDaysFuture.errorProvider1.GetError(textDaysFuture) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (textPostcardsPerSheet.Text != "1" &&
                textPostcardsPerSheet.Text != "3" &&
                textPostcardsPerSheet.Text != "4")
            {
                MsgBox.Show(this, "The value in postcards per sheet must be 1, 3, or 4");
                return;
            }
            if (textFMXPanoYrInterval.Text != "1" &&
                textFMXPanoYrInterval.Text != "2" &&
                textFMXPanoYrInterval.Text != "3" &&
                textFMXPanoYrInterval.Text != "4" &&
                textFMXPanoYrInterval.Text != "5" &&
                textFMXPanoYrInterval.Text != "6" &&
                textFMXPanoYrInterval.Text != "7" &&
                textFMXPanoYrInterval.Text != "")
            {
                textFMXPanoYrInterval.Text = "";
                MsgBox.Show(this, "The value for FMX/Pano interval must be a single number between 1 and 7 years, or you may leave it blank to disable this and only use BW's.");
                return;
            }


            Prefs.UpdateInt("RecallFMXPanoYrInterval", PIn.PInt(textFMXPanoYrInterval.Text));
            Prefs.UpdateString("RecallFMXPanoProc", textFMXPanoProc.Text);
            Prefs.UpdateBool("RecallDisableAutoFilms", checkDisableAutoFilms.Checked);

            Prefs.UpdateString("RecallPerioTriggerProcs", textPerioTriggerProcs.Text);

            Prefs.UpdateString("RecallProceduresPerio", textProcsPerio.Text);
            Prefs.UpdateString("RecallPatternPerio", textPatternPerio.Text);
            Prefs.UpdateBool("RecallDisablePerioAlt", checkDisablePerioAlt.Checked);

            Prefs.UpdateString("RecallProceduresChild", textProcsChild.Text);
            Prefs.UpdateString("RecallPatternChild", textPatternChild.Text);

            Prefs.UpdateString("RecallPattern", textPatternAdult.Text);

            Prefs.UpdateString("RecallProcedures", textProcsAdult.Text);

            Prefs.UpdateString("RecallBW", textBW.Text);

            Prefs.UpdateString("RecallPostcardMessage", textPostcardMessage.Text);

            Prefs.UpdateString("RecallPostcardFamMsg", textPostcardFamMsg.Text);

            Prefs.UpdateString("ConfirmPostcardMessage", textConfirmPostcardMessage.Text);

            Prefs.UpdateString("RecallPostcardsPerSheet", textPostcardsPerSheet.Text);

            Prefs.UpdateBool("RecallCardsShowReturnAdd", checkReturnAdd.Checked);

            Prefs.UpdateBool("RecallGroupByFamily", checkGroupFamilies.Checked);

            Prefs.UpdateInt("RecallDaysPast", PIn.PInt(textDaysPast.Text));
            Prefs.UpdateInt("RecallDaysFuture", PIn.PInt(textDaysFuture.Text));

            Prefs.UpdateDouble("RecallAdjustRight", PIn.PDouble(textRight.Text));
            Prefs.UpdateDouble("RecallAdjustDown", PIn.PDouble(textDown.Text));

            DataValid.SetInvalid(InvalidTypes.Prefs);
            DialogResult = DialogResult.OK;
        }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescription.Text == "")
            {
                MsgBox.Show(this, "Description cannot be blank.");
                return;
            }
            for (int i = 0; i < textPattern.Text.Length; i++)
            {
                if (textPattern.Text[i] != '/' && textPattern.Text[i] != 'X')
                {
                    MsgBox.Show(this, "Time Pattern may only contain '/' and 'X'.  Please fix to continue.");
                    return;
                }
            }
            if (textYears.errorProvider1.GetError(textYears) != "" ||
                textMonths.errorProvider1.GetError(textMonths) != "" ||
                textWeeks.errorProvider1.GetError(textWeeks) != "" ||
                textDays.errorProvider1.GetError(textDays) != ""
                )
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            //if(RecallTypes.List comboSpecial.SelectedIndex

            /*
             * if(listTriggers.Items.Count==0 && comboSpecial.SelectedIndex!=2) {//except child prophy
             *      if(!MsgBox.Show(this,true,"Warning! clearing all triggers for a recall type will cause all patient recalls of that type to be deleted, even those with notes.  Continue anyway?")){
             *              return;
             *      }
             * }*/
            bool changed = false;

            if (comboSpecial.SelectedIndex == 2)          //childProphy
            {
                if (textRecallAgeAdult.errorProvider1.GetError(textRecallAgeAdult) != "")
                {
                    MsgBox.Show(this, "Please fix data entry errors first.");
                    return;
                }
                if (Prefs.UpdateInt(PrefName.RecallAgeAdult, PIn.Int(textRecallAgeAdult.Text)))
                {
                    changed = true;
                }
                TriggerList.Clear(); //triggers for child prophy special type are handled by the prophy special type
            }
            else                     //for child prophy, interval will default to 0, since this special type uses the Prophy default interval
            {
                Interval interval = new Interval(
                    PIn.Int(textDays.Text),
                    PIn.Int(textWeeks.Text),
                    PIn.Int(textMonths.Text),
                    PIn.Int(textYears.Text));
                RecallTypeCur.DefaultInterval = interval;
            }
            RecallTypeCur.Description     = textDescription.Text;
            RecallTypeCur.TimePattern     = textPattern.Text;
            RecallTypeCur.AppendToSpecial = checkAppendToSpecial.Checked;
            if (listProcs.Items.Count == 0)
            {
                RecallTypeCur.Procedures = "";
            }
            //otherwise, already taken care of.
            try{
                if (RecallTypeCur.IsNew)
                {
                    RecallTypes.Insert(RecallTypeCur);
                    SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall type added '" + RecallTypeCur.Description + "'");
                }
                else
                {
                    SecurityLogs.MakeLogEntry(Permissions.RecallEdit, 0, "Recall type having description '" + RecallTypeCur.Description + "' edited");
                    RecallTypes.Update(RecallTypeCur);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            RecallTriggers.SetForType(RecallTypeCur.RecallTypeNum, TriggerList);
            //The combo for special type is allowed to be changed by user.  But since the field is in the pref table instead of in the RecallType table, there's extra work involved in saving the selection.
            if (comboSpecial.SelectedIndex == 0)                                                    //none:  If this recall type is now not any special type
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum) //and it used to be the special prophy type
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 1)                                                //Prophy: If this recall type is now the prophy type.
            {
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, RecallTypeCur.RecallTypeNum)) //and it was already the prophy type
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)              //but it used to be the childprophy type.
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 2)          //ChildProphy
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialPerio) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, 0);
                    changed = true;
                }
            }
            else if (comboSpecial.SelectedIndex == 3)          //Perio
            {
                if (PrefC.GetLong(PrefName.RecallTypeSpecialProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialProphy, 0);
                    changed = true;
                }
                if (PrefC.GetLong(PrefName.RecallTypeSpecialChildProphy) == RecallTypeCur.RecallTypeNum)
                {
                    Prefs.UpdateLong(PrefName.RecallTypeSpecialChildProphy, 0);
                    changed = true;
                }
                if (Prefs.UpdateLong(PrefName.RecallTypeSpecialPerio, RecallTypeCur.RecallTypeNum))
                {
                    changed = true;
                }
            }
            DataValid.SetInvalid(InvalidType.RecallTypes);
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            //Ask user to update recalls for patients if they changed the DefaultInterval.
            if (!RecallTypeCur.IsNew && defaultIntervalOld != RecallTypeCur.DefaultInterval)
            {
                if (MsgBox.Show(this, MsgBoxButtons.YesNo, "Default interval has been changed.  Reset all current patient intervals of this type?"))
                {
                    Recalls.UpdateDefaultIntervalForPatients(RecallTypeCur.RecallTypeNum, defaultIntervalOld, RecallTypeCur.DefaultInterval);
                }
            }
            DialogResult = DialogResult.OK;
        }
Exemple #13
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textStatementsCalcDueDate.errorProvider1.GetError(textStatementsCalcDueDate) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            bool changed = false;

            if (Prefs.UpdateString("TreatmentPlanNote", textTreatNote.Text)
                | Prefs.UpdateBool("TreatPlanShowGraphics", checkTreatPlanShowGraphics.Checked)
                | Prefs.UpdateBool("TreatPlanShowCompleted", checkTreatPlanShowCompleted.Checked)
                | Prefs.UpdateBool("TreatPlanShowIns", checkTreatPlanShowIns.Checked)
                | Prefs.UpdateBool("StatementShowReturnAddress", checkStatementShowReturnAddress.Checked)
                | Prefs.UpdateBool("StatementShowCreditCard", checkShowCC.Checked)
                | Prefs.UpdateBool("StatementAccountsUseChartNumber", radioUseChartNumber.Checked)
                | Prefs.UpdateBool("BalancesDontSubtractIns", checkBalancesDontSubtractIns.Checked)
                | Prefs.UpdateBool("RandomPrimaryKeys", checkRandomPrimaryKeys.Checked)
                | Prefs.UpdateString("MainWindowTitle", textMainWindowTitle.Text)
                | Prefs.UpdateBool("EclaimsSeparateTreatProv", checkEclaimsSeparateTreatProv.Checked)
                | Prefs.UpdateBool("MedicalEclaimsEnabled", checkMedicalEclaimsEnabled.Checked)
                | Prefs.UpdateBool("UseInternationalToothNumbers", checkITooth.Checked)
                | Prefs.UpdateBool("InsurancePlansShared", checkInsurancePlansShared.Checked))
            {
                changed = true;
            }
            if (textStatementsCalcDueDate.Text == "")
            {
                if (Prefs.UpdateInt("StatementsCalcDueDate", -1))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateInt("StatementsCalcDueDate", PIn.PInt(textStatementsCalcDueDate.Text)))
                {
                    changed = true;
                }
            }
            if (textSigInterval.Text == "")
            {
                if (Prefs.UpdateInt("ProcessSigsIntervalInSecs", 0))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateInt("ProcessSigsIntervalInSecs", PIn.PInt(textSigInterval.Text)))
                {
                    changed = true;
                }
            }
            //ShowIDinTitleBar
            if (radioShowIDnone.Checked)
            {
                if (Prefs.UpdateInt("ShowIDinTitleBar", 0))
                {
                    changed = true;
                }
            }
            else if (radioShowIDpatNum.Checked)
            {
                if (Prefs.UpdateInt("ShowIDinTitleBar", 1))
                {
                    changed = true;
                }
            }
            else if (radioShowIDchartNum.Checked)
            {
                if (Prefs.UpdateInt("ShowIDinTitleBar", 2))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidTypes.Prefs);
            }
            DialogResult = DialogResult.OK;
        }
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (listSoftware.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Must select an accounting software.");
         return;
     }
     if (listSoftware.SelectedIndex == 0)           //Open Dental
     {
         string depStr = "";
         for (int i = 0; i < depAL.Count; i++)
         {
             if (i > 0)
             {
                 depStr += ",";
             }
             depStr += depAL[i].ToString();
         }
         if (Prefs.UpdateString(PrefName.AccountingDepositAccounts, depStr))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
         if (Prefs.UpdateLong(PrefName.AccountingIncomeAccount, PickedDepAccountNum))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
         //pay------------------------------------------------------------------------------------------
         AccountingAutoPays.SaveList(payList);                //just deletes them all and starts over
         DataValid.SetInvalid(InvalidType.AccountingAutoPays);
         if (Prefs.UpdateLong(PrefName.AccountingCashIncomeAccount, PickedPayAccountNum))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     else              //QuickBooks
     {
         string depStr = "";
         for (int i = 0; i < listBoxDepositAccountsQB.Items.Count; i++)
         {
             if (i > 0)
             {
                 depStr += ",";
             }
             depStr += listBoxDepositAccountsQB.Items[i].ToString();
         }
         string incomeStr = "";
         for (int i = 0; i < listBoxIncomeAccountsQB.Items.Count; i++)
         {
             if (i > 0)
             {
                 incomeStr += ",";
             }
             incomeStr += listBoxIncomeAccountsQB.Items[i].ToString();
         }
         if (Prefs.UpdateString(PrefName.QuickBooksCompanyFile, textCompanyFileQB.Text)
             | Prefs.UpdateString(PrefName.QuickBooksDepositAccounts, depStr)
             | Prefs.UpdateString(PrefName.QuickBooksIncomeAccount, incomeStr))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     //Update the selected accounting software.
     if (Prefs.UpdateInt(PrefName.AccountingSoftware, listSoftware.SelectedIndex))
     {
         DataValid.SetInvalid(InvalidType.Prefs);
     }
     DialogResult = DialogResult.OK;
 }
Exemple #15
0
        private void butDownloadClaimform_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            //Application.DoEvents();
            string      remoteUri = textWebsitePath.Text + textRegClaimform.Text + "/";
            WebRequest  wr;
            WebResponse webResp;

            //int fileSize;
            //copy image file-------------------------------------------------------------------------------
            if (BackgroundImg != "")
            {
                myStringWebResource = remoteUri + BackgroundImg;
                WriteToFile         = PrefB.GetString("DocPath") + BackgroundImg;
                if (File.Exists(WriteToFile))
                {
                    File.Delete(WriteToFile);
                }
                wr = WebRequest.Create(myStringWebResource);
                int fileSize;
                try{
                    webResp  = wr.GetResponse();
                    fileSize = (int)webResp.ContentLength / 1024;
                }
                catch (Exception ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show("Error downloading " + BackgroundImg + ". " + ex.Message);
                    return;
                    //fileSize=0;
                }
                if (fileSize > 0)
                {
                    //start the thread that will perform the download
                    Thread workerThread = new Thread(new ThreadStart(InstanceMethod));
                    workerThread.Start();
                    //display the progress dialog to the user:
                    FormP        = new FormProgress();
                    FormP.MaxVal = (double)fileSize / 1024;
                    FormP.NumberMultiplication = 100;
                    FormP.DisplayText          = "?currentVal MB of ?maxVal MB copied";
                    FormP.NumberFormat         = "F";
                    FormP.ShowDialog();
                    if (FormP.DialogResult == DialogResult.Cancel)
                    {
                        workerThread.Abort();
                        Cursor = Cursors.Default;
                        return;
                    }
                    MsgBox.Show(this, "Image file downloaded successfully.");
                }
            }
            Cursor = Cursors.WaitCursor;          //have to do this again for some reason.
            //Import ClaimForm.xml----------------------------------------------------------------------------------
            myStringWebResource = remoteUri + "ClaimForm.xml";
            WriteToFile         = PrefB.GetString("DocPath") + "ClaimForm.xml";
            if (File.Exists(WriteToFile))
            {
                File.Delete(WriteToFile);
            }
            try{
                InstanceMethod();
            }
            catch {
            }
            int rowsAffected;

            if (File.Exists(WriteToFile))
            {
                int newclaimformnum = 0;
                try{
                    newclaimformnum = FormClaimForms.ImportForm(WriteToFile, true);
                }
                catch (ApplicationException ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
                finally{
                    File.Delete(WriteToFile);
                }
                if (newclaimformnum != 0)
                {
                    Prefs.UpdateInt("DefaultClaimForm", newclaimformnum);
                }
                //switch all insplans over to new claimform
                ClaimForm oldform = null;
                for (int i = 0; i < ClaimForms.ListLong.Length; i++)
                {
                    if (ClaimForms.ListLong[i].UniqueID == OldClaimFormID)
                    {
                        oldform = ClaimForms.ListLong[i];
                    }
                }
                if (oldform != null)
                {
                    rowsAffected = InsPlans.ConvertToNewClaimform(oldform.ClaimFormNum, newclaimformnum);
                    MessageBox.Show("Number of insurance plans changed to new form: " + rowsAffected.ToString());
                }
                DataValid.SetInvalid(InvalidTypes.ClaimForms | InvalidTypes.Prefs);
            }
            //Import ProcCodes.xml------------------------------------------------------------------------------------
            myStringWebResource = remoteUri + "ProcCodes.xml";
            WriteToFile         = PrefB.GetString("DocPath") + "ProcCodes.xml";
            if (File.Exists(WriteToFile))
            {
                File.Delete(WriteToFile);
            }
            try {
                InstanceMethod();
            }
            catch {
            }
            if (File.Exists(WriteToFile))
            {
                //move T codes over to a new "Obsolete" category which is hidden
                ProcedureCodes.TcodesMove();
                rowsAffected = 0;
                try {
                    rowsAffected = FormProcCodes.ImportProcCodes(WriteToFile, false);
                }
                catch (ApplicationException ex) {
                    Cursor = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    return;
                }
                finally {
                    File.Delete(WriteToFile);
                }
                ProcedureCodes.Refresh();                //?
                MessageBox.Show("Procedure codes inserted: " + rowsAffected.ToString());
                //Change all procbuttons and autocodes from T to D.
                ProcedureCodes.TcodesAlter();
                DataValid.SetInvalid(InvalidTypes.AutoCodes | InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.ProcButtons);
            }
            MsgBox.Show(this, "Done");
            Cursor = Cursors.Default;
        }