// // GET: /ScreenWizard/Step1/5 public ActionResult Step1(int id) { try { if (Session["UserAccountID"] == null) { return(RedirectToAction("Validate", "Login")); } User user = (User)Session["User"]; ViewData["LoginInfo"] = Utility.BuildUserAccountString(user.Username, Convert.ToString(Session["UserAccountName"])); if (user.IsAdmin) { ViewData["txtIsAdmin"] = "true"; } else { ViewData["txtIsAdmin"] = "false"; } Screen screen = CreateNewScreen(); if (id > 0) { screen = repository.GetScreen(id); } string mainfeaturetype = String.Empty; if (screen.SlideShowID != 0) { mainfeaturetype = "Slide Show"; } else if (screen.PlayListID != 0) { mainfeaturetype = "Play List"; } else if (screen.TimelineID != 0) { mainfeaturetype = "Media Timeline"; } ViewData["ValidationMessage"] = String.Empty; ViewData["MainFeatureTypeList"] = new SelectList(BuildMainFeatureTypeList(), "Value", "Text", mainfeaturetype); return(View(screen)); } catch (Exception ex) { Helpers.SetupApplicationError("ScreenWizard", "Step 1", ex.Message); return(RedirectToAction("Index", "ApplicationError")); } }
// // GET: /Screen/Edit/5 public ActionResult Edit(int id) { try { if (Session["UserAccountID"] == null) { return(RedirectToAction("Validate", "Login")); } User user = (User)Session["User"]; ViewData["LoginInfo"] = Utility.BuildUserAccountString(user.Username, Convert.ToString(Session["UserAccountName"])); if (user.IsAdmin) { ViewData["txtIsAdmin"] = "true"; } else { ViewData["txtIsAdmin"] = "false"; } Screen screen = repository.GetScreen(id); ViewData["ValidationMessage"] = String.Empty; IImageRepository imgrep = new EntityImageRepository(); Image img = imgrep.GetImage(screen.ButtonImageID); ViewData["ImageList"] = new SelectList(BuildImageList(img.StoredFilename), "Value", "Text", img.StoredFilename); ViewData["ImageUrl"] = selectedfile; ViewData["SlideShowList"] = new SelectList(BuildSlideShowList(), "Value", "Text", screen.SlideShowID); ViewData["PlayListList"] = new SelectList(BuildPlayListList(), "Value", "Text", screen.PlayListID); ViewData["ScreenContentList"] = new SelectList(BuildScreenContentList(), "Value", "Text", ""); ViewData["ScreenScreenContentList"] = new SelectList(BuildScreenScreenContentList(screen.ScreenID), "Value", "Text", ""); // Get the content ids for the screen string ids = String.Empty; IScreenScreenContentXrefRepository sscrep = new EntityScreenScreenContentXrefRepository(); IEnumerable <ScreenScreenContentXref> sscs = sscrep.GetScreenScreenContentXrefs(screen.ScreenID); foreach (ScreenScreenContentXref ssc in sscs) { ids += "|" + ssc.ScreenContentID.ToString(); } ViewData["ScreenScreenContent"] = ids; int accountid = 0; if (Session["UserAccountID"] != null) { accountid = Convert.ToInt32(Session["UserAccountID"]); } ViewData["ImageFolder"] = ConfigurationManager.AppSettings["MediaRootFolder"] + Convert.ToString(Session["UserAccountID"]) + @"/Images/"; return(View(screen)); } catch (Exception ex) { Helpers.SetupApplicationError("Screen", "Edit", ex.Message); return(RedirectToAction("Index", "ApplicationError")); } }
public Screen GetScreen(int id) { string key = SingleScreen + id; if (!_cache.CheckInCache(key)) { Func <int, Screen> scr = d => _screenRepository.GetScreen(d); _cache.SetInCache(key, scr, id); _logger.LogInformation($"Set screen {id} in cache"); } return(_cache.ReturnSingleValueByKey(key)); }