diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs index c09325cd..272966c9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs @@ -10,8 +10,8 @@ namespace CampusAppWP8.Pages.Lecture { public class LectureFeed : XmlFeed { - public LectureFeed() - : base(new Uri("http://www.zv.tu-cottbus.de/LSFveranst/LSF4?Semester=20112&Abschluss=82&Studiengang=079&Von=1&Bis=2"), "Lecture.xml") + public LectureFeed(Uri url) + : base(url, "Lecture.xml") { this.validRootName = "lsf_auszug"; } @@ -31,7 +31,12 @@ namespace CampusAppWP8.Pages.Lecture /// true, if file is up-to-date, otherwise false protected override bool CheckIsFileUpToDate() { - return true; + return false; + } + + public static Uri createFeedUrl(string semester, string degree, string course, string from, string to) + { + return new Uri("http://www.zv.tu-cottbus.de/LSFveranst/LSF4?Semester="+semester+"&Abschluss="+degree+"&Studiengang="+course+"&Von="+from+"&Bis="+to); } } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index 657782b2..d73948eb 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -48,26 +48,26 @@ - + - - - - + + + + - - - - + + + + @@ -75,16 +75,18 @@ - - - - + + + + + - - - - + + + + + @@ -92,15 +94,15 @@ - - - - + + + + - diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 21f26d96..8080d402 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -9,20 +9,48 @@ using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using CampusAppWP8.Pages.Lecture; using CampusAppWP8.Utility; +using CampusAppWP8.Model.Lecture; +using CampusAppWP8.Resources; namespace CampusAppWP8.Pages.lecture { public partial class Lecture : PhoneApplicationPage { + /// + /// actual LectureFeed + /// + private LectureFeed feed; + public Lecture() { InitializeComponent(); - LectureFeed test = new LectureFeed(); - test.LoadFeed(); } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { } + + private void SendRequest(object sender, RoutedEventArgs e) + { + ListPickerItem semester = (ListPickerItem)this.Semester.SelectedItem; + ListPickerItem degree= (ListPickerItem)this.Degree.SelectedItem; + ListPickerItem course = (ListPickerItem)this.Course.SelectedItem; + ListPickerItem from = (ListPickerItem)this.From.SelectedItem; + ListPickerItem to = (ListPickerItem)this.To.SelectedItem; + Uri request = LectureFeed.createFeedUrl(semester.Tag.ToString(), degree.Tag.ToString(), course.Tag.ToString(), from.Tag.ToString(), to.Tag.ToString()); + this.feed = new LectureFeed(request); + this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady); + this.feed.LoadFeed(); + } + + /// + /// Method will be execute if the feed is ready + /// + private void FeedIsReady() + { + App.SaveToIsolatedStorage(Constants.IsolatedStorageLectureModel, this.feed.Model); + Uri url = new Uri(Constants.PathResultPage, UriKind.Relative); + NavigationService.Navigate(url); + } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index f5ecfd1f..7004f271 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -13,7 +13,6 @@ namespace CampusAppWP8.Pages.Lecture using System.Windows.Navigation; using CampusAppWP8.Model.Lecture; using CampusAppWP8.Resources; - using CampusAppWP8.Utility; using Microsoft.Phone.Controls; /// @@ -21,11 +20,6 @@ namespace CampusAppWP8.Pages.Lecture /// public partial class ResultPage : PhoneApplicationPage { - /// - /// actual LectureFeed - /// - private LectureFeed feed; - /// /// Reference of the button which was lastClicked /// @@ -37,18 +31,17 @@ namespace CampusAppWP8.Pages.Lecture public ResultPage() { this.InitializeComponent(); - this.feed = new LectureFeed(); - this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady); - this.feed.LoadFeed(); } /// - /// Method will be execute if the feed is ready + /// Override the OnNavigatedTo method /// - private void FeedIsReady() + /// Arguments of navigation + protected override void OnNavigatedTo(NavigationEventArgs e) { - this.ResultList.ItemsSource = this.feed.Model.Activities; - App.SaveToIsolatedStorage(Constants.IsolatedStorageLectureModel, this.feed.Model); + LectureList list = App.LoadFromIsolatedStorage(Constants.IsolatedStorageLectureModel); + this.ResultList.ItemsSource = list.Activities; + base.OnNavigatedTo(e); } /// @@ -139,7 +132,7 @@ namespace CampusAppWP8.Pages.Lecture private void ShowModulWebPage(object sender, RoutedEventArgs e) { Button btn = (Button)sender; - Uri url = new Uri(Constants.PathLectureModulWebPage + Constants.Paramseparator + Constants.ParamLectureModulNumber + "=" + btn.Tag, UriKind.Relative); + Uri url = new Uri(Constants.PathLectureModulWebPage + "?" + Constants.ParamLectureModulNumber + "=" + btn.Tag, UriKind.Relative); NavigationService.Navigate(url); } @@ -151,7 +144,7 @@ namespace CampusAppWP8.Pages.Lecture private void ShowDetailPage(object sender, RoutedEventArgs e) { Button btn = (Button)sender; - Uri url = new Uri(Constants.PathResultDetailWebPage + Constants.Paramseparator + Constants.ParamLectureActivityId + "=" + btn.Tag, UriKind.Relative); + Uri url = new Uri(Constants.PathResultDetailPage + "?" + Constants.ParamLectureActivityId + "=" + btn.Tag, UriKind.Relative); NavigationService.Navigate(url); } } diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index f4b319d3..b65e09d5 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -13,7 +13,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index 75da5d4b..89fc3666 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -87,15 +87,6 @@ namespace CampusAppWP8.Resources { } } - /// - /// Sucht eine lokalisierte Zeichenfolge, die ? ähnelt. - /// - internal static string Paramseparator { - get { - return ResourceManager.GetString("Paramseparator", resourceCulture); - } - } - /// /// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt. /// @@ -117,9 +108,18 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultDetailPage.xaml ähnelt. /// - internal static string PathResultDetailWebPage { + internal static string PathResultDetailPage { get { - return ResourceManager.GetString("PathResultDetailWebPage", resourceCulture); + return ResourceManager.GetString("PathResultDetailPage", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultPage.xaml ähnelt. + /// + internal static string PathResultPage { + get { + return ResourceManager.GetString("PathResultPage", resourceCulture); } } diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 95a62f96..6ec52b15 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -126,16 +126,13 @@ ModulNumber - - ? - Url /Pages/Lecture/ModulWebPage.xaml - + /Pages/Lecture/ResultDetailPage.xaml @@ -147,4 +144,7 @@ https://webmail.tu-cottbus.de + + /Pages/Lecture/ResultPage.xaml + \ No newline at end of file