예제 #1
0
 public ActionResult FooterText()
 {
     NothwindText northwindText;
     var defaultCacheInstance = SiteCache.FirstOrDefault();
     if (defaultCacheInstance != null)
     {
         if (defaultCacheInstance.Get<string>(CachekeyFotter) == null)
         {
             var cacheDuration = 0;
             var textValue = SiteText.GetText("Footer");
             northwindText = new NothwindText() { TextValue = textValue };
             if (ConfigurationManager.AppSettings.Get(AppSettingKey) != null)
                 int.TryParse(ConfigurationManager.AppSettings.Get(AppSettingKey), out cacheDuration);
             defaultCacheInstance.Set(CachekeyFotter, textValue, cacheDuration);
         }
         else
         {
             northwindText = new NothwindText() { TextValue = defaultCacheInstance.Get<string>(CachekeyFotter) };
         }
     }
     else
     {
         northwindText = new NothwindText() { TextValue = SiteText.GetText("Footer") };
     }
     return View("~/Plugin/CommonWidget/Views/TextWidget/FooterText.cshtml", northwindText);
 }
예제 #2
0
 public ActionResult ReasonText()
 {
     NothwindText northwindText;
     var defaultCacheInstance = SiteCache.FirstOrDefault();
     if (defaultCacheInstance != null)
     {
         if (defaultCacheInstance.Get<string>(CachekeyMiddleRise) == null)
         {
             var cacheDuration = 0;
             var textValue = SiteText.GetText("MiddleResWave");
             var dimond = SiteText.GetText("DiamondPlus");
             var maestroEnterpriseSuite = SiteText.GetText("MaestroEnterpriseSuite");
             var aboutAuthor = SiteText.GetText("AboutAuthor");
             northwindText = new NothwindText()
             {
                 RisWaveText = textValue,
                 DimondPlus = dimond,
                 MaestroEnterpriseSuite = maestroEnterpriseSuite,
                 AboutAuthor = aboutAuthor
             };
             if (ConfigurationManager.AppSettings.Get(AppSettingKey) != null)
             {
                 int.TryParse(ConfigurationManager.AppSettings.Get(AppSettingKey), out cacheDuration);
             }
             defaultCacheInstance.Set(CachekeyMiddleRise, textValue, cacheDuration);
             defaultCacheInstance.Set(CachekeyDimondPlus, dimond, cacheDuration);
             defaultCacheInstance.Set(CachekeyMaestroEnterpriseSuite, maestroEnterpriseSuite, cacheDuration);
             defaultCacheInstance.Set(CachekeyAboutAuthor, aboutAuthor, cacheDuration);
         }
         else
         {
             northwindText = new NothwindText()
             {
                 RisWaveText = defaultCacheInstance.Get<string>(CachekeyMiddleRise),
                 DimondPlus = defaultCacheInstance.Get<string>(CachekeyDimondPlus),
                 MaestroEnterpriseSuite = defaultCacheInstance.Get<string>(CachekeyMaestroEnterpriseSuite),
                 AboutAuthor = defaultCacheInstance.Get<string>(CachekeyAboutAuthor)
             };
         }
     }
     else
     {
         var textValue = SiteText.GetText("MiddleResWave");
         var dimond = SiteText.GetText("DiamondPlus");
         var maestroEnterpriseSuite = SiteText.GetText("MaestroEnterpriseSuite");
         var aboutAuthor = SiteText.GetText("AboutAuthor");
         northwindText = new NothwindText()
         {
             RisWaveText = textValue,
             DimondPlus = dimond,
             MaestroEnterpriseSuite = maestroEnterpriseSuite,
             AboutAuthor = aboutAuthor
         };
     }
     return View("~/Plugin/CommonWidget/Views/TextWidget/ReasonText.cshtml", northwindText);
 }