private void addToPlButton_Click(object sender, EventArgs e) { try { string plName = PlBox.Text; Int32 selectedRowCount = plContentGrid.Rows.GetRowCount(DataGridViewElementStates.Selected); int[] row = new int[selectedRowCount]; for (int i = 0; i < selectedRowCount; ++i) { row[i] = plContentGrid.SelectedRows[i].Index; } PlayList pl; for (int i = 0; i < selectedRowCount; ++i) { pl = new PlayList(plName, Album.GetAlbumId(_pelems[row[i]].AlbumName), Artist.CheckArtist(_pelems[row[i]].ArtistName), TrackList.GetTrackId(_pelems[row[i]].TrackName)); pl.Create(); } MessageBox.Show("Done!^_^", "TheResult"); } catch { MessageBox.Show("Something bad has happened =(", "Whoops!"); } }
public Either <DomainError, ServiceResponse> Execute(string playListName) { var newPlayListId = uniqueIdentifiers.GetNewUniqueIdentifier(); var playList = PlayList.Create(newPlayListId, playListName); playListPersistence.Persist(playList); playListNotifier.NotifyPlayListHasBeenCreated(playList.Id, playListName); return(ServiceResponse.Success); }
public Either <DomainError, ServiceResponse> Execute(string playListName) { var newPlayListId = uniqueIdentifiers.GetNewUniqueIdentifier(); var playList = PlayList.Create(newPlayListId, playListName); playListPersistence.Persist(playList); eventPublisher.Publish(playList.Events()); return(ServiceResponse.Success); }
public Either <DomainError, CommandResult> Handle(CreatePLayList command) { var newPlayListId = uniqueIdentifiers.GetNewUniqueIdentifier(); var playList = PlayList.Create(newPlayListId, command.PlayListName); playListPersistence.Persist(playList); eventPublisher.Publish(playList.Events()); return(CommandResult.Success); }
private void createPlButton_Click(object sender, EventArgs e) { try { string plname = plBox.Text; if (plname != "") { Album tempal = Album.GetAlbumID("TestAlbum"); Artist tempar = Artist.CheckArtist("TestBand"); TrackList temptr = TrackList.GetTrackID("Test1"); PlayList pl = new PlayList(plname, tempal, tempar, temptr); pl.Create(); } MainForm.Instance().ChangeControl(new AddMusicSub()); } catch { MessageBox.Show("Something bad has happened =(", "Whoops!"); } }