public static string Bulid(HttpContext context) { bool value = false; string message = "Fail!"; XElement result = new XElement("Result"); try { using (ProduceBussiness db = new ProduceBussiness()) { XElement Store = new XElement("Store"); ShopItemInfo[] shop = db.GetALllShop(); foreach (ShopItemInfo s in shop) { Store.Add(FlashUtils.CreateShopInfo(s)); } result.Add(Store); value = true; message = "Success!"; } } catch { } result.Add(new XAttribute("value", value)); result.Add(new XAttribute("message", message)); return(csFunction.CreateCompressXml(context, result, "ShopItemList", true)); }
private static Dictionary <int, ShopItemInfo> LoadFromDatabase() { Dictionary <int, ShopItemInfo> dictionary = new Dictionary <int, ShopItemInfo>(); using (ProduceBussiness produceBussiness = new ProduceBussiness()) { foreach (ShopItemInfo shopItemInfo in produceBussiness.GetALllShop()) { if (!dictionary.ContainsKey(shopItemInfo.ID)) { dictionary.Add(shopItemInfo.ID, shopItemInfo); } } } return(dictionary); }
private static Dictionary<int,ShopItemInfo> LoadFromDatabase() { Dictionary<int, ShopItemInfo> list = new Dictionary<int, ShopItemInfo>(); using (ProduceBussiness db = new ProduceBussiness()) { ShopItemInfo[] infos = db.GetALllShop(); foreach (ShopItemInfo info in infos) { if (!list.ContainsKey(info.ID)) { list.Add(info.ID, info); } } } return list; }
private static Dictionary <int, ShopItemInfo> LoadFromDatabase() { Dictionary <int, ShopItemInfo> list = new Dictionary <int, ShopItemInfo>(); using (ProduceBussiness db = new ProduceBussiness()) { ShopItemInfo[] infos = db.GetALllShop(); foreach (ShopItemInfo info in infos) { if (!list.ContainsKey(info.ID)) { list.Add(info.ID, info); } } } return(list); }
private static Dictionary <int, ShopItemInfo> LoadFromDatabase() { Dictionary <int, ShopItemInfo> dictionary = new Dictionary <int, ShopItemInfo>(); using (ProduceBussiness produceBussiness = new ProduceBussiness()) { ShopItemInfo[] aLllShop = produceBussiness.GetALllShop(); ShopItemInfo[] array = aLllShop; for (int i = 0; i < array.Length; i++) { ShopItemInfo shopItemInfo = array[i]; if (!dictionary.ContainsKey(shopItemInfo.ID)) { dictionary.Add(shopItemInfo.ID, shopItemInfo); } } } return(dictionary); }
private static Dictionary <int, ShopItemInfo> LoadFromDatabase() { Dictionary <int, ShopItemInfo> list = new Dictionary <int, ShopItemInfo>(); using (ProduceBussiness db = new ProduceBussiness()) { ShopItemInfo[] infos = db.GetALllShop(); ShopItemInfo[] array = infos; for (int i = 0; i < array.Length; i++) { ShopItemInfo info = array[i]; if (!list.ContainsKey(info.ID)) { list.Add(info.ID, info); } } } return(list); }