From 6071f96b3b70a488a517878d060d00dc83884d55 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Wed, 12 Jun 2013 13:07:24 +0200 Subject: [PATCH 1/4] lecture sendrequest and shows result --- .../CampusAppWP8/Pages/Lecture/LectureFeed.cs | 11 +++-- .../Pages/Lecture/LecturePage.xaml | 46 ++++++++++--------- .../Pages/Lecture/LecturePage.xaml.cs | 32 ++++++++++++- .../Pages/Lecture/ResultPage.xaml.cs | 23 ++++------ .../CampusAppWP8/Properties/WMAppManifest.xml | 2 +- .../Resources/Constants.Designer.cs | 22 ++++----- .../CampusAppWP8/Resources/Constants.resx | 8 ++-- 7 files changed, 86 insertions(+), 58 deletions(-) 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 From eb533e80082578518c06bf941e3bd22f3dd09c3f Mon Sep 17 00:00:00 2001 From: stubbfel Date: Wed, 12 Jun 2013 15:21:16 +0200 Subject: [PATCH 2/4] update lecture --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 649 +++++++++--------- .../Pages/Lecture/LecturePage.xaml | 108 ++- .../Pages/Lecture/LecturePage.xaml.cs | 54 +- .../CampusAppWP8/Pages/Lecture/OptionModel.cs | 15 + .../Resources/AppResources.Designer.cs | 27 + .../CampusAppWP8/Resources/AppResources.resx | 12 +- 6 files changed, 512 insertions(+), 353 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 19f0fb80..b4ed6a7b 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -1,325 +1,326 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {120B88CC-F3F0-4C5A-A3FD-C26E835338CC} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - CampusAppWP8 - CampusAppWP8 - WindowsPhone - v8.0 - $(TargetFrameworkVersion) - true - - - true - true - CampusAppWP8_$(Configuration)_$(Platform).xap - Properties\AppManifest.xml - CampusAppWP8.App - true - 11.0 - true - 5.0.40218.0 - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\x86\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\x86\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\ARM\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\ARM\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - App.xaml - - - - - - - - - - - - - - - - - - CampusMapPage.xaml - - - - - DepartmentPage.xaml - - - - EventIndexPage.xaml - - - EventPage.xaml - - - LecturePage.xaml - - - - - - ModulWebPage.xaml - - - ResultDetailPage.xaml - - - ResultPage.xaml - - - MensaPage.xaml - - - - NewsIndexPage.xaml - - - NewsPage.xaml - - - - StartPage.xaml - - - WebmailPage.xaml - - - - True - True - AppResources.resx - - - True - True - Constants.resx - - - - - - - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - - - - - - - Designer - - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - PublicResXFileCodeGenerator - AppResources.Designer.cs - Designer - - - ResXFileCodeGenerator - Constants.Designer.cs - - - - - - ..\packages\WPtoolkit.4.2012.10.30\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll - - - - - - - + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {120B88CC-F3F0-4C5A-A3FD-C26E835338CC} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + CampusAppWP8 + CampusAppWP8 + WindowsPhone + v8.0 + $(TargetFrameworkVersion) + true + + + true + true + CampusAppWP8_$(Configuration)_$(Platform).xap + Properties\AppManifest.xml + CampusAppWP8.App + true + 11.0 + true + 5.0.40218.0 + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + true + full + false + Bin\x86\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\x86\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + true + full + false + Bin\ARM\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\ARM\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + App.xaml + + + + + + + + + + + + + + + + + + CampusMapPage.xaml + + + + + DepartmentPage.xaml + + + + EventIndexPage.xaml + + + EventPage.xaml + + + LecturePage.xaml + + + + + + ModulWebPage.xaml + + + + ResultDetailPage.xaml + + + ResultPage.xaml + + + MensaPage.xaml + + + + NewsIndexPage.xaml + + + NewsPage.xaml + + + + StartPage.xaml + + + WebmailPage.xaml + + + + True + True + AppResources.resx + + + True + True + Constants.resx + + + + + + + + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + + + + + + + Designer + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + PublicResXFileCodeGenerator + AppResources.Designer.cs + Designer + + + ResXFileCodeGenerator + Constants.Designer.cs + + + + + + ..\packages\WPtoolkit.4.2012.10.30\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index d73948eb..803d8c33 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -14,7 +14,20 @@ OrientationChanged="PhoneApplicationPage_OrientationChanged" mc:Ignorable="d" shell:SystemTray.IsVisible="True"> - + + + + + + + + + + + + + + @@ -28,6 +41,7 @@ + @@ -54,10 +68,21 @@ - - - - + + + + + + + + + + + + + + + @@ -65,10 +90,21 @@ - - - - + + + + + + + + + + + + + + + @@ -76,17 +112,37 @@ - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + @@ -95,9 +151,20 @@ - - - + + + + + + + + + + + + + + @@ -107,7 +174,6 @@ - diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 8080d402..4c82f7dd 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -11,6 +11,7 @@ using CampusAppWP8.Pages.Lecture; using CampusAppWP8.Utility; using CampusAppWP8.Model.Lecture; using CampusAppWP8.Resources; +using System.Collections.ObjectModel; namespace CampusAppWP8.Pages.lecture { @@ -21,9 +22,48 @@ namespace CampusAppWP8.Pages.lecture /// private LectureFeed feed; + private List courseList = new List() + { + new OptionModel(){Text = "Architektur", Value = "013"}, + new OptionModel(){Text = "Bauingenieurwesen", Value = "017"}, + new OptionModel(){Text = "Betriebswirtschaftslehre", Value = "021"} + }; + + private List degreeList = new List() + { + new OptionModel(){Text = AppResources.Degree_Bachelor, Value = "82"}, + new OptionModel(){Text = AppResources.Degree_Master, Value = "88"}, + new OptionModel(){Text = AppResources.Degree_Diploma, Value = "11"} + }; + + private List semesterList = new List() + { + new OptionModel(){Text = "SoSe 13", Value = "20131"}, + new OptionModel(){Text = "WiSe 13/14", Value = "20132"}, + new OptionModel(){Text = "SoSe 14", Value = "20141"} + }; + + private List numberList = new List() + { + new OptionModel(){Text = "1", Value = "1"}, + new OptionModel(){Text = "2", Value = "2"}, + new OptionModel(){Text = "3", Value = "3"}, + new OptionModel(){Text = "4", Value = "4"} + }; + public Lecture() { InitializeComponent(); + setupListPickers(); + } + + private void setupListPickers() + { + this.Course.ItemsSource = courseList; + this.Degree.ItemsSource = degreeList; + this.From.ItemsSource = numberList; + this.To.ItemsSource = numberList; + this.Semester.ItemsSource = semesterList; } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) @@ -32,14 +72,15 @@ namespace CampusAppWP8.Pages.lecture 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()); + OptionModel semester = (OptionModel)this.Semester.SelectedItem; + OptionModel degree = (OptionModel)this.Degree.SelectedItem; + OptionModel course = (OptionModel)this.Course.SelectedItem; + OptionModel from = (OptionModel)this.From.SelectedItem; + OptionModel to = (OptionModel)this.To.SelectedItem; + Uri request = LectureFeed.createFeedUrl(semester.Value, degree.Value, course.Value, from.Value, to.Value); this.feed = new LectureFeed(request); this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady); + this.ProgressBar.Visibility = System.Windows.Visibility.Visible; this.feed.LoadFeed(); } @@ -49,6 +90,7 @@ namespace CampusAppWP8.Pages.lecture private void FeedIsReady() { App.SaveToIsolatedStorage(Constants.IsolatedStorageLectureModel, this.feed.Model); + this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed; Uri url = new Uri(Constants.PathResultPage, UriKind.Relative); NavigationService.Navigate(url); } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs new file mode 100644 index 00000000..1baad1f7 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CampusAppWP8.Pages.Lecture +{ + class OptionModel + { + + public string Value { get; set; } + public string Text { get; set; } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 6d31c647..b2651d55 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -96,6 +96,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Bachelor ähnelt. + /// + public static string Degree_Bachelor { + get { + return ResourceManager.GetString("Degree_Bachelor", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Diplom ähnelt. + /// + public static string Degree_Diploma { + get { + return ResourceManager.GetString("Degree_Diploma", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Master ähnelt. + /// + public static string Degree_Master { + get { + return ResourceManager.GetString("Degree_Master", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Lehrstühle ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index 09832ae4..bf5cf8f0 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -230,7 +230,6 @@ zur Übersicht - 84 @@ -251,7 +250,7 @@ Veranstaltungsart - + Fakultät @@ -261,4 +260,13 @@ Link + + Bachelor + + + Diplom + + + Master + \ No newline at end of file From 512d367a7e705fd3d0af2b14ce29444151589fa1 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 13 Jun 2013 10:50:37 +0200 Subject: [PATCH 3/4] add docmumentation to the pages --- .../Pages/Lecture/LecturePage.xaml | 24 +-- .../Pages/Lecture/LecturePage.xaml.cs | 155 +++++++++++++----- .../Pages/Lecture/ResultPage.xaml.cs | 4 +- .../Resources/AppResources.Designer.cs | 9 + .../CampusAppWP8/Resources/AppResources.resx | 3 + 5 files changed, 133 insertions(+), 62 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index 803d8c33..9eeaf42a 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -1,5 +1,5 @@  - - - - - - - - - - - - - @@ -68,7 +54,8 @@ - + + @@ -88,6 +75,7 @@ + @@ -109,6 +97,7 @@ + @@ -149,6 +138,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 4c82f7dd..1f2cc3af 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -1,75 +1,144 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; -using CampusAppWP8.Pages.Lecture; -using CampusAppWP8.Utility; -using CampusAppWP8.Model.Lecture; -using CampusAppWP8.Resources; -using System.Collections.ObjectModel; - -namespace CampusAppWP8.Pages.lecture +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 13.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Pages.Lecture { - public partial class Lecture : PhoneApplicationPage + using System; + using System.Collections.Generic; + using System.Windows; + using System.Windows.Navigation; + using CampusAppWP8.Model.Lecture; + using CampusAppWP8.Pages.Lecture; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + using Microsoft.Phone.Controls; + + /// + /// Class for the LecturePage + /// + public partial class LecturePage : PhoneApplicationPage { /// /// actual LectureFeed /// private LectureFeed feed; + /// + /// List for the courses of the BTU + /// + /// + /// need to be extend to full list + /// private List courseList = new List() { - new OptionModel(){Text = "Architektur", Value = "013"}, - new OptionModel(){Text = "Bauingenieurwesen", Value = "017"}, - new OptionModel(){Text = "Betriebswirtschaftslehre", Value = "021"} + new OptionModel() + { + Text = "Architektur", Value = "013" + }, + new OptionModel() + { + Text = "Bauingenieurwesen", Value = "017" + }, + new OptionModel() + { + Text = "Betriebswirtschaftslehre", Value = "021" + } }; + /// + /// List of the degrees + /// private List degreeList = new List() { - new OptionModel(){Text = AppResources.Degree_Bachelor, Value = "82"}, - new OptionModel(){Text = AppResources.Degree_Master, Value = "88"}, - new OptionModel(){Text = AppResources.Degree_Diploma, Value = "11"} + new OptionModel() + { + Text = AppResources.Degree_Bachelor, Value = "82" + }, + new OptionModel() + { + Text = AppResources.Degree_Master, Value = "88" + }, + new OptionModel() + { + Text = AppResources.Degree_Diploma, Value = "11" + } }; + /// + /// List of the semester + /// private List semesterList = new List() { - new OptionModel(){Text = "SoSe 13", Value = "20131"}, - new OptionModel(){Text = "WiSe 13/14", Value = "20132"}, - new OptionModel(){Text = "SoSe 14", Value = "20141"} + new OptionModel() + { + Text = "SoSe 13", Value = "20131" + }, + new OptionModel() + { + Text = "WiSe 13/14", Value = "20132" + }, + new OptionModel() + { + Text = "SoSe 14", Value = "20141" + } }; + /// + /// List for the number of semester + /// private List numberList = new List() { - new OptionModel(){Text = "1", Value = "1"}, - new OptionModel(){Text = "2", Value = "2"}, - new OptionModel(){Text = "3", Value = "3"}, - new OptionModel(){Text = "4", Value = "4"} + new OptionModel() + { + Text = "1", Value = "1" + }, + new OptionModel() + { + Text = "2", Value = "2" + }, + new OptionModel() + { + Text = "3", Value = "3" + }, + new OptionModel() + { + Text = "4", Value = "4" + } }; - public Lecture() + /// + /// Initializes a new instance of the class. + /// + public LecturePage() { - InitializeComponent(); - setupListPickers(); + this.InitializeComponent(); + this.SetupListPickers(); } - private void setupListPickers() - { - this.Course.ItemsSource = courseList; - this.Degree.ItemsSource = degreeList; - this.From.ItemsSource = numberList; - this.To.ItemsSource = numberList; - this.Semester.ItemsSource = semesterList; - } - - private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) + /// + /// Method sets the ItemSource of the ListPickers + /// + private void SetupListPickers() { + this.Course.ItemsSource = this.courseList; + this.Degree.ItemsSource = this.degreeList; + this.From.ItemsSource = this.numberList; + this.To.ItemsSource = this.numberList; + this.Semester.ItemsSource = this.semesterList; } + /// + /// Method send a request to the Feed + /// + /// + /// have to refactors + /// + /// sender of this event + /// events arguments private void SendRequest(object sender, RoutedEventArgs e) { OptionModel semester = (OptionModel)this.Semester.SelectedItem; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index 7004f271..454b67ea 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -84,8 +84,8 @@ namespace CampusAppWP8.Pages.Lecture /// Reference of the StackPanel which include the buttons private void HideOptions(StackPanel parent) { - Button link = (Button)parent.FindName("Link"); - Button details = (Button)parent.FindName("Details"); + UIElement link = (UIElement)parent.FindName("Link"); + UIElement details = (UIElement)parent.FindName("Details"); this.HideVisibility(link); this.HideVisibility(details); } diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index b2651d55..0bbe0d75 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -222,6 +222,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Studiengangauswahl ähnelt. + /// + public static string LectureApp_ListPickerHeaderCourse { + get { + return ResourceManager.GetString("LectureApp_ListPickerHeaderCourse", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Verantwortlicher ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index bf5cf8f0..b31b365e 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -269,4 +269,7 @@ Master + + Studiengangauswahl + \ No newline at end of file From bff8eb07c80f4f5662c8ee7ceefff2e5f500f740 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 13 Jun 2013 12:11:56 +0200 Subject: [PATCH 4/4] add documention to the models --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 6 +- .../Feed/Departments/DepartmentFeed.cs | 4 +- .../CampusAppWP8/Feed/Events/EventFeed.cs | 4 +- .../CampusAppWP8/Feed/Lecture/LectureFeed.cs | 67 ++++++++++ .../CampusAppWP8/Feed/Mensa/MensaFeed.cs | 6 +- .../CampusAppWP8/Feed/News/NewsFeed.cs | 4 +- .../Model/Lecture/LectureActivity.cs | 125 ++++++++++++++---- .../Model/Lecture/LectureCourse.cs | 36 +++-- .../CampusAppWP8/Model/Lecture/LectureDate.cs | 50 ++++++- .../Model/Lecture/LectureLecturer.cs | 52 ++++++-- .../CampusAppWP8/Model/Lecture/LectureList.cs | 19 ++- .../Model/Lecture/LectureModul.cs | 70 ---------- .../Model/Lecture/LectureModule.cs | 98 ++++++++++++++ .../Model/Utility/ListPickerItemModel.cs | 25 ++++ .../Pages/Departments/DepartmentPage.xaml.cs | 1 - .../Pages/Events/EventIndexPage.xaml.cs | 3 +- .../CampusAppWP8/Pages/Lecture/LectureFeed.cs | 42 ------ .../Pages/Lecture/LecturePage.xaml.cs | 49 +++---- .../CampusAppWP8/Pages/Lecture/OptionModel.cs | 15 --- .../Pages/Lecture/ResultDetailPage.xaml.cs | 4 +- .../Pages/News/NewsIndexPage.xaml.cs | 1 + .../pages/mensa/MensaPage.xaml.cs | 3 +- 22 files changed, 454 insertions(+), 230 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Feed/Lecture/LectureFeed.cs delete mode 100644 CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs create mode 100644 CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModule.cs create mode 100644 CampusAppWP8/CampusAppWP8/Model/Utility/ListPickerItemModel.cs delete mode 100644 CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs delete mode 100644 CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index b4ed6a7b..8a52dd95 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -108,13 +108,13 @@ - + CampusMapPage.xaml - + DepartmentPage.xaml @@ -135,7 +135,7 @@ ModulWebPage.xaml - + ResultDetailPage.xaml diff --git a/CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs index 27402138..20177aad 100644 --- a/CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs @@ -17,7 +17,7 @@ namespace CampusAppWP8.Feed.Departments public System.Collections.ObjectModel.ObservableCollection _faculties { get; set; } /// - /// Method implement CheckIsModelUpToDate()-Method + /// Method implement CheckIsModelUpToDate()-Method /// /// true, if model is up-to-date, otherwise false protected override bool CheckIsModelUpToDate() @@ -26,7 +26,7 @@ namespace CampusAppWP8.Feed.Departments } /// - /// Method implement CheckIsFileUpToDate()-Method + /// Method implement CheckIsFileUpToDate()-Method /// /// true, if file is up-to-date, otherwise false protected override bool CheckIsFileUpToDate() diff --git a/CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs index 29cd3f77..d8da616c 100644 --- a/CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs @@ -21,7 +21,7 @@ namespace CampusAppWP8.Feed.Events { } /// - /// Method implement CheckIsModelUpToDate()-Method + /// Method implement CheckIsModelUpToDate()-Method /// /// true, if model is up-to-date, otherwise false protected override bool CheckIsModelUpToDate() @@ -30,7 +30,7 @@ namespace CampusAppWP8.Feed.Events } /// - /// Method implement CheckIsFileUpToDate()-Method + /// Method implement CheckIsFileUpToDate()-Method /// /// true, if file is up-to-date, otherwise false protected override bool CheckIsFileUpToDate() diff --git a/CampusAppWP8/CampusAppWP8/Feed/Lecture/LectureFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Lecture/LectureFeed.cs new file mode 100644 index 00000000..b635d51b --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Feed/Lecture/LectureFeed.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 13.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Feed.Lecture +{ + using System; + using CampusAppWP8.Model.Lecture; + using CampusAppWP8.Utility; + + /// + /// Class for the feed of the Lecture + /// + /// + /// need the XmlAPI + /// + public class LectureFeed : XmlFeed + { + /// + /// Initializes a new instance of the class. + /// + /// the RequestUrl + public LectureFeed(Uri url) + : base(url, "Lecture.xml") + { + this.validRootName = "lsf_auszug"; + } + + /// + /// Method create the RequestUrl + /// + /// + /// have to refactors + /// + /// value of the semester + /// value of the degree + /// value of the course + /// value of the from + /// value of the to + /// return the requestUrl + 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); + } + + /// + /// Method implement CheckIsModelUpToDate()-Method + /// + /// true, if model is up-to-date, otherwise false + protected override bool CheckIsModelUpToDate() + { + return false; + } + + /// + /// Method implement CheckIsFileUpToDate()-Method + /// + /// true, if file is up-to-date, otherwise false + protected override bool CheckIsFileUpToDate() + { + return false; + } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs index 565266b7..a025ba3a 100644 --- a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs @@ -5,7 +5,7 @@ // stubbfel // 03.05.2013 //---------------------------------------------------------------------- -namespace CampusAppWP8.Pages.Mensa +namespace CampusAppWP8.Feed.Mensa { using System; using System.Collections.ObjectModel; @@ -34,7 +34,7 @@ namespace CampusAppWP8.Pages.Mensa #region Protected /// - /// Method implement CheckIsModelUpToDate()-Method + /// Method implement CheckIsModelUpToDate()-Method /// /// true, if model is up-to-date, otherwise false protected override bool CheckIsModelUpToDate() @@ -44,7 +44,7 @@ namespace CampusAppWP8.Pages.Mensa } /// - /// Method implement CheckIsFileUpToDate()-Method + /// Method implement CheckIsFileUpToDate()-Method /// /// true, if file is up-to-date, otherwise false protected override bool CheckIsFileUpToDate() diff --git a/CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs index f74e989c..a702ebc0 100644 --- a/CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs @@ -22,7 +22,7 @@ namespace CampusAppWP8.Feed.News } /// - /// Method implement CheckIsModelUpToDate()-Method + /// Method implement CheckIsModelUpToDate()-Method /// /// true, if model is up-to-date, otherwise false protected override bool CheckIsModelUpToDate() @@ -31,7 +31,7 @@ namespace CampusAppWP8.Feed.News } /// - /// Method implement CheckIsFileUpToDate()-Method + /// Method implement CheckIsFileUpToDate()-Method /// /// true, if file is up-to-date, otherwise false protected override bool CheckIsFileUpToDate() diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs index 3c178b2d..d41946f4 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs @@ -1,26 +1,48 @@ -using CampusAppWP8.Utility; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Serialization; - +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 13.06.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { + using System.Collections.ObjectModel; + using System.Xml.Serialization; + using CampusAppWP8.Utility; + + /// + /// Model for a Activity + /// public class LectureActivity { - #region + #region Members + + /// + /// List of lecturer + /// private ObservableCollection lecturer; + + /// + /// a formatted string for the names of the lecturers + /// private string lecturerString; + + /// + /// a formatted string for the names of the courses + /// private string courseString; + + /// + /// a formatted string for the topic of the lecture + /// private string topic; + #endregion #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public LectureActivity() { @@ -30,41 +52,66 @@ namespace CampusAppWP8.Model.Lecture #region Proberty + /// + /// Gets or sets the type of the activity + /// [XmlElement("art")] public string Type { get; set; } + /// + /// Gets or sets the id of the activity + /// [XmlAttribute("id")] public int Id { get; set; } + /// + /// Gets or sets semester of the activity + /// [XmlElement("semester")] public int Semester { get; set; } + /// + /// Gets or sets the contact hour + /// [XmlElement("sws")] public string SWS { get; set; } + /// + /// Gets or sets LectureModule + /// [XmlElement("modul")] - public LectureModul Modul { get; set; } + public LectureModule Modul { get; set; } + /// + /// Gets or sets the lecturers + /// [XmlElement("lehrperson")] - public ObservableCollection Lecturer { + public ObservableCollection Lecturer + { get { - return lecturer; + return this.lecturer; } + set { - if (value != lecturer) + if (value != this.lecturer) { - lecturer = value; + this.lecturer = value; } } } - public string LecturerString { + /// + /// Gets or sets the formatted string of the lecturers + /// + public string LecturerString + { get { return this.lecturerString; } + set { if (value != this.lecturerString) @@ -74,12 +121,16 @@ namespace CampusAppWP8.Model.Lecture } } + /// + /// Gets or sets formatted string of the courses + /// public string CourseString { get { return this.courseString; } + set { if (value != this.courseString) @@ -88,53 +139,77 @@ namespace CampusAppWP8.Model.Lecture } } } - + /// + /// Gets or sets the courses + /// [XmlElement("studiengang")] public ObservableCollection Course { get; set; } + /// + /// Gets or sets the dates of the activity + /// [XmlElement("termin")] public ObservableCollection Dates { get; set; } + /// + /// Gets or sets the Department + /// [XmlElement("zugeordnete_einrichtung")] public string Department { get; set; } + /// + /// Gets or sets the topic of the Lecture + /// [XmlElement("lehrinhalt")] public string Topic { get { - return topic; + return this.topic; } + set { - if (value != topic) + if (value != this.topic) { - topic = StringManager.StripHTML(value); + this.topic = StringManager.StripHTML(value); } } } #endregion - public void createLectureString() + #region Methods + + /// + /// Method create a formatted string of the LecturerList + /// + public void CreateLectureString() { string result = string.Empty; - foreach (LectureLecturer tmpLecturer in Lecturer) + foreach (LectureLecturer tmpLecturer in this.Lecturer) { result += tmpLecturer.ToString() + "\n"; } + this.LecturerString = result.TrimEnd('\n'); } - public void createCourseString() + /// + /// Method create a formatted string of the CourseList + /// + public void CreateCourseString() { string result = string.Empty; - foreach (LectureCourse course in Course) + foreach (LectureCourse course in this.Course) { result += course.Title + "\n"; } + this.CourseString = result.TrimEnd('\n'); } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs index 30018c7e..03d40bf4 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs @@ -1,17 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Serialization; - +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { - public class LectureCourse + using System.Xml.Serialization; + + /// + /// Model for a course + /// + public class LectureCourse { - public LectureCourse() - { - } - [XmlElement("bezeichnung")] - public string Title {get;set;} + /// + /// Initializes a new instance of the class. + /// + public LectureCourse() + { + } + + /// + /// Gets or sets the title of the course + /// + [XmlElement("bezeichnung")] + public string Title { get; set; } } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs index 9e802558..b84ef789 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs @@ -1,29 +1,65 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Serialization; - +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { + using System.Xml.Serialization; + + /// + /// Model for the date of an activity + /// public class LectureDate { + /// + /// Initializes a new instance of the class. + /// public LectureDate() { } + /// + /// Gets or sets WeekDay + /// [XmlElement("wochentag")] public string WeekDay { get; set; } + + /// + /// Gets or sets From + /// [XmlElement("von")] public string From { get; set; } + + /// + /// Gets or sets To + /// [XmlElement("bis")] public string To { get; set; } + + /// + /// Gets or sets Interval + /// [XmlElement("rhythmus")] public string Interval { get; set; } + + /// + /// Gets or sets Room + /// [XmlElement("raum")] public string Room { get; set; } + + /// + /// Gets or sets StartDate + /// [XmlElement("anfangsdatum")] - public string StarDate { get; set; } + public string StartDate { get; set; } + + /// + /// Gets or sets EndDate + /// [XmlElement("enddatum")] public string EndDate { get; set; } diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs index c0cc8b42..1e2d92e5 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs @@ -1,45 +1,71 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Serialization; - +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { + using System.Xml.Serialization; + + /// + /// Model for a lecturer + /// public class LectureLecturer { + /// + /// Initializes a new instance of the class. + /// public LectureLecturer() { } + /// + /// Gets or sets the FirstName of a lecturer + /// [XmlElement("vorname")] public string FirstName { get; set; } + /// + /// Gets or sets the LastName of a lecturer + /// [XmlElement("name")] public string LastName { get; set; } + /// + /// Gets or sets the title of a lecturer + /// [XmlElement("titel")] public string Title { get; set; } + /// + /// Gets or sets the Responsibility of a lecturer + /// [XmlAttribute("zustaendigkeit")] public string Responsibility { get; set; } + /// + /// Method overrides the base ToString() and create an formatted string of the lecturer + /// + /// returns a string like: [Title] FirstName LastName [(Responsibility)] public override string ToString() { string result = string.Empty; - - if (!Title.Equals(string.Empty)) + + if (!this.Title.Equals(string.Empty)) { - result += Title + " "; + result += this.Title + " "; } - result += FirstName + " "; - result += LastName + " "; + result += this.FirstName + " "; + result += this.LastName + " "; - if (!Responsibility.Equals(string.Empty)) + if (!this.Responsibility.Equals(string.Empty)) { - result += "(" + Responsibility + ") "; + result += "(" + this.Responsibility + ") "; } + return result; } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs index 6dff6569..39ede37a 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs @@ -7,15 +7,16 @@ //---------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { - using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Xml.Serialization; using System.Linq; + using System.Xml.Serialization; + /// + /// Model for a List of LectureActivity + /// [XmlRoot("lsf_auszug")] public class LectureList { - #region Constructor /// @@ -29,6 +30,9 @@ namespace CampusAppWP8.Model.Lecture #region Proberty + /// + /// Gets or sets List of the activities + /// [XmlArray("veranstaltungsliste")] [XmlArrayItem("veranstaltung")] public ObservableCollection Activities { get; set; } @@ -37,12 +41,17 @@ namespace CampusAppWP8.Model.Lecture #region Methods + /// + /// Method return a certain activity + /// + /// id of the activity + /// the activity (FirstOrDefault) public LectureActivity GetActivity(int id) { - LectureActivity activity = Activities.Where(p => p.Id == id).First(); + LectureActivity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault(); return activity; } - #endregion + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs deleted file mode 100644 index 883f763f..00000000 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs +++ /dev/null @@ -1,70 +0,0 @@ -//----------------------------------------------------------------------- -// -// Company copyright tag. -// -// stubbfel -// 10.06.2013 -//---------------------------------------------------------------------- -namespace CampusAppWP8.Model.Lecture -{ - using CampusAppWP8.Resources; - using System; - using System.Xml.Serialization; - public class LectureModul - { - #region Members - - private int number; - - private Uri url; - - #endregion - - #region Constructor - - public LectureModul() - { - } - - #endregion - - #region Property - - [XmlElement("titel")] - public string Title {get; set;} - - [XmlElement("nummer")] - public int Number{ - get - { - return this.number; - } - set - { - if (value != this.number) - { - this.number = value; - this.createUrl(); - } - } - } - - public Uri Url{ - get - { - return url; - } - } - - #endregion - - #region Methods - - private void createUrl() - { - this.url = new Uri(Constants.UrlLectureModulBaseAddr + number.ToString()); - } - - #endregion - } -} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModule.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModule.cs new file mode 100644 index 00000000..076407b5 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModule.cs @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Lecture +{ + using System; + using System.Xml.Serialization; + using CampusAppWP8.Resources; + + /// + /// Model for the module of an lecture + /// + public class LectureModule + { + #region Members + + /// + /// Number of the module (like an id) + /// + private int number; + + /// + /// Url to the website of the module + /// + private Uri url; + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public LectureModule() + { + } + + #endregion + + #region Property + + /// + /// Gets or sets the title of the module + /// + [XmlElement("titel")] + public string Title { get; set; } + + /// + /// Gets or sets the number of the module and create the URL + /// + [XmlElement("nummer")] + public int Number + { + get + { + return this.number; + } + + set + { + if (value != this.number) + { + this.number = value; + this.CreateUrl(); + } + } + } + + /// + /// Gets the URL of the module + /// + public Uri Url + { + get + { + return this.url; + } + } + + #endregion + + #region Methods + + /// + /// Method create the url of the module + /// + private void CreateUrl() + { + this.url = new Uri(Constants.UrlLectureModulBaseAddr + this.number.ToString()); + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Utility/ListPickerItemModel.cs b/CampusAppWP8/CampusAppWP8/Model/Utility/ListPickerItemModel.cs new file mode 100644 index 00000000..f5e6cba8 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Utility/ListPickerItemModel.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 13.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Utility +{ + /// + /// Model for the ListPickerItems + /// + public class ListPickerItemModel + { + /// + /// Gets or sets the Value of an Item + /// + public string Value { get; set; } + + /// + /// Gets or sets the Text (caption) of an Item + /// + public string Text { get; set; } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs index 2d71e3cd..ed8de0cf 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs @@ -1,5 +1,4 @@ using CampusAppWP8.Feed.Departments; -using CampusAppWP8.Pages.Departments; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; using Microsoft.Phone.Tasks; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs index 4d3538e3..3da6312e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs @@ -1,4 +1,4 @@ -using CampusAppWP8.Feed.Events; +using CampusAppWP8.Pages.Events; using CampusAppWP8.Model.events_news; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; @@ -9,6 +9,7 @@ using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; +using CampusAppWP8.Feed.Events; namespace CampusAppWP8.Pages.Events { diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs deleted file mode 100644 index 272966c9..00000000 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CampusAppWP8.Model.Lecture; -using CampusAppWP8.Utility; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace CampusAppWP8.Pages.Lecture -{ - public class LectureFeed : XmlFeed - { - public LectureFeed(Uri url) - : base(url, "Lecture.xml") - { - this.validRootName = "lsf_auszug"; - } - - /// - /// Method implement CheckIsModelUpToDate()-Method - /// - /// true, if model is up-to-date, otherwise false - protected override bool CheckIsModelUpToDate() - { - return false; - } - - /// - /// Method implement CheckIsFileUpToDate()-Method - /// - /// true, if file is up-to-date, otherwise false - protected override bool CheckIsFileUpToDate() - { - 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.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 1f2cc3af..f88b2de0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -11,8 +11,9 @@ namespace CampusAppWP8.Pages.Lecture using System.Collections.Generic; using System.Windows; using System.Windows.Navigation; + using CampusAppWP8.Feed.Lecture; using CampusAppWP8.Model.Lecture; - using CampusAppWP8.Pages.Lecture; + using CampusAppWP8.Model.Utility; using CampusAppWP8.Resources; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; @@ -33,17 +34,17 @@ namespace CampusAppWP8.Pages.Lecture /// /// need to be extend to full list /// - private List courseList = new List() + private List courseList = new List() { - new OptionModel() + new ListPickerItemModel() { Text = "Architektur", Value = "013" }, - new OptionModel() + new ListPickerItemModel() { Text = "Bauingenieurwesen", Value = "017" }, - new OptionModel() + new ListPickerItemModel() { Text = "Betriebswirtschaftslehre", Value = "021" } @@ -52,17 +53,17 @@ namespace CampusAppWP8.Pages.Lecture /// /// List of the degrees /// - private List degreeList = new List() + private List degreeList = new List() { - new OptionModel() + new ListPickerItemModel() { Text = AppResources.Degree_Bachelor, Value = "82" }, - new OptionModel() + new ListPickerItemModel() { Text = AppResources.Degree_Master, Value = "88" }, - new OptionModel() + new ListPickerItemModel() { Text = AppResources.Degree_Diploma, Value = "11" } @@ -71,17 +72,17 @@ namespace CampusAppWP8.Pages.Lecture /// /// List of the semester /// - private List semesterList = new List() + private List semesterList = new List() { - new OptionModel() + new ListPickerItemModel() { Text = "SoSe 13", Value = "20131" }, - new OptionModel() + new ListPickerItemModel() { Text = "WiSe 13/14", Value = "20132" }, - new OptionModel() + new ListPickerItemModel() { Text = "SoSe 14", Value = "20141" } @@ -90,21 +91,21 @@ namespace CampusAppWP8.Pages.Lecture /// /// List for the number of semester /// - private List numberList = new List() + private List numberList = new List() { - new OptionModel() + new ListPickerItemModel() { Text = "1", Value = "1" }, - new OptionModel() + new ListPickerItemModel() { Text = "2", Value = "2" }, - new OptionModel() + new ListPickerItemModel() { Text = "3", Value = "3" }, - new OptionModel() + new ListPickerItemModel() { Text = "4", Value = "4" } @@ -141,12 +142,12 @@ namespace CampusAppWP8.Pages.Lecture /// events arguments private void SendRequest(object sender, RoutedEventArgs e) { - OptionModel semester = (OptionModel)this.Semester.SelectedItem; - OptionModel degree = (OptionModel)this.Degree.SelectedItem; - OptionModel course = (OptionModel)this.Course.SelectedItem; - OptionModel from = (OptionModel)this.From.SelectedItem; - OptionModel to = (OptionModel)this.To.SelectedItem; - Uri request = LectureFeed.createFeedUrl(semester.Value, degree.Value, course.Value, from.Value, to.Value); + ListPickerItemModel semester = (ListPickerItemModel)this.Semester.SelectedItem; + ListPickerItemModel degree = (ListPickerItemModel)this.Degree.SelectedItem; + ListPickerItemModel course = (ListPickerItemModel)this.Course.SelectedItem; + ListPickerItemModel from = (ListPickerItemModel)this.From.SelectedItem; + ListPickerItemModel to = (ListPickerItemModel)this.To.SelectedItem; + Uri request = LectureFeed.CreateFeedUrl(semester.Value, degree.Value, course.Value, from.Value, to.Value); this.feed = new LectureFeed(request); this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady); this.ProgressBar.Visibility = System.Windows.Visibility.Visible; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs deleted file mode 100644 index 1baad1f7..00000000 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/OptionModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace CampusAppWP8.Pages.Lecture -{ - class OptionModel - { - - public string Value { get; set; } - public string Text { get; set; } - } -} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs index 6a404776..ad54ee75 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs @@ -50,8 +50,8 @@ namespace CampusAppWP8.Pages.Lecture if (list != null) { LectureActivity activity = list.GetActivity(activityId); - activity.createLectureString(); - activity.createCourseString(); + activity.CreateLectureString(); + activity.CreateCourseString(); this.ContentPanel.DataContext = activity; } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs index fa1b8840..69215c09 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs @@ -12,6 +12,7 @@ using CampusAppWP8.Model.events_news; using CampusAppWP8.Utility; using CampusAppWP8.Resources; using System.Collections.ObjectModel; +using CampusAppWP8.Pages.News; using CampusAppWP8.Feed.News; namespace CampusAppWP8.Pages.News diff --git a/CampusAppWP8/CampusAppWP8/pages/mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/pages/mensa/MensaPage.xaml.cs index 5723b4b0..5aad45a1 100644 --- a/CampusAppWP8/CampusAppWP8/pages/mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/pages/mensa/MensaPage.xaml.cs @@ -9,8 +9,9 @@ namespace CampusAppWP8.Pages.Mensa { using System; using System.Windows.Navigation; + using CampusAppWP8.Feed.Mensa; using CampusAppWP8.Utility; - using Microsoft.Phone.Controls; + using Microsoft.Phone.Controls; /// /// Class for the MensaPage