Exemple #1
0
        ///<summary>only if ClientWeb</summary>
        public static void FillCache(DataSet ds, params InvalidType[] arrayITypes)
        {
            List <InvalidType> listITypes = arrayITypes.ToList();
            bool isAll = false;

            if (listITypes.Contains(InvalidType.AllLocal))
            {
                isAll = true;
            }
            //All Internal OD Tables that are cached go here
            if (PrefC.IsODHQ)
            {
                if (listITypes.Contains(InvalidType.JobPermission) || isAll)
                {
                    ds.Tables.Add(JobPermissions.RefreshCache());
                }
                if (listITypes.Contains(InvalidType.PhoneComps) || isAll)
                {
                    PhoneComps.FillCacheFromTable(ds.Tables["PhoneComp"]);
                }
            }
            if (listITypes.Contains(InvalidType.AccountingAutoPays) || isAll)
            {
                AccountingAutoPays.FillCacheFromTable(ds.Tables["AccountingAutoPay"]);
            }
            //if(listITypes.Contains(InvalidType.AlertItems) || isAll) {//THIS IS NOT CACHED. But is used to make server run the alert logic in OpenDentalService.
            //	AlertSubs.FillCache(ds.Tables["AlertItem"]);
            //}
            if (listITypes.Contains(InvalidType.AlertCategories) || isAll)
            {
                AlertCategories.FillCacheFromTable(ds.Tables["AlertCategory"]);
            }
            if (listITypes.Contains(InvalidType.AlertCategoryLinks) || isAll)
            {
                AlertCategoryLinks.FillCacheFromTable(ds.Tables["AlertCategoryLink"]);
            }
            if (listITypes.Contains(InvalidType.AppointmentTypes) || isAll)
            {
                AppointmentTypes.FillCacheFromTable(ds.Tables["AppointmentType"]);
            }
            if (listITypes.Contains(InvalidType.AutoCodes) || isAll)
            {
                AutoCodes.FillCacheFromTable(ds.Tables["AutoCode"]);
                AutoCodeItems.FillCacheFromTable(ds.Tables["AutoCodeItem"]);
                AutoCodeConds.FillCacheFromTable(ds.Tables["AutoCodeCond"]);
            }
            if (listITypes.Contains(InvalidType.Automation) || isAll)
            {
                Automations.FillCacheFromTable(ds.Tables["Automation"]);
            }
            if (listITypes.Contains(InvalidType.AutoNotes) || isAll)
            {
                AutoNotes.FillCacheFromTable(ds.Tables["AutoNote"]);
                AutoNoteControls.FillCacheFromTable(ds.Tables["AutoNoteControl"]);
            }
            if (listITypes.Contains(InvalidType.Carriers) || isAll)
            {
                Carriers.FillCacheFromTable(ds.Tables["Carrier"]);                //run on startup, after telephone reformat, after list edit.
            }
            if (listITypes.Contains(InvalidType.ClaimForms) || isAll)
            {
                ClaimFormItems.FillCacheFromTable(ds.Tables["ClaimFormItem"]);
                ClaimForms.FillCacheFromTable(ds.Tables["ClaimForm"]);
            }
            if (listITypes.Contains(InvalidType.ClearHouses) || isAll)
            {
                Clearinghouses.FillCacheFromTable(ds.Tables["Clearinghouse"]);
            }
            if (listITypes.Contains(InvalidType.ClinicErxs) || isAll)
            {
                ClinicErxs.FillCacheFromTable(ds.Tables["ClinicErx"]);
            }
            if (listITypes.Contains(InvalidType.ClinicPrefs) || isAll)
            {
                ClinicPrefs.FillCacheFromTable(ds.Tables["ClinicPref"]);
            }
            if (listITypes.Contains(InvalidType.Computers) || isAll)
            {
                Computers.FillCacheFromTable(ds.Tables["Computer"]);
                Printers.FillCacheFromTable(ds.Tables["Printer"]);
            }
            if (listITypes.Contains(InvalidType.Defs) || isAll)
            {
                Defs.FillCacheFromTable(ds.Tables["Def"]);
            }
            if (listITypes.Contains(InvalidType.DentalSchools) || isAll)
            {
                SchoolClasses.FillCacheFromTable(ds.Tables["SchoolClass"]);
                SchoolCourses.FillCacheFromTable(ds.Tables["SchoolCourse"]);
            }
            if (listITypes.Contains(InvalidType.DictCustoms) || isAll)
            {
                DictCustoms.FillCacheFromTable(ds.Tables["DictCustom"]);
            }
            if (listITypes.Contains(InvalidType.Diseases) || isAll)
            {
                DiseaseDefs.FillCacheFromTable(ds.Tables["DiseaseDef"]);
                ICD9s.FillCacheFromTable(ds.Tables["ICD9"]);
            }
            if (listITypes.Contains(InvalidType.DisplayFields) || isAll)
            {
                DisplayFields.FillCacheFromTable(ds.Tables["DisplayField"]);
            }
            if (listITypes.Contains(InvalidType.DisplayReports) || isAll)
            {
                DisplayReports.FillCacheFromTable(ds.Tables["DisplayReport"]);
            }
            if (listITypes.Contains(InvalidType.Ebills) || isAll)
            {
                Ebills.FillCacheFromTable(ds.Tables["Ebill"]);
            }
            if (listITypes.Contains(InvalidType.ElectIDs) || isAll)
            {
                ElectIDs.FillCacheFromTable(ds.Tables["ElectID"]);
            }
            if (listITypes.Contains(InvalidType.Email) || isAll)
            {
                EmailAddresses.FillCacheFromTable(ds.Tables["EmailAddress"]);
                EmailTemplates.FillCacheFromTable(ds.Tables["EmailTemplate"]);
            }
            if (listITypes.Contains(InvalidType.Employees) || isAll)
            {
                Employees.FillCacheFromTable(ds.Tables["Employee"]);
                PayPeriods.FillCacheFromTable(ds.Tables["PayPeriod"]);
            }
            if (listITypes.Contains(InvalidType.Employers) || isAll)
            {
                Employers.FillCacheFromTable(ds.Tables["Employer"]);
            }
            if (listITypes.Contains(InvalidType.Fees) || isAll)
            {
                Fees.FillCacheFromTable(ds.Tables["Fee"]);
            }
            if (listITypes.Contains(InvalidType.FeeScheds) || isAll)
            {
                FeeScheds.FillCacheFromTable(ds.Tables["FeeSched"]);
            }
            if (listITypes.Contains(InvalidType.HL7Defs) || isAll)
            {
                HL7Defs.FillCacheFromTable(ds.Tables["HL7Def"]);
                HL7DefMessages.FillCacheFromTable(ds.Tables["HL7DefMessage"]);
                HL7DefSegments.FillCacheFromTable(ds.Tables["HL7DefSegment"]);
                HL7DefFields.FillCacheFromTable(ds.Tables["HL7DefField"]);
            }
            if (listITypes.Contains(InvalidType.InsCats) || isAll)
            {
                CovCats.FillCacheFromTable(ds.Tables["CovCat"]);
                CovSpans.FillCacheFromTable(ds.Tables["CovSpan"]);
            }
            if (listITypes.Contains(InvalidType.InsFilingCodes) || isAll)
            {
                InsFilingCodes.FillCacheFromTable(ds.Tables["InsFilingCode"]);
                InsFilingCodeSubtypes.FillCacheFromTable(ds.Tables["InsFilingCodeSubtype"]);
            }
            if (listITypes.Contains(InvalidType.Languages) || isAll)
            {
                Lans.FillCacheFromTable(ds.Tables["Language"]);
            }
            if (listITypes.Contains(InvalidType.Letters) || isAll)
            {
                Letters.FillCacheFromTable(ds.Tables["Letter"]);
            }
            if (listITypes.Contains(InvalidType.LetterMerge) || isAll)
            {
                LetterMergeFields.FillCacheFromTable(ds.Tables["LetterMergeField"]);
                LetterMerges.FillCacheFromTable(ds.Tables["LetterMerge"]);
            }
            if (listITypes.Contains(InvalidType.Medications) || isAll)
            {
                Medications.FillCacheFromTable(ds.Tables["Medication"]);
            }
            if (listITypes.Contains(InvalidType.Operatories) || isAll)
            {
                Operatories.FillCacheFromTable(ds.Tables["Operatory"]);
            }
            if (listITypes.Contains(InvalidType.OrthoChartTabs) || isAll)
            {
                OrthoChartTabs.FillCacheFromTable(ds.Tables["OrthoChartTab"]);
                OrthoChartTabLinks.FillCacheFromTable(ds.Tables["OrthoChartTabLink"]);
            }
            if (listITypes.Contains(InvalidType.PatFields) || isAll)
            {
                PatFieldDefs.FillCacheFromTable(ds.Tables["PatFieldDef"]);
                ApptFieldDefs.FillCacheFromTable(ds.Tables["ApptFieldDef"]);
            }
            if (listITypes.Contains(InvalidType.Pharmacies) || isAll)
            {
                Pharmacies.FillCacheFromTable(ds.Tables["Pharmacy"]);
            }
            if (listITypes.Contains(InvalidType.Prefs) || isAll)
            {
                Prefs.FillCacheFromTable(ds.Tables["Pref"]);
            }
            if (listITypes.Contains(InvalidType.ProcButtons) || isAll)
            {
                ProcButtons.FillCacheFromTable(ds.Tables["ProcButton"]);
                ProcButtonItems.FillCacheFromTable(ds.Tables["ProcButtonItem"]);
            }
            if (listITypes.Contains(InvalidType.ProcCodes) || isAll)
            {
                ProcedureCodes.FillCacheFromTable(ds.Tables["ProcedureCode"]);
                ProcCodeNotes.FillCacheFromTable(ds.Tables["ProcCodeNote"]);
            }
            if (listITypes.Contains(InvalidType.Programs) || isAll)
            {
                Programs.FillCacheFromTable(ds.Tables["Program"]);
                ProgramProperties.FillCacheFromTable(ds.Tables["ProgramProperty"]);
            }
            if (listITypes.Contains(InvalidType.ProviderErxs) || isAll)
            {
                ProviderErxs.FillCacheFromTable(ds.Tables["ProviderErx"]);
            }
            if (listITypes.Contains(InvalidType.ProviderIdents) || isAll)
            {
                ProviderIdents.FillCacheFromTable(ds.Tables["ProviderIdent"]);
            }
            if (listITypes.Contains(InvalidType.Providers) || isAll)
            {
                Providers.FillCacheFromTable(ds.Tables["Provider"]);
                //Refresh the clinics as well because InvalidType.Providers has a comment that says "also includes clinics".  Also, there currently isn't an itype for Clinics.
                Clinics.FillCacheFromTable(ds.Tables["clinic"]);                //Case must match the table name in Clinics.RefrechCache().
            }
            if (listITypes.Contains(InvalidType.QuickPaste) || isAll)
            {
                QuickPasteNotes.FillCacheFromTable(ds.Tables["QuickPasteNote"]);
                QuickPasteCats.FillCacheFromTable(ds.Tables["QuickPasteCat"]);
            }
            if (listITypes.Contains(InvalidType.RecallTypes) || isAll)
            {
                RecallTypes.FillCacheFromTable(ds.Tables["RecallType"]);
                RecallTriggers.FillCacheFromTable(ds.Tables["RecallTrigger"]);
            }
            if (listITypes.Contains(InvalidType.ReplicationServers) || isAll)
            {
                ReplicationServers.FillCacheFromTable(ds.Tables["ReplicationServer"]);
            }
            //if(itypes.Contains(InvalidType.RequiredFields) || isAll) {
            //	RequiredFields.FillCache(ds.Tables["RequiredField"]);
            //}
            if (listITypes.Contains(InvalidType.Security) || isAll)
            {
                Userods.FillCacheFromTable(ds.Tables["Userod"]);
                UserGroups.FillCacheFromTable(ds.Tables["UserGroup"]);
                UserGroupAttaches.FillCacheFromTable(ds.Tables["UserGroupAttach"]);
            }
            if (listITypes.Contains(InvalidType.Sheets) || isAll)
            {
                SheetDefs.FillCacheFromTable(ds.Tables["SheetDef"]);
                SheetFieldDefs.FillCacheFromTable(ds.Tables["SheetFieldDef"]);
            }
            if (listITypes.Contains(InvalidType.SigMessages) || isAll)
            {
                SigElementDefs.FillCacheFromTable(ds.Tables["SigElementDef"]);
                SigButDefs.FillCacheFromTable(ds.Tables["SigButDef"]);
            }
            if (listITypes.Contains(InvalidType.Sites) || isAll)
            {
                Sites.FillCacheFromTable(ds.Tables["Site"]);
                if (PrefC.IsODHQ)
                {
                    SiteLinks.FillCacheFromTable(ds.Tables["SiteLink"]);
                }
            }
            if (listITypes.Contains(InvalidType.SmsBlockPhones) || isAll)
            {
                SmsBlockPhones.FillCacheFromTable(ds.Tables["SmsBlockPhone"]);
            }
            if (listITypes.Contains(InvalidType.SmsPhones) || isAll)
            {
                SmsPhones.FillCacheFromTable(ds.Tables["SmsPhone"]);
            }
            if (listITypes.Contains(InvalidType.Sops) || isAll)
            {
                Sops.FillCacheFromTable(ds.Tables["Sop"]);
            }
            if (listITypes.Contains(InvalidType.StateAbbrs) || isAll)
            {
                StateAbbrs.FillCacheFromTable(ds.Tables["StateAbbr"]);
            }
            if (listITypes.Contains(InvalidType.TimeCardRules) || isAll)
            {
                TimeCardRules.FillCacheFromTable(ds.Tables["TimeCardRule"]);
            }
            //InvalidTypes.Tasks not handled here.
            if (listITypes.Contains(InvalidType.ToolBut) || isAll)
            {
                ToolButItems.FillCacheFromTable(ds.Tables["ToolButItem"]);
            }
            if (listITypes.Contains(InvalidType.UserClinics) || isAll)
            {
                UserClinics.FillCacheFromTable(ds.Tables["UserClinic"]);
            }
            if (listITypes.Contains(InvalidType.UserQueries) || isAll)
            {
                UserQueries.FillCacheFromTable(ds.Tables["UserQuery"]);
            }
            if (listITypes.Contains(InvalidType.Vaccines) || isAll)
            {
                VaccineDefs.FillCacheFromTable(ds.Tables["VaccineDef"]);
                DrugManufacturers.FillCacheFromTable(ds.Tables["DrugManufacturer"]);
                DrugUnits.FillCacheFromTable(ds.Tables["DrugUnit"]);
            }
            if (listITypes.Contains(InvalidType.Views) || isAll)
            {
                ApptViews.FillCacheFromTable(ds.Tables["ApptView"]);
                ApptViewItems.FillCacheFromTable(ds.Tables["ApptViewItem"]);
                AppointmentRules.FillCacheFromTable(ds.Tables["AppointmentRule"]);
                ProcApptColors.FillCacheFromTable(ds.Tables["ProcApptColor"]);
            }
            if (listITypes.Contains(InvalidType.Wiki) || isAll)
            {
                WikiListHeaderWidths.FillCacheFromTable(ds.Tables["WikiListHeaderWidth"]);
                WikiPages.FillCache(ds.Tables["WikiPage"]);
            }
            if (listITypes.Contains(InvalidType.ZipCodes) || isAll)
            {
                ZipCodes.FillCacheFromTable(ds.Tables["ZipCode"]);
            }
        }