Exemplo n.º 1
0
        private static bool LoadFusion(Dictionary<string, FusionInfo> fusion)
        {
            using (ProduceBussiness db = new ProduceBussiness())
            {
                FusionInfo[] infos = db.GetAllFusion();
                foreach (FusionInfo info in infos)
                {
                    List<int> list = new List<int>();
                    list.Add(info.Item1);
                    list.Add(info.Item2);
                    list.Add(info.Item3);
                    list.Add(info.Item4);
                    list.Add(info.Formula);
                    list.Sort();

                    StringBuilder items = new StringBuilder();
                    foreach (int i in list)
                    {
                        if (i == 0)
                            continue;
                        items.Append(i);
                    }

                    string key = items.ToString();

                    if (!fusion.ContainsKey(key))
                    {
                        fusion.Add(key, info);
                    }
                }
            }

            return true;
        }