示例#1
0
        private PlayerGroup CreateExamplePlayerGroup(int accountid, string playergroupname)
        {
            try
            {
                IPlayerGroupRepository playergrouprep = new EntityPlayerGroupRepository();

                PlayerGroup playergroup = new PlayerGroup();
                playergroup.AccountID              = accountid;
                playergroup.PlayerGroupName        = playergroupname;
                playergroup.PlayerGroupDescription = String.Empty;
                playergroup.IsActive = true;
                playergrouprep.CreatePlayerGroup(playergroup);

                return(playergroup);
            }
            catch { return(null); }
        }
示例#2
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>()); }
        }
        private PlayerGroup CreateExamplePlayerGroup(int accountid, string playergroupname)
        {
            try
            {
                IPlayerGroupRepository playergrouprep = new EntityPlayerGroupRepository();

                PlayerGroup playergroup = new PlayerGroup();
                playergroup.AccountID = accountid;
                playergroup.PlayerGroupName = playergroupname;
                playergroup.PlayerGroupDescription = String.Empty;
                playergroup.IsActive = true;
                playergrouprep.CreatePlayerGroup(playergroup);

                return playergroup;
            }
            catch { return null; }
        }
        public PlayerGroup GetPlayerGroup(int id)
        {
            PlayerGroup playergroup = db.PlayerGroups.Find(id);

            return(playergroup);
        }
 public void UpdatePlayerGroup(PlayerGroup playergroup)
 {
     db.Entry(playergroup).State = EntityState.Modified;
     db.SaveChanges();
 }
 public void CreatePlayerGroup(PlayerGroup playergroup)
 {
     db.PlayerGroups.Add(playergroup);
     db.SaveChanges();
 }
 public void UpdatePlayerGroup(PlayerGroup playergroup)
 {
     db.Entry(playergroup).State = EntityState.Modified;
     db.SaveChanges();
 }
 public void CreatePlayerGroup(PlayerGroup playergroup)
 {
     db.PlayerGroups.Add(playergroup);
     db.SaveChanges();
 }