コード例 #1
0
        public static string Build(HttpContext context)
        {
            bool   value   = false;
            string message = "Fail";

            XElement result = new XElement("Result");

            try
            {
                using (PveBussiness db = new PveBussiness())
                {
                    PveInfo[] infos = db.GetAllPveInfos();
                    foreach (var info in infos)
                    {
                        result.Add(Road.Flash.FlashUtils.CreatePveInfo(info));
                    }
                }

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

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));
            return(csFunction.CreateCompressXml(context, result, "LoadPVEItems", true));
        }
コード例 #2
0
ファイル: PveInfoMgr.cs プロジェクト: SkelletonX/DDTServer
        public static Dictionary <int, PveInfo> LoadFromDatabase()
        {
            Dictionary <int, PveInfo> list = new Dictionary <int, PveInfo>();

            using (PveBussiness db = new PveBussiness())
            {
                PveInfo[] infos = db.GetAllPveInfos();
                PveInfo[] array = infos;
                for (int i = 0; i < array.Length; i++)
                {
                    PveInfo info = array[i];
                    if (!list.ContainsKey(info.ID))
                    {
                        list.Add(info.ID, info);
                    }
                }
            }
            return(list);
        }
コード例 #3
0
        public static Dictionary <int, PveInfo> LoadFromDatabase()
        {
            Dictionary <int, PveInfo> list = new Dictionary <int, PveInfo>();

            using (PveBussiness db = new PveBussiness())
            {
                PveInfo[] infos = db.GetAllPveInfos();

                foreach (PveInfo info in infos)
                {
                    if (!list.ContainsKey(info.ID))
                    {
                        list.Add(info.ID, info);
                    }
                }
            }

            return(list);
        }
コード例 #4
0
        public static Dictionary <int, PveInfo> LoadFromDatabase()
        {
            Dictionary <int, PveInfo> dictionary = new Dictionary <int, PveInfo>();

            using (PveBussiness pveBussiness = new PveBussiness())
            {
                PveInfo[] allPveInfos = pveBussiness.GetAllPveInfos();
                PveInfo[] array       = allPveInfos;
                for (int i = 0; i < array.Length; i++)
                {
                    PveInfo pveInfo = array[i];
                    if (!dictionary.ContainsKey(pveInfo.ID))
                    {
                        dictionary.Add(pveInfo.ID, pveInfo);
                    }
                }
            }
            return(dictionary);
        }