public static string Bulid(HttpContext context)
        {
            bool     value   = false;
            string   message = "Fail!";
            XElement result  = new XElement("Result");

            try
            {
                using (ProduceBussiness db = new ProduceBussiness())
                {
                    BallConfigInfo[] infos = db.GetAllBallConfig();
                    foreach (BallConfigInfo info in infos)
                    {
                        result.Add(Road.Flash.FlashUtils.CreateBallConfigInfo(info));
                    }
                }

                value   = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("bombconfig", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            //return result.ToString(false);
            return(csFunction.CreateCompressXml(context, result, "bombconfig", true));
        }
Example #2
0
        private static Dictionary <int, BallConfigInfo> LoadFromDatabase()
        {
            Dictionary <int, BallConfigInfo> list = new Dictionary <int, BallConfigInfo>();

            using (ProduceBussiness db = new ProduceBussiness())
            {
                BallConfigInfo[] BallConfigInfos = db.GetAllBallConfig();
                foreach (BallConfigInfo b in BallConfigInfos)
                {
                    if (!list.ContainsKey(b.TemplateID))
                    {
                        list.Add(b.TemplateID, b);
                    }
                }
            }
            return(list);
        }
Example #3
0
        private static Dictionary <int, BallConfigInfo> LoadFromDatabase()
        {
            Dictionary <int, BallConfigInfo> dictionary = new Dictionary <int, BallConfigInfo>();

            using (ProduceBussiness produceBussiness = new ProduceBussiness())
            {
                BallConfigInfo[] allBallConfig = produceBussiness.GetAllBallConfig();
                BallConfigInfo[] array         = allBallConfig;
                for (int i = 0; i < array.Length; i++)
                {
                    BallConfigInfo ballConfigInfo = array[i];
                    if (!dictionary.ContainsKey(ballConfigInfo.TemplateID))
                    {
                        dictionary.Add(ballConfigInfo.TemplateID, ballConfigInfo);
                    }
                }
            }
            return(dictionary);
        }