protected void TracksSelectionList_ItemCommand(object sender, ListViewCommandEventArgs e) { if (string.IsNullOrEmpty(PlaylistName.Text)) { MessageUserControl.ShowInfo("Warning", "You must supply a playlist name."); } else { //obtain the user name. string username = User.Identity.Name; //obtain the playlist name string playlistname = PlaylistName.Text; int trackid = int.Parse(e.CommandArgument.ToString()); //connect to BLL controller //call required method //refresh the screen //do all this under the user frindly errir handler MessageUserControl.TryRun(() => { PlaylistTrackController sysmgr = new PlaylistTrackController(); sysmgr.Add_TrackToPlaylist(playlistname, username, trackid); List <UserPlaylistTrack> results = sysmgr.List_TrackForPlaylist(playlistname, username); PlayList.DataSource = results; PlayList.DataBind(); }, "Playlist Track Added", "You havce successfully added a new track to your list"); } }
protected void MoveTrack(int trackid, int tracknumber, string direction) { //call the BLL move method //refresh the playlist MessageUserControl.TryRun(() => { PlaylistTrackController sysmgr = new PlaylistTrackController(); //sysmgr.Add_TrackToPLaylist(playlistname, username, trackid); List <UserPlaylistTrack> results = sysmgr.List_TrackForPlaylist(PlaylistName.Text, User.Identity.Name); PlayList.DataSource = results; PlayList.DataBind(); }, "Playlist Track Added", "You have successfully added a new track to your list."); }
protected void PlayListFetch_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(PlaylistName.Text)) { MessageUserControl.ShowInfo("Warning", "Playlist Name is required."); } else { MessageUserControl.TryRun(() => { string username = User.Identity.Name; PlaylistTrackController sysmgr = new PlaylistTrackController(); List <UserPlaylistTrack> playlist = sysmgr.List_TrackForPlaylist( PlaylistName.Text, username); PlayList.DataSource = playlist; PlayList.DataBind(); }); } }