public ActionResult Create([Bind(Include = "ID,Artist,AlbumName,CoverArt,ReleaseDate")] Albums albums)
        {
            if (ModelState.IsValid)
            {
                db.Albums.Add(albums);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(albums));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "ID,SongName")] Songs songs)
        {
            if (ModelState.IsValid)
            {
                db.SongName.Add(songs);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(songs));
        }
        public ActionResult Analyze(string Artist, string AlbumName, string ReleaseDate, string CoverArt, string SongNames)
        {
            Albums2Context AlbumList   = new Albums2Context();
            Albums         AlbumTitles = new Albums();

            AlbumTitles.Artist      = Artist;
            AlbumTitles.AlbumName   = AlbumName;
            AlbumTitles.ReleaseDate = ReleaseDate;
            AlbumTitles.CoverArt    = CoverArt;
            AlbumTitles.SongName    = new List <Songs>();
            AlbumList.Albums.Add(AlbumTitles);

            foreach (var Song in SongNames.Split(','))
            {
                Songs SongName = new Songs();
                SongName.SongName = Song;
                AlbumTitles.SongName.Add(SongName);
            }



            AlbumList.SaveChanges();
            return(RedirectToAction("Index"));
        }