private static bool Load(Dictionary <string, int> ally) { using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaAllyInfo[] infos = db.GetConsortiaAllyAll(); ConsortiaAllyInfo[] array = infos; for (int i = 0; i < array.Length; i++) { ConsortiaAllyInfo info = array[i]; if (info.IsExist) { string key; if (info.Consortia1ID < info.Consortia2ID) { key = info.Consortia1ID + "&" + info.Consortia2ID; } else { key = info.Consortia2ID + "&" + info.Consortia1ID; } if (!ally.ContainsKey(key)) { ally.Add(key, info.State); } } } } return(true); }
private static bool Load(Dictionary <string, int> ally) { using (ConsortiaBussiness db = new ConsortiaBussiness()) { string key; ConsortiaAllyInfo[] infos = db.GetConsortiaAllyAll(); foreach (ConsortiaAllyInfo info in infos) { if (!info.IsExist) { continue; } if (info.Consortia1ID < info.Consortia2ID) { key = info.Consortia1ID + "&" + info.Consortia2ID; } else { key = info.Consortia2ID + "&" + info.Consortia1ID; } if (!ally.ContainsKey(key)) { ally.Add(key, info.State); } } } return(true); }