public MenuSlideDisplay GetMenuSlide(string slideId, bool previewMode) { var slide = this._slideService.GetSlideDetails(slideId); if (slide == null) { return(null); } var display = new MenuSlideDisplay { DateTimeStamp = this._timeStampRepository.GetTimeStamp(slide.Id), MenuSlide = slide, DesignSettings = this._designSettingsService.GetDesignSettings(slideId), DisplaySettings = this._displaySettingsService.GetDisplaySettings(slideId), DisplayCode = this._globalSettingsRepository.GetDisplayCode("testaccount") }; display.MenuSlide.Menus = this._menuService.GetMenus(slideId); if (previewMode) { display.IsLive = true; } else { SetLiveStatus(display); } return(display); }
public ActionResult PreviewMenuSlide(string slideId) { MenuSlideDisplay slide = null; if (!string.IsNullOrEmpty(slideId)) { slide = this.displayService.GetMenuSlide(slideId, true); } return(View("MenuSlide", slide)); }
public ActionResult MenuSlide(string slideId) { var verifiedCookie = this.Request.Cookies[Constants.VERIFIED_COOKIE_NAME]; if (verifiedCookie == null || verifiedCookie.Value != "true") { return(RedirectToAction("EnterCode")); } MenuSlideDisplay slide = null; if (!string.IsNullOrEmpty(slideId)) { slide = this.displayService.GetMenuSlide(slideId, false); } return(View(slide)); }
private void SetLiveStatus(MenuSlideDisplay slide) { slide.IsLive = !string.IsNullOrEmpty(slide.DisplaySettings.GoLiveDatetime) && DateTime.Parse(slide.DisplaySettings.GoLiveDatetime) < DateTime.Now && !slide.DisplaySettings.Disable; }