private void button1_Click(object sender, EventArgs e)
        {
            string errorText = "";

            if (txtProvider.Text == "")
            {
                errorText = "Please enter a provider.";
            }
            if (cmbInsurance.Text == "" || cmbInsurance.FindStringExact(cmbInsurance.Text) < 0)
            {
                errorText += " Please enter a valid insurance.";
            }

            lblErrorText.Text = errorText;

            if (errorText == "")
            {
                provider_eligibility_test_rules petr = new provider_eligibility_test_rules();

                petr.provider        = txtProvider.Text;
                petr.insurance       = cmbInsurance.Items[cmbInsurance.FindStringExact(cmbInsurance.Text)].ToString();
                petr.date_of_service = dtpDOS.Value;

                petr.Save();

                txtProvider.Text  = "";
                cmbInsurance.Text = "";
                txtProvider.Focus();
            }
        }
Example #2
0
        private void RunTestsThreading()
        {
            // Get list of tests then iterate through, adding them one at a time
            provider_eligibility_test_rules petr = new provider_eligibility_test_rules();

            DataTable dt;

            petr.provider   = providerFilter;
            petr.SearchType = DataObject.SearchTypes.Contains;
            dt = petr.Search(petr.SearchSQL + " ORDER BY provider");

            foreach (DataRow aRow in dt.Rows)
            {
                petr.Load(aRow);

                string newProvider = provider_eligibility_restrictions.FindEligibilityRestrictions(petr.provider, petr.insurance, petr.date_of_service);

                Invoke((MethodInvoker) delegate { dgvResults.Rows.Add(new object[] { petr.provider, petr.insurance, petr.date_of_service.ToShortDateString(),
                                                                                     newProvider, newProvider == "" ? "" : "*", petr.id }); });
            }

            Invoke((MethodInvoker) delegate { btnRunTests.Enabled = true; btnRunTestAllInsurance.Enabled = true; });
        }