private async void btnAddEntry_Click(object sender, RoutedEventArgs e) { Episode episode = null; bool isSeries = Search.Type != "movie"; if (isSeries) { int season = Int32.Parse(txtSeason.Text); int series = Int32.Parse(txtEpisode.Text); if (!tvdb.EpisodeExists(season, series)) { await new MessageDialog("That episode does not exist.").ShowAsync(); return; } episode = EpisodeDO.FindOrCreate(season, series); } Movie movie = MovieDO.FindOrCreate(Search.ImdbID, Search.Title, Search.Year); bool created = RecordDO.TryCreate(isSeries, DateTime.Now, movie, Registry.Instance.User, episode); string message = created ? String.Format("{0} successfully added at {1}.", Search.Title, DateTime.Now) : String.Format("{0} already exists!", Search.Title); await new MessageDialog(message).ShowAsync(); }