Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 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;
 }