private void SavePoster(HttpPostedFileBase[] files, int filmId)
        {
            if (files == null || filmId == 0)
            {
                return;
            }

            var image = files[0];

            if (image != null)
            {
                DirectoryTools.CheckDirectoryExist(ImageOptions.PATH);

                var posters = posterSrv[filmId];
                DeletePoster(posters);

                var poster = new PosterImageEntity
                {
                    FilmId   = filmId,
                    MaxImage = ImageResize
                               .Resize(image, ImageOptions.PATH, ImageOptions.IMAGE_WIDTH_MAX_VERTICAL, ImageOptions.IMAGE_HEIGHT_MAX_VERTICAL),
                    MinImage = ImageResize
                               .Resize(image, ImageOptions.PATH, ImageOptions.IMAGE_WIDTH_MIN_VERTICAL, ImageOptions.IMAGE_HEIGHT_MIN_VERTICAL)
                };

                posterSrv.Add(poster);
            }
        }
Beispiel #2
0
 public void Add(Poster Object)
 {
     Object.StatusID    = Convert.ToInt32(Status.Pending);
     Object.Active      = true;
     Object.CreatedDate = DateTime.Now;
     //TODO: Get User ID
     Object.CreatedByUserID = 1;
     _IPoster.Add(Object);
 }