Ejemplo n.º 1
0
 public ActionResult UpdateAlbum(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new AlbumViewModels();
     _model.GetSelectedAlbum = _facade.GetAlbumRep().GetAlbumById(id);
     return View(_model);
 }
Ejemplo n.º 2
0
 public ActionResult DeleteArtist(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new ArtistViewModel();
     _model.GetSelectedArtist = _facade.GetArtistRep().GetArtistById(id);
     return View(_model);
 }
Ejemplo n.º 3
0
 public ActionResult UpdateGenre(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new GenreViewModel();
     _model.GetSelectedGenre = _facade.GetGenreRep().GetGenreById(id);
     return View(_model);
 }
Ejemplo n.º 4
0
 public ActionResult CreateAlbum()
 {
     _facade = new DataAccessLayerfacade();
     var model = new AlbumViewModels();
     model.AllArtists = _facade.GetArtistRep().GetAllArtist();
     model.AllGenres = _facade.GetGenreRep().GetAllGenres();
     return View(model);
 }
Ejemplo n.º 5
0
        public ActionResult UpdateAlbum(Album model)
        {
            _facade = new DataAccessLayerfacade();
            model.Artist = _facade.GetArtistRep().GetArtistById(model.artistId);
            model.Genre = _facade.GetGenreRep().GetGenreById(model.genreId);

            _facade.GetAlbumRep().Update(model);

            return RedirectToAction("Index");
        }
Ejemplo n.º 6
0
 // GET: Artist
 public ActionResult Index(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new ArtistViewModel();
     if (_facade.GetArtistRep().GetAllArtist().Count == 0)
     {
         _model.AllArtists = _facade.GetArtistRep().GetAllArtist();
     }
     else
     {
         _model.AllArtists = _facade.GetArtistRep().GetAllArtist();
         _model.GetSelectedArtist = id != null ? _model.AllArtists.FirstOrDefault(a => a.id == id) : _model.AllArtists.FirstOrDefault();
     }
     return View(_model);
 }
Ejemplo n.º 7
0
 public ActionResult CreateAlbum(AlbumModel model)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetAlbumRep()
         .CreateAlbum(new Album
         {
             title = model.Title,
             artistId = model.Artist,
             price = model.Price,
             genreId = model.Genre,
             albumArtURL = model.AlbumArtUrl,
             songSampleURL = model.SongSampleUrl,
             releaseDate = model.ReleaseDate
         });
     return RedirectToAction("Index");
 }
Ejemplo n.º 8
0
 public ActionResult DeleteArtist(int id)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetArtistRep().DeleteArtist(id);
     return RedirectToAction("Index");
 }
Ejemplo n.º 9
0
 public ActionResult UpdateArtist(Artist artist)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetArtistRep().UpdateArtist(artist);
     return RedirectToAction("Index");
 }
Ejemplo n.º 10
0
 public ActionResult CreateArtist(ArtistModel model)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetArtistRep().CreateArtist(new Artist { name = model.Name });
     return RedirectToAction("Index");
 }
Ejemplo n.º 11
0
 public ActionResult UpdateGenre(Genre genre)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetGenreRep().UpdateGenre(genre);
     return RedirectToAction("Index");
 }
Ejemplo n.º 12
0
 public ActionResult CreateGenre(GenreModel model)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetGenreRep().CreateGenre(new Genre { name = model.Name });
     return RedirectToAction("Index");
 }