public ActionResult SearchStoreItem(string q, int limit)
        {
            StoreGateway sg = new StoreGateway();
            List<StoreItemJson> item = sg.SearchStoreItems(q, limit);

            System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string sJSON = oSerializer.Serialize(item);
            return Content(sJSON);
        }
예제 #2
0
        public static List<StoreItemJson> GetAllPublishedItems()
        {
            try
            {
                var cached = GetCache(HttpContext.Current.Cache);
                if (cached.StoreItems == null)
                {
                    StoreGateway sg = new StoreGateway();
                    var storeItems = sg.SearchStoreItems();

                    cached.StoreItems = storeItems;
                    UpdateCache(cached);
                }

                return cached.StoreItems;

            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());
            }
            return new List<StoreItemJson>();
        }