Esempio n. 1
0
        public ActionResult AddComment(Guid id, string albumComment)
        {
            var album  = albumrepo.AddComment(id, albumComment);
            var albums = AlbumModelMapping.ModelToEntity(album);

            return(PartialView("IndexPartial", albums));
        }
Esempio n. 2
0
        public ActionResult AddComment(Guid id)
        {
            var a          = albumrepo.ShowAlbum(id);
            var Addcomment = AlbumModelMapping.ModelToEntity(a);

            return(PartialView("AddComment", Addcomment));
        }
Esempio n. 3
0
        public ActionResult ShowAlbum(Guid id)
        {
            var s    = albumrepo.ShowAlbum(id);
            var show = AlbumModelMapping.ModelToEntity(s);

            return(PartialView("ShowAlbum", show));
        }
Esempio n. 4
0
        public ActionResult AddPhotoToAlbum()
        {
            var aModel = new AlbumPhotoView();

            aModel.Albums = albumrepo.GetAlbum().Select(x => AlbumModelMapping.ModelToEntity(x)).ToList();
            aModel.Photos = photorepo.GetPhotos().Select(x => PhotoModelMapping.ModelToEntity(x)).ToList();
            return(View(aModel));
        }
Esempio n. 5
0
        public ActionResult AddNewAlbum(Album newalbum, string albumcomment)
        {
            newalbum.AlbumID       = Guid.NewGuid();
            newalbum.AlbumName     = newalbum.AlbumName;
            newalbum.AlbumComments = new List <Comments> {
                new Comments {
                    Id = Guid.NewGuid(), CommentOnAlbum = albumcomment
                }
            };
            var albums = AlbumModelMapping.EntityToModel(newalbum);

            albumrepo.AddAlbum(albums);
            return(View(newalbum));
        }
Esempio n. 6
0
 // GET: Album
 public ActionResult Index()
 {
     return(View(albumrepo.GetAlbum().Select(x => AlbumModelMapping.ModelToEntity(x)).ToList()));
 }