コード例 #1
0
        public List <Image> CreateExampleImageAndSlideShowData(int accountid)
        {
            try
            {
                // Copy the five images for the sample
                Image img1 = CreateExampleImage(accountid, "Visit Las Vegas Button", "vegasbutton.png", "6f5e187f-52a2-4799-bdac-2e9199580b98.png", "Las Vegas");
                Image img2 = CreateExampleImage(accountid, "Vegas 01", "vegas01.jpg", "60255096-6a72-409e-b905-4d98ee717bb0.jpg", "Las Vegas");
                Image img3 = CreateExampleImage(accountid, "Vegas 02", "vegas02.jpg", "612bb76c-e16e-4fe8-87f2-bddc7eb59300.jpg", "Las Vegas");
                Image img4 = CreateExampleImage(accountid, "Vegas 03", "vegas03.jpg", "69f99c47-d1b0-4123-b62b-8f18bdc5702f.jpg", "Las Vegas");
                Image img5 = CreateExampleImage(accountid, "Vegas 04", "vegas04.jpg", "626c6a35-4523-46aa-9d0a-c2687b581e27.jpg", "Las Vegas");

                // Create a slideshow with the images
                List <Image> images = new List <Image> {
                    img2, img3, img4, img5
                };
                SlideShow slideshow = CreateExampleSlideShow(accountid, "Visit Vegas Slideshow", "Las Vegas", images);

                // Create one screencontent item for each image
                ScreenContent sc1 = CreateExampleScreenContent(accountid, "Vegas 01 Image", "Las Vegas Is Fun!", 1000000, img2.ImageID, img2.ImageID.ToString());
                ScreenContent sc2 = CreateExampleScreenContent(accountid, "Vegas 02 Image", "Visit Las Vegas!", 1000000, img3.ImageID, img3.ImageID.ToString());
                ScreenContent sc3 = CreateExampleScreenContent(accountid, "Vegas 03 Image", "There's so much to do in Vegas!", 1000000, img4.ImageID, img4.ImageID.ToString());
                ScreenContent sc4 = CreateExampleScreenContent(accountid, "Vegas 04 Image", "Good times, day or night!", 1000000, img5.ImageID, img5.ImageID.ToString());

                // Create the screen with slideshow and four screen content items
                List <ScreenContent> screencontents = new List <ScreenContent> {
                    sc1, sc2, sc3, sc4
                };
                Screen screen = CreateExampleScreen(accountid, img1.ImageID, 0, slideshow.SlideShowID, 0, "Visit Las Vegas", screencontents);

                // Create a PlayerGroup - My Players - and Player - My Player
                PlayerGroup playergroup = CreateExamplePlayerGroup(accountid, "My Players");
                Player      player      = CreateExamplePlayer(accountid, playergroup.PlayerGroupID, "My Player");

                // Create the schedule for My Players player group
                CreateExamplePlayerGroupSchedule(accountid, playergroup.PlayerGroupID, screen.ScreenID);

                return(images);
            }
            catch { return(new List <Image>()); }
        }
コード例 #2
0
        private ScreenContent CreateExampleScreenContent(int accountid, string screencontentname, string screencontenttitle, int screencontenttypeid, int thumbnailimageid, string customfield1)
        {
            try
            {
                IScreenContentRepository screencontentrep = new EntityScreenContentRepository();
                ScreenContent            content          = new ScreenContent();
                content.AccountID           = accountid;
                content.ScreenContentName   = screencontentname;
                content.ScreenContentTitle  = screencontenttitle;
                content.ScreenContentTypeID = screencontenttypeid;
                content.ThumbnailImageID    = thumbnailimageid;
                content.CustomField1        = customfield1;
                content.CustomField2        = String.Empty;
                content.CustomField3        = String.Empty;
                content.CustomField4        = String.Empty;
                content.IsActive            = true;
                screencontentrep.CreateScreenContent(content);

                return(content);
            }
            catch { return(null); }
        }
コード例 #3
0
 public void UpdateScreenContent(ScreenContent screencontent)
 {
     db.Entry(screencontent).State = EntityState.Modified;
     db.SaveChanges();
 }
コード例 #4
0
        public ScreenContent GetScreenContent(int id)
        {
            ScreenContent screencontent = db.ScreenContents.Find(id);

            return(screencontent);
        }
コード例 #5
0
 public void CreateScreenContent(ScreenContent screencontent)
 {
     db.ScreenContents.Add(screencontent);
     db.SaveChanges();
 }