Пример #1
0
        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;
        }