Example #1
0
        private Screen CreateExampleScreen(int accountid, int buttonimageid, int playlistid, int slideshowid, int timelineid, string screenname, List <ScreenContent> screencontents)
        {
            try
            {
                IScreenRepository screenrep = new EntityScreenRepository();
                IScreenScreenContentXrefRepository sscxrefrep = new EntityScreenScreenContentXrefRepository();

                Screen screen = new Screen();
                screen.ButtonImageID     = buttonimageid;
                screen.AccountID         = accountid;
                screen.IsInteractive     = true;
                screen.PlayListID        = playlistid;
                screen.SlideShowID       = slideshowid;
                screen.TimelineID        = timelineid;
                screen.ScreenName        = screenname;
                screen.ScreenDescription = String.Empty;
                screen.IsActive          = true;
                screenrep.CreateScreen(screen);

                int i = 1;
                foreach (ScreenContent screencontent in screencontents)
                {
                    ScreenScreenContentXref sscxref = new ScreenScreenContentXref();
                    sscxref.ScreenID        = screen.ScreenID;
                    sscxref.ScreenContentID = screencontent.ScreenContentID;
                    sscxref.DisplayOrder    = i;
                    sscxrefrep.CreateScreenScreenContentXref(sscxref);
                    i += 1;
                }

                return(screen);
            }
            catch { return(null); }
        }
        private List<SelectListItem> BuildScreenList()
        {
            int accountid = Convert.ToInt32(Session["UserAccountID"]);

            // Build the screen list
            List<SelectListItem> screenitems = new List<SelectListItem>();

            // Add a Blank Screen item
            SelectListItem blankitem = new SelectListItem();
            blankitem.Text = "Blank Screen";
            blankitem.Value = "0";
            screenitems.Add(blankitem);

            IScreenRepository screenrep = new EntityScreenRepository();
            IEnumerable<Screen> screens = screenrep.GetAllScreens(accountid);
            foreach (Screen screen in screens)
            {
                SelectListItem item = new SelectListItem();
                item.Text = screen.ScreenName;
                item.Value = screen.ScreenID.ToString();
                screenitems.Add(item);
            }

            return screenitems;
        }
        private string GetSchedulesByDayHour(List<PlayerGroupSchedule> schedules, int day, int hour)
        {
            try
            {
                string html = String.Empty;
                IScreenRepository screenrep = new EntityScreenRepository();
                string uri = Request.Url.AbsoluteUri;
                if (uri.Contains("?"))
                    uri = uri.Substring(0, uri.IndexOf('?'));

                foreach (PlayerGroupSchedule schedule in schedules)
                {
                    if (schedule.Day == day && schedule.Hour == hour)
                    {
                        Screen screen = new Screen();
                        if (schedule.ScreenID == 0)
                        {
                            screen.ScreenID = 0;
                            screen.ScreenName = "Blank Screen";
                        }
                        else
                        {
                            screen = screenrep.GetScreen(schedule.ScreenID);
                        }
                        if (screen != null)
                        {
                            html += "<div class=\"schedule\">" + screen.ScreenName + "</br>" +
                                String.Format("{0:00}", schedule.Hour) + ":" + String.Format("{0:00}", schedule.Minute) +
                                "&nbsp;&nbsp;<span id=\"schedulelink\"><a href=\"" + uri + "?delete=" + schedule.PlayerGroupScheduleID.ToString() + "\">Delete</a></span></div>";
                        }
                    }
                }

                return html;
            }
            catch { return String.Empty; }
        }
        private Screen CreateExampleScreen(int accountid, int buttonimageid, int playlistid, int slideshowid, int timelineid, string screenname, List<ScreenContent> screencontents)
        {
            try
            {
                IScreenRepository screenrep = new EntityScreenRepository();
                IScreenScreenContentXrefRepository sscxrefrep = new EntityScreenScreenContentXrefRepository();

                Screen screen = new Screen();
                screen.ButtonImageID = buttonimageid;
                screen.AccountID = accountid;
                screen.IsInteractive = true;
                screen.PlayListID = playlistid;
                screen.SlideShowID = slideshowid;
                screen.TimelineID = timelineid;
                screen.ScreenName = screenname;
                screen.ScreenDescription = String.Empty;
                screen.IsActive = true;
                screenrep.CreateScreen(screen);

                int i = 1;
                foreach (ScreenContent screencontent in screencontents)
                {
                    ScreenScreenContentXref sscxref = new ScreenScreenContentXref();
                    sscxref.ScreenID = screen.ScreenID;
                    sscxref.ScreenContentID = screencontent.ScreenContentID;
                    sscxref.DisplayOrder = i;
                    sscxrefrep.CreateScreenScreenContentXref(sscxref);
                    i += 1;
                }

                return screen;
            }
            catch { return null; }
        }