private async void CheckinEpisode_Click(object sender, RoutedEventArgs e) { this.progressBarLoading.Visibility = System.Windows.Visibility.Visible; lastModel = (ListItemViewModel)((MenuItem)sender).DataContext; App.TrackEvent("ViewShow", "Checkin context"); if (await episodeController.checkinEpisode(lastModel.Tvdb, App.ShowViewModel.Name, Int16.Parse(App.ShowViewModel.Year), lastModel.Season, lastModel.Episode)) { lastModel.Watched = true; TraktShow show = await showController.getShowByTVDBID(lastModel.Tvdb); try { App.MainPage.ShowWatchingNowShow(await episodeController.getEpisodeByTvdbAndSeasonInfo(lastModel.Tvdb, lastModel.Season, lastModel.Episode, show), show, DateTime.UtcNow); } catch (NullReferenceException) { } ToastNotification.ShowToast("Show", "Checked in!"); } else { ErrorManager.ShowConnectionErrorPopup(); } lastModel = null; this.progressBarLoading.Visibility = System.Windows.Visibility.Collapsed; }
private async void CheckinEpisode_Click(object sender, RoutedEventArgs e) { this.indicator = App.ShowLoading(this); lastModel = (ListItemViewModel)((MenuItem)sender).DataContext; if (await episodeController.checkinEpisode(lastModel.Tvdb, lastModel.Name, lastModel.Year, lastModel.Season, lastModel.Episode)) { if (lastModel != null) { lastModel.Watched = true; } TraktShow show = await showController.getShowByTVDBID(lastModel.Tvdb); ShowWatchingNowShow(await episodeController.getEpisodeByTvdbAndSeasonInfo(lastModel.Tvdb, lastModel.Season, lastModel.Episode, show), show, DateTime.UtcNow); ToastNotification.ShowToast("Show", "Checked in!"); } else { ErrorManager.ShowConnectionErrorPopup(); } lastModel = null; this.indicator.IsVisible = false; }
private async void checkinButton_Click(object sender, EventArgs e) { if (!LoadingActive) { App.TrackEvent("ViewEpisode", "Checkin"); LoadingActive = true; progressBarLoading.Visibility = System.Windows.Visibility.Visible; try { if (await episodeController.checkinEpisode(this.show.tvdb_id, this.show.Title, this.show.year, this.episode.Season, this.episode.Number)) { ToastNotification.ShowToast("Episode", "Checked in!"); try { App.MainPage.ShowWatchingNowShow(await episodeController.getEpisodeByTvdbAndSeasonInfo(this.show.tvdb_id, this.episode.Season, this.episode.Number, this.show), this.show, DateTime.UtcNow); } catch (NullReferenceException) { } } else { App.TrackEvent("ViewEpisode", "Checkin failed"); ToastNotification.ShowToast("Episode", "There is already a checkin in progress."); } InitAppBar(); } catch (WebException) { ErrorManager.ShowConnectionErrorPopup(); } catch (TargetInvocationException) { ErrorManager.ShowConnectionErrorPopup(); } progressBarLoading.Visibility = System.Windows.Visibility.Collapsed; LoadingActive = false; } }