コード例 #1
0
        // GET: api/cache/5
        public string Get(int id)
        {
            HttpContext oc = HttpContext.Current;

            if (id == 33197000)
            {
                IDictionaryEnumerator en = oc.Cache.GetEnumerator();

                //string strResult;
                while (en.MoveNext())
                {
                    cacheManager.RemoveFromCache(en.Key.ToString());
                }


                return("Cache removed");
            }
            else if (id == 791975)
            {
                var             x = SettingsCache.GetProvider(1003);
                int             y = SettingsCache.getGeoX(1005, "US", 1003);
                int             c = SettingsCache.getRealPageID(5010, 1003);
                int             d = SettingsCache.getPageByGEO(1000, 1005, "US");
                pixLandingPages f = SettingsCache.GetPage(5502);
                return("Cache populated ");
            }
            else
            {
                log.Fatal("Someone is trying to delete application cache with no proper key");
            }

            return("mmmmm");
        }
コード例 #2
0
ファイル: cacheObjets.aspx.cs プロジェクト: facethep/pixWeb
        protected void btnPopulate_Click(object sender, EventArgs e)
        {
            var x = SettingsCache.GetProvider(1003);
            int y = SettingsCache.getGeoX(1005, "US", 1003);
            int c = SettingsCache.getRealPageID(5010, 1003);
            // pixLandingPagesByGEO d = SettingsCache.GetPageByGEO(5011, "US");
            pixLandingPages f = SettingsCache.GetPage(5502);

            lblStatus.Text = "Done - " + System.DateTime.Today.ToLongTimeString();
        }
コード例 #3
0
        // GET: api/m/5
        public string Get(int id)
        {
            string[] pagesList = SettingsCache.MAC_PAGES.Split(',');

            pixLandingPages macPage         = SettingsCache.GetPage(1005);
            string          currentPageName = macPage.url.Split('/')[4].Split('?')[0];

            //id = 6 will be used to get the new page and change in database
            //any other id will be used to get the curent page

            if (id == 6)
            {
                string macUrl = macPage.url;
                string newPageName;
                newPageName = currentPageName;
                string tmpPageName;
                //getting the new page name
                for (int i = 0; i < pagesList.Length - 1; i++)
                {
                    tmpPageName = pagesList[i].ToString();
                    if (tmpPageName.ToLower() == currentPageName)
                    {
                        newPageName = pagesList[i + 1].ToString();
                    }
                }

                if (!newPageName.Equals(currentPageName))
                {
                    macPage.url = macPage.url.Replace(currentPageName, newPageName);
                    var db = new PetaPoco.Database("myConnectionString");
                    db.Update(macPage);
                }

                return(macPage.url);
            }

            else
            {
                return(currentPageName);
            }
        }