public static string Bulid(HttpContext context) { bool value = false; string message = "Fail!"; XElement result = new XElement("Result"); try { using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] infos = db.GetItemBoxInfos(); foreach (ItemBoxInfo info in infos) { result.Add(Road.Flash.FlashUtils.CreateItemBoxInfo(info)); } } value = true; message = "Success!"; } catch (Exception ex) { log.Error("LoadBoxTemp", ex); } result.Add(new XAttribute("value", value)); result.Add(new XAttribute("message", message)); return(csFunction.CreateCompressXml(context, result, "LoadBoxTemp", true)); }
public static bool LoadItemBoxs(Dictionary <int, List <ItemBoxInfo> > infos) { bool result; using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] items = db.GetItemBoxInfos(); ItemBoxInfo[] array = items; ItemBoxInfo item; for (int i = 0; i < array.Length; i++) { item = array[i]; if (!infos.Keys.Contains(item.DataId)) { IEnumerable <ItemBoxInfo> temp = from s in items where s.DataId == item.DataId select s; infos.Add(item.DataId, temp.ToList <ItemBoxInfo>()); } } result = true; } return(result); }
public static ItemBoxInfo[] LoadItemBoxDb() { ItemBoxInfo[] itemBoxInfos; using (ProduceBussiness produceBussiness = new ProduceBussiness()) itemBoxInfos = produceBussiness.GetItemBoxInfos(); return(itemBoxInfos); }
public static ItemBoxInfo[] LoadItemBoxDb() { ItemBoxInfo[] result; using (ProduceBussiness produceBussiness = new ProduceBussiness()) { ItemBoxInfo[] itemBoxInfos = produceBussiness.GetItemBoxInfos(); result = itemBoxInfos; } return(result); }
/// <summary> /// 从数据库中加载箱子物品 /// </summary> /// <returns></returns> public static ItemBoxInfo[] LoadItemBoxDb() { Dictionary<int, ItemBoxInfo> list = new Dictionary<int, ItemBoxInfo>(); using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] infos = db.GetItemBoxInfos(); return infos; } return null; }
/// <summary> /// 从数据库中加载箱子物品 /// </summary> /// <returns></returns> public static ItemBoxInfo[] LoadItemBoxDb() { Dictionary <int, ItemBoxInfo> list = new Dictionary <int, ItemBoxInfo>(); using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] infos = db.GetItemBoxInfos(); return(infos); } return(null); }
/// <summary> /// 从数据库中加载掉落物品 /// </summary> /// <param name="infos"></param> /// <returns></returns> public static bool LoadItemBoxs(Dictionary <int, List <ItemBoxInfo> > infos) { using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] items = db.GetItemBoxInfos(); foreach (ItemBoxInfo item in items) { if (!infos.Keys.Contains(item.DataId)) { IEnumerable <ItemBoxInfo> temp = items.Where(s => s.DataId == item.DataId); infos.Add(item.DataId, temp.ToList()); } } return(true); } }
/// <summary> /// 从数据库中加载掉落物品 /// </summary> /// <param name="infos"></param> /// <returns></returns> public static bool LoadItemBoxs(Dictionary<int, List<ItemBoxInfo>> infos) { using (ProduceBussiness db = new ProduceBussiness()) { ItemBoxInfo[] items = db.GetItemBoxInfos(); foreach (ItemBoxInfo item in items) { if (!infos.Keys.Contains(item.DataId)) { IEnumerable<ItemBoxInfo> temp = items.Where(s => s.DataId == item.DataId); infos.Add(item.DataId, temp.ToList()); } } return true; } }