Beispiel #1
0
        private void LoadGroups()
        {
            insurance_company_group workingGroup = new insurance_company_group();

            DataTable allMatches = workingGroup.Search("SELECT * FROM insurance_company_groups ORDER BY id");

            dgvMain.Rows.Clear();
            foreach (DataRow aRow in allMatches.Rows)
            {
                workingGroup = new insurance_company_group();
                workingGroup.Load(aRow);

                dgvMain.Rows.Add(new object[] { workingGroup.name, workingGroup.description, workingGroup.GetFiltersAsString(), workingGroup });
            }
        }
        private void RefreshMatches()
        {
            try
            {
                DataTable matches =
                    _formGroup.Search(insurance_company_group.GenerateCompanySQL("name", GetFormFilters(), _showExcluded));

                lstMatches.Items.Clear();
                foreach (DataRow aRow in matches.Rows)
                {
                    lstMatches.Items.Add(aRow["name"].ToString());
                }
            }
            catch (Exception err)
            {
                LoggingHelper.Log("Error retrieving matches for criteria in frmEditInsuranceGroup.RefreshMatches", LogSeverity.Error, err, false);
                MessageBox.Show(this, "An unexpected error occurred retrieving the matches for this criteria. The error returned was:\n\n" + err.Message);
            }
        }
Beispiel #3
0
        private void LoadGroups(bool selectFirstGroup)
        {
            insurance_company_group icgs = new insurance_company_group();

            DataTable allGroups = icgs.Search(icgs.SearchSQL + " ORDER BY name");

            foreach (DataRow aRow in allGroups.Rows)
            {
                cmbInsuranceGroups.Items.Add(new insurance_company_group(aRow));
            }

            if (cmbInsuranceGroups.Items.Count > 0)
            {
                if (selectFirstGroup)
                {
                    cmbInsuranceGroups.SelectedIndex = 0;
                }
            }
        }