Example #1
0
        private SlideShow CreateExampleSlideShow(int accountid, string slideshowname, string tags, List <Image> images)
        {
            try
            {
                ISlideShowRepository slideshowrep = new EntitySlideShowRepository();
                SlideShow            slideshow    = new SlideShow();
                slideshow.AccountID      = accountid;
                slideshow.SlideShowName  = slideshowname;
                slideshow.Tags           = tags;
                slideshow.TransitionType = "Fade";
                slideshow.IntervalInSecs = 10;
                slideshow.IsActive       = true;
                slideshowrep.CreateSlideShow(slideshow);

                ISlideShowImageXrefRepository ssixrefrep = new EntitySlideShowImageXrefRepository();
                int i = 1;
                foreach (Image image in images)
                {
                    SlideShowImageXref xref = new SlideShowImageXref();
                    xref.PlayOrder   = i;
                    xref.SlideShowID = slideshow.SlideShowID;
                    xref.ImageID     = image.ImageID;
                    ssixrefrep.CreateSlideShowImageXref(xref);
                    i += 1;
                }

                return(slideshow);
            }
            catch { return(null); }
        }
        private SlideShow CreateExampleSlideShow(int accountid, string slideshowname, string tags, List<Image> images)
        {
            try
            {
                ISlideShowRepository slideshowrep = new EntitySlideShowRepository();
                SlideShow slideshow = new SlideShow();
                slideshow.AccountID = accountid;
                slideshow.SlideShowName = slideshowname;
                slideshow.Tags = tags;
                slideshow.TransitionType = "Fade";
                slideshow.IntervalInSecs = 10;
                slideshow.IsActive = true;
                slideshowrep.CreateSlideShow(slideshow);

                ISlideShowImageXrefRepository ssixrefrep = new EntitySlideShowImageXrefRepository();
                int i = 1;
                foreach (Image image in images)
                {
                    SlideShowImageXref xref = new SlideShowImageXref();
                    xref.PlayOrder = i;
                    xref.SlideShowID = slideshow.SlideShowID;
                    xref.ImageID = image.ImageID;
                    ssixrefrep.CreateSlideShowImageXref(xref);
                    i += 1;
                }

                return slideshow;
            }
            catch { return null; }
        }