예제 #1
0
        public ActionResult AddPhotoToAlbum()
        {
            var model = new AlbumPhoto();

            model.Albums = AlbumAutomapper.FromBltoUiGetAll();
            model.Photos = PhotoAutomapper.FromBltoUiGetAll();
            return(PartialView("_AddPhotoToAlbum", model));
        }
예제 #2
0
        public async Task <ActionResult> AddPhotoToAlbum(Guid id)
        {
            var model = new List <PhotoViewModel>();
            //model.Albums =  AlbumAutomapper.FromBltoUiGetAll();
            //model.Photos = await PhotoAutomapper.FromBltoUiGetAll();
            var t = await PhotoAutomapper.FromBltoUiGetAll();

            foreach (var item in t)
            {
                if (item.AlbumId == null)
                {
                    var p = new PhotoViewModel()
                    {
                        AlbumId   = id,
                        PhotoId   = item.PhotoId,
                        PhotoPath = item.PhotoPath,
                    };
                    model.Add(p);
                }
            }
            return(PartialView("_AddPhotoToAlbum", model));
        }