Exemplo n.º 1
0
        public void AddGenre(Guid id, string description)
        {
            var ent   = new MediaCatalogueEntities();
            var genre = new Music_Genre();

            genre.id          = id;
            genre.Description = description;
            ent.AddToMusic_Genre(genre);
            ent.SaveChanges();
        }
Exemplo n.º 2
0
        public void AddArtist(Guid id, string description)
        {
            var ent    = new MediaCatalogueEntities();
            var artist = new Music_Artist();

            artist.id   = id;
            artist.Name = description;
            ent.AddToMusic_Artist(artist);
            ent.SaveChanges();
        }
Exemplo n.º 3
0
        public void UpdateGenre(Guid id, string description)
        {
            var ent   = new MediaCatalogueEntities();
            var genre = (from g in ent.Music_Genre
                         where g.id == id
                         select g).FirstOrDefault();

            if (genre != null)
            {
                genre.Description = description;
                ent.SaveChanges();
            }
        }
Exemplo n.º 4
0
        public void UpdateArtist(Guid id, string description)
        {
            var ent    = new MediaCatalogueEntities();
            var artist = (from a in ent.Music_Artist
                          where a.id == id
                          select a).FirstOrDefault();

            if (artist != null)
            {
                artist.Name = description;
                ent.SaveChanges();
            }
        }
Exemplo n.º 5
0
        public void UpdateVideoClip(MusicVideoClip clip)
        {
            var ent = new MediaCatalogueEntities();

            var vc = (from c in ent.Music_Track.Include("Media_Item")
                      .Include("Music_Genre")
                      .Include("Music_Artist")
                      where c.id == clip.id
                      select c).FirstOrDefault();

            if (vc != null)
            {
                vc.Media_Item.Title = clip.SongName;
                vc.Duration         = clip.Duration;

                // ToDo: Find the right Genre and Artist entities, and update the references

                ent.SaveChanges();
            }
        }