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

            try
            {
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    ConsortiaLevelInfo[] infos = db.GetAllConsortiaLevel();
                    foreach (ConsortiaLevelInfo info in infos)
                    {
                        result.Add(Road.Flash.FlashUtils.CreateConsortiLevelInfo(info));
                    }
                }

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

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

            return csFunction.CreateCompressXml(context, result, "ConsortiaLevelList", true);
            //return result.ToString(false);
        }
Exemplo n.º 2
0
        private static bool Load(Dictionary<int, ConsortiaLevelInfo> consortiaLevel)
        {
            using (ConsortiaBussiness db = new ConsortiaBussiness())
            {
                ConsortiaLevelInfo[] infos = db.GetAllConsortiaLevel();
                foreach (ConsortiaLevelInfo info in infos)
                {
                    if (!consortiaLevel.ContainsKey(info.Level))
                    {
                        consortiaLevel.Add(info.Level, info);
                    }
                }
            }

            return true;
        }