private void SaveExecute() { try { service.AddSong(Song, userToView.UserID); MessageBox.Show("Song added."); addSong.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
/// <summary> /// Tries the execute the save command /// </summary> private void SaveExecute() { try { service.AddSong(Song); isUpdateSong = true; addSong.Close(); } catch (Exception ex) { Debug.WriteLine("Exception" + ex.Message.ToString()); } }
private void AddSongExecute() { try { if (!ValidationClass.IsSongLengthValid(Song.SongLength)) { MessageBox.Show("Lenght is not in valid format"); } tblUser user = service.GetUserByUserName(UserName); Song.UserID = user.UserID; service.AddSong(Song); view.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void SaveExecute() { try { newSong.userId = user.userId; tblSong s = Service.Service.AddNewSong(newSong); if (s != null) { isUpdated = true; MessageBox.Show("Song has been succesfully added!"); addSong.Close(); } else { MessageBox.Show("Error.Try again."); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }