Ejemplo n.º 1
0
        private void butClose_Click(object sender, EventArgs e)
        {
            if (!textSubInterval.IsValid)
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (comboPayType.SelectedIndex < 0)
            {
                MsgBox.Show(this, "Please select a payment type.");
                return;
            }
            Program prog = Programs.GetCur(ProgramName.FHIR);

            prog.Enabled = checkEnabled.Checked;
            Programs.Update(prog);
            ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum));

            ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text);
            DataValid.SetInvalid(InvalidType.Programs);
            if (Prefs.UpdateLong(PrefName.ApiPaymentType, comboPayType.GetSelectedDefNum()))
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            Close();
        }
Ejemplo n.º 2
0
        private void butClose_Click(object sender, EventArgs e)
        {
            if (textSubInterval.errorProvider1.GetError(textSubInterval) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            bool changed = false;

            foreach (APIKey apiKeyHQ in _listApiKeysHQ)
            {
                APIKey apiKeyLocal = _listApiKeysLocal.FirstOrDefault(x => x.Key == apiKeyHQ.Key);
                if (apiKeyLocal == null ||           //A new key was generated but then Cancel was clicked on FormFHIRAPIKeyEdit.
                    apiKeyLocal.DeveloperName != apiKeyHQ.DeveloperName ||
                    apiKeyLocal.DeveloperEmail != apiKeyHQ.DeveloperEmail ||
                    apiKeyLocal.DeveloperPhone != apiKeyHQ.DeveloperPhone ||
                    apiKeyLocal.ListPermissions.Any(x => !apiKeyHQ.ListPermissions.Contains(x)) ||
                    apiKeyHQ.ListPermissions.Any(x => !apiKeyLocal.ListPermissions.Contains(x)))
                {
                    changed = true;
                    break;
                }
            }
            if (changed && !UpdateKeysForOffice(_listApiKeysLocal))
            {
                return;
            }
            Program prog = Programs.GetCur(ProgramName.FHIR);

            prog.Enabled = checkEnabled.Checked;
            Programs.Update(prog);
            ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum));

            ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text);
            DataValid.SetInvalid(InvalidType.Programs);
            Close();
        }