private company FindCompany(string CompanyName) { try { company toReturn = new company(); string trimmedCompanyName = CommonFunctions.TrimSpaces(CompanyName); toReturn.name = trimmedCompanyName; toReturn.SearchType = DataObject.SearchTypes.Exact; DataTable results = toReturn.Search("SELECT * FROM companies WHERE name = '" + trimmedCompanyName + "'"); if (results.Rows.Count > 0) { toReturn.Load(results.Rows[0]); } toReturn.created_on = DateTime.Now; toReturn.name = trimmedCompanyName; toReturn.Save(); return(toReturn); } catch (Exception err) { // Somewhat dangerous, but it ensures that the import won't crash LoggingHelper.Log("Error in frmImportData.FindCompany", LogSeverity.Critical, err, true); return(null); } }
internal List <company> GetMatchingCompanies() { List <company> toReturn = new List <company>(); string finalSQL = insurance_company_group.GenerateCompanySQL("*", FiltersTextOnly); company workingComp = new company(); foreach (DataRow aRow in workingComp.Search(finalSQL).Rows) { workingComp = new company(aRow); toReturn.Add(workingComp); } return(toReturn); }
internal List <company> GetMatchingCompanies() { List <company> toReturn = new List <company>(); string finalSQL = provider_eligibility_restrictions.GenerateCompanySQL("*", GetFiltersTextOnly); company workingComp = new company(); foreach (DataRow aRow in workingComp.Search(finalSQL).Rows) { workingComp = new company(aRow); toReturn.Add(workingComp); } return(toReturn); }
private void InitializeCompanyNames() { company cmps = new company(); DataTable dt = cmps.Search(cmps.SearchSQL + " ORDER BY name"); foreach (DataRow aCompany in dt.Rows) { cmps = new company(); cmps.Load(aCompany); DataTable matches = cmps.Search("SELECT Count(*) FROM claims WHERE company_id = " + cmps.id); ComboItemForCompany cifc = new ComboItemForCompany(cmps, System.Convert.ToInt32(matches.Rows[0][0])); cmbCompanyDropdown.Items.Add(cifc); } }
/// <summary> /// Adds all the companies to the Company List /// </summary> private void InitializeCompanies(int defaultCompanyID) { company cmp = new company(); DataTable allCompanies = cmp.Search(cmp.SearchSQL + " ORDER BY name"); foreach (DataRow aRow in allCompanies.Rows) { cmp = new company(); cmp.Load(aRow); cmbInsuranceCarrier.Items.Add(cmp); if (cmp.id == defaultCompanyID) { cmbInsuranceCarrier.SelectedItem = cmp; } } }
private void InitializeInsuranceDropdown() { clbInsuranceCompanies.Items.Add("All"); company c = new company(); foreach (DataRow aRow in c.GetAllData("name").Rows) { c = new company(); c.Load(aRow); clbInsuranceCompanies.Items.Add(c); } DataTable matches = c.Search("SELECT * FROM question_insurance_companies WHERE question_id = " + _formQuestion.id); if (matches.Rows.Count > 0) { foreach (DataRow aMatch in matches.Rows) { for (int i = 1; i < clbInsuranceCompanies.Items.Count; i++) { if (((company)clbInsuranceCompanies.Items[i]).id == (int)aMatch["insurance_id"]) { clbInsuranceCompanies.SetItemChecked(i, true); break; } } } } else { clbInsuranceCompanies.SetItemChecked(0, true); } }