Exemple #1
0
        public async Task <ActionResult> AlbumType(int bandId, string albumTypeName)
        {
            var albumType = new AlbumType();

            if (!string.IsNullOrEmpty(albumTypeName))
            {
                albumType = await _albumTypeRepository.GetByBandAsync(bandId, albumTypeName);
            }

            var model = new MusicViewModel();

            if (albumType != null)
            {
                model.AlbumTypeOldName   = albumType.Name;
                model.AlbumTypeDescption = albumType.Description;
                model.AlbumTypeImage     = albumType.ImageUrl;
                model.BandId             = bandId;

                model.AlbumTypes = await _albumTypeRepository.GetPageByBandAsync(1, 100, bandId);

                model.Bands = await _bandRepository.GetAllyAsync();
            }
            else
            {
                model.AlbumTypes = await _albumTypeRepository.GetAllyAsync();

                model.Bands = await _bandRepository.GetAllyAsync();
            }

            return(View(model));
        }
Exemple #2
0
        public async Task <ActionResult> AlbumType(int bandId)
        {
            var band = await _bandRepository.GetByIdAsync(bandId);

            ViewBag.IdBand          = bandId;
            ViewBag.ImageBand       = band.ImageUrl;
            ViewBag.NameBand        = band.Name;
            ViewBag.DescriptionBand = band.Description;

            ViewBag.ListAlbumType = await _albumTypeRepository.GetPageByBandAsync(1, 12, bandId);

            return(View());
        }