예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
      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;
      }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }