diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs index a09237b8..cd4fecb5 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs @@ -12,6 +12,7 @@ namespace CampusAppWP8.Pages.Mensa using CampusAppWP8.Feed.GeoApi; using CampusAppWP8.Feed.Mensa; using Microsoft.Phone.Controls; + using System.Windows; /// /// Class for the MensaPage @@ -99,6 +100,15 @@ namespace CampusAppWP8.Pages.Mensa this.InitializeFeed(this.campusApi.GetCampus()); } + /// + /// Method will be execute if the SPSAPI is failed + /// + private void SpsApiIsFail() + { + MessageBoxResult result = MessageBox.Show("LoadModel Failed", "Fehler", MessageBoxButton.OK); + this.InitializeFeed(Settings.UserProfil.DefaultCampus); + } + /// /// Method determine campus and load data from correct feed /// @@ -106,6 +116,7 @@ namespace CampusAppWP8.Pages.Mensa { this.campusApi = new CampusSpsApi(); this.campusApi.onLoaded += new SpsApi.OnLoaded(this.SpsApiIsReady); + this.campusApi.onFailed += new SpsApi.OnFailed(this.SpsApiIsFail); this.campusApi.SetupCurrentCampusRequest(); this.campusApi.LoadData(); } @@ -118,6 +129,7 @@ namespace CampusAppWP8.Pages.Mensa { this.feed = MensaFeed.CreateCampusMensaFeed(campus); this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady); + this.feed.onFailed += new MensaFeed.OnFailed(this.FeedIsFail); this.CalcSelectedIndex(); if (this.forceLoad) @@ -162,6 +174,14 @@ namespace CampusAppWP8.Pages.Mensa this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed; } + /// + /// Method will be execute if the feed is failed + /// + private void FeedIsFail() + { + MessageBoxResult result = MessageBox.Show("LoadModel Failed", "Fehler", MessageBoxButton.OK); + } + /// /// Method set ItemSource and SelectedIndex for the pivot ///