Exemple #1
0
        private void FillGridWebSchedNewPatApptHostedURLs()
        {
            panelHostedURLs.Controls.Clear();
            List <Clinic> clinicsAll   = Clinics.GetDeepCopy();
            var           eServiceData = WebServiceMainHQProxy.GetSignups <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(_signupOut, eServiceCode.WebSchedNewPatAppt)
                                         .Select(x => new {
                Signup     = x,
                ClinicName = (clinicsAll.FirstOrDefault(y => y.ClinicNum == x.ClinicNum) ?? new Clinic()
                {
                    Abbr = "N\\A"
                }).Abbr
            })
                                         .Where(x =>
                                                //When clinics off, only show headquarters
                                                (!PrefC.HasClinicsEnabled && x.Signup.ClinicNum == 0) ||
                                                //When clinics are on, only show if not hidden.
                                                (PrefC.HasClinicsEnabled && clinicsAll.Any(y => y.ClinicNum == x.Signup.ClinicNum && !y.IsHidden))
                                                )
                                         //Alpha sorted
                                         .OrderBy(x => x.ClinicName);

            _listClinicPrefsWebSchedNewPats.Clear();
            foreach (var clinic in eServiceData)
            {
                ContrNewPatHostedURL contr = new ContrNewPatHostedURL(clinic.Signup);
                if (!PrefC.HasClinicsEnabled || eServiceData.Count() == 1)
                {
                    contr.IsExpanded         = true;
                    contr.DoHideExpandButton = true;
                }
                Lan.C(this, contr);
                panelHostedURLs.Controls.Add(contr);
                comboWSNPClinics.Items.Add(new ODBoxItem <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(clinic.ClinicName, clinic.Signup));
                if (clinic.Signup.ClinicNum == 0)
                {
                    continue;
                }
                else
                {
                    AddClinicPrefToList(PrefName.WebSchedNewPatAllowChildren, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatVerifyInfo, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthEmail, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthText, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatWebFormsURL, clinic.Signup.ClinicNum);
                }
            }
        }
Exemple #2
0
        private void SaveTabWebSchedNewPat()
        {
            Prefs.UpdateString(PrefName.WebSchedNewPatApptMessage, textWebSchedNewPatApptMessage.Text);
            List <ClinicPref> listClinicPrefs = new List <ClinicPref>();

            foreach (Control control in panelHostedURLs.Controls)
            {
                if (control.GetType() != typeof(ContrNewPatHostedURL))
                {
                    continue;
                }
                ContrNewPatHostedURL urlPanel = (ContrNewPatHostedURL)control;
                long   clinicNum     = urlPanel.GetClinicNum();
                string allowChildren = urlPanel.GetPrefValue(PrefName.WebSchedNewPatAllowChildren);
                string verifyInfo    = urlPanel.GetPrefValue(PrefName.WebSchedNewPatVerifyInfo);
                string doAuthEmail   = urlPanel.GetPrefValue(PrefName.WebSchedNewPatDoAuthEmail);
                string doAuthText    = urlPanel.GetPrefValue(PrefName.WebSchedNewPatDoAuthText);
                string webFormsURL   = urlPanel.GetPrefValue(PrefName.WebSchedNewPatWebFormsURL);
                if (clinicNum == 0)
                {
                    Prefs.UpdateString(PrefName.WebSchedNewPatAllowChildren, allowChildren);
                    Prefs.UpdateString(PrefName.WebSchedNewPatVerifyInfo, verifyInfo);
                    Prefs.UpdateString(PrefName.WebSchedNewPatDoAuthEmail, doAuthEmail);
                    Prefs.UpdateString(PrefName.WebSchedNewPatDoAuthText, doAuthText);
                    Prefs.UpdateString(PrefName.WebSchedNewPatWebFormsURL, webFormsURL);
                    continue;
                }
                listClinicPrefs.Add(GetClinicPrefToSave(clinicNum, PrefName.WebSchedNewPatAllowChildren, allowChildren));
                listClinicPrefs.Add(GetClinicPrefToSave(clinicNum, PrefName.WebSchedNewPatVerifyInfo, verifyInfo));
                listClinicPrefs.Add(GetClinicPrefToSave(clinicNum, PrefName.WebSchedNewPatDoAuthEmail, doAuthEmail));
                listClinicPrefs.Add(GetClinicPrefToSave(clinicNum, PrefName.WebSchedNewPatDoAuthText, doAuthText));
                listClinicPrefs.Add(GetClinicPrefToSave(clinicNum, PrefName.WebSchedNewPatWebFormsURL, webFormsURL));
            }
            if (ClinicPrefs.Sync(listClinicPrefs, _listClinicPrefsWebSchedNewPats))
            {
                DataValid.SetInvalid(InvalidType.ClinicPrefs);
            }
            if (comboWSNPConfirmStatuses.SelectedIndex != -1)
            {
                Prefs.UpdateLong(PrefName.WebSchedNewPatConfirmStatus, comboWSNPConfirmStatuses.GetSelectedDefNum());
            }
            Prefs.UpdateBool(PrefName.WebSchedNewPatAllowProvSelection, checkNewPatAllowProvSelection.Checked);
            Prefs.UpdateInt(PrefName.WebSchedNewPatApptDoubleBooking, checkWSNPDoubleBooking.Checked?1:0);
        }
        private void FillGridWebSchedNewPatApptHostedURLs()
        {
            List <Clinic> clinicsAll   = Clinics.GetDeepCopy();
            var           eServiceData = WebServiceMainHQProxy.GetSignups <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(_signupOut, eServiceCode.WebSchedNewPatAppt)
                                         .Select(x => new {
                Signup     = x,
                ClinicName = x.ClinicNum == 0 ? Lan.g(this, "Headquarters") : (clinicsAll.FirstOrDefault(y => y.ClinicNum == x.ClinicNum) ?? new Clinic()
                {
                    Abbr = "N\\A"
                }).Abbr
            })
                                         .Where(x =>
                                                //Always show HQ
                                                x.Signup.ClinicNum == 0 ||
                                                //If not HQ then only show if not hidden.
                                                clinicsAll.Any(y => y.ClinicNum == x.Signup.ClinicNum && !y.IsHidden)
                                                )
                                         //HQ to the top.
                                         .OrderBy(x => x.Signup.ClinicNum != 0)
                                         //Everything else is alpha sorted.
                                         .ThenBy(x => x.ClinicName);

            _listClinicPrefsWebSchedNewPats.Clear();
            foreach (var clinic in eServiceData)
            {
                ContrNewPatHostedURL contr = new ContrNewPatHostedURL(clinic.Signup);
                Lan.C(this, contr);
                panelHostedURLs.Controls.Add(contr);
                comboWSNPClinics.Items.Add(new ODBoxItem <WebServiceMainHQProxy.EServiceSetup.SignupOut.SignupOutEService>(clinic.ClinicName, clinic.Signup));
                if (clinic.Signup.ClinicNum == 0)
                {
                    continue;
                }
                else
                {
                    AddClinicPrefToList(PrefName.WebSchedNewPatAllowChildren, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatVerifyInfo, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthEmail, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatDoAuthText, clinic.Signup.ClinicNum);
                    AddClinicPrefToList(PrefName.WebSchedNewPatWebFormsURL, clinic.Signup.ClinicNum);
                }
            }
        }