Пример #1
0
        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);
        }
        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);
        }
Пример #3
0
 private static bool Load(Dictionary <int, ConsortiaLevelInfo> consortiaLevel)
 {
     using (ConsortiaBussiness consortiaBussiness = new ConsortiaBussiness())
     {
         ConsortiaLevelInfo[] allConsortiaLevel = consortiaBussiness.GetAllConsortiaLevel();
         ConsortiaLevelInfo[] array             = allConsortiaLevel;
         for (int i = 0; i < array.Length; i++)
         {
             ConsortiaLevelInfo consortiaLevelInfo = array[i];
             if (!consortiaLevel.ContainsKey(consortiaLevelInfo.Level))
             {
                 consortiaLevel.Add(consortiaLevelInfo.Level, consortiaLevelInfo);
             }
         }
     }
     return(true);
 }