public Hashtable CheckNumbers(ArrayList numbers) { Hashtable networkCount = new Hashtable(); try { dp = new Databasefile(); Hashtable networkRates = dp.GetNetworkRates(); Hashtable networkCodes = dp.GetNetworkCodes(); ArrayList networks = new ArrayList(networkRates.Keys); foreach (string network in networks) { networkCount.Add(network, 0); } foreach (string number in numbers) { string code = number.Substring(0, 3); string network = networkCodes[code].ToString(); int count = int.Parse(networkCount[network].ToString()); int intCount = count + 1; networkCount[network] = intCount; } } catch (Exception ex) { throw ex; } return(networkCount); }
private bool NetworkCodeOk(string okNumber) { bool ok = false; string code = okNumber.Substring(0, 3); dp = new Databasefile(); Hashtable networkCodes; networkCodes = dp.GetNetworkCodes(); ArrayList codes = new ArrayList(networkCodes.Keys); if (codes.Contains(code)) { ok = true; } else { ok = false; } return(ok); }