// GET: Songs/Create public ActionResult Create() { var addForm = new SongAddForm(); addForm.AlbumId = new SelectList(m.AllAlbumsList(), "Id", "AlbumAndArtist"); addForm.Genre = new SelectList(m.AllGenres()); addForm.SingleReleaseDate = DateTime.Now.AddYears(-1); return(View(addForm)); }
// GET: Songs/Create public ActionResult Create() { var songAdd = new SongAddForm(); songAdd.Genre = new SelectList(m.AllGenres()); songAdd.Albums = new SelectList(m.AllAlbumsList(), "Id", "Name"); songAdd.ReleaseDateAsSingle = DateTime.Now; return(View(songAdd)); }
// GET: Songs/Create public ActionResult Create() { // Create and configure an 'add form' var addForm = new SongAddForm(); // Fetch for and configure the album listbox //addForm.AlbumId = new SelectList(m.AllAlbumsList(), "Id", "Name"); addForm.AlbumId = new SelectList(m.AllAlbumsList(), "Id", "AlbumAndArtist"); // Fetch and configure the genres addForm.Genre = new SelectList(m.AllGenres()); return View(addForm); }