diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index f7fc8dd5..18af7adc 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -125,6 +125,9 @@
ModulWebPage.xaml
+
+ ResultDetailPage.xaml
+
ResultPage.xaml
@@ -186,6 +189,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
index 8bf99472..3c178b2d 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
@@ -1,4 +1,5 @@
-using System;
+using CampusAppWP8.Utility;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
@@ -10,6 +11,12 @@ namespace CampusAppWP8.Model.Lecture
{
public class LectureActivity
{
+ #region
+ private ObservableCollection lecturer;
+ private string lecturerString;
+ private string courseString;
+ private string topic;
+ #endregion
#region Constructor
///
@@ -24,7 +31,10 @@ namespace CampusAppWP8.Model.Lecture
#region Proberty
[XmlElement("art")]
- public string Type{ get; set; }
+ public string Type { get; set; }
+
+ [XmlAttribute("id")]
+ public int Id { get; set; }
[XmlElement("semester")]
public int Semester { get; set; }
@@ -36,7 +46,49 @@ namespace CampusAppWP8.Model.Lecture
public LectureModul Modul { get; set; }
[XmlElement("lehrperson")]
- public ObservableCollection Lecturer { get; set; }
+ public ObservableCollection Lecturer {
+ get
+ {
+ return lecturer;
+ }
+ set
+ {
+ if (value != lecturer)
+ {
+ lecturer = value;
+ }
+ }
+ }
+
+ public string LecturerString {
+ get
+ {
+ return this.lecturerString;
+ }
+ set
+ {
+ if (value != this.lecturerString)
+ {
+ this.lecturerString = value;
+ }
+ }
+ }
+
+ public string CourseString
+ {
+ get
+ {
+ return this.courseString;
+ }
+ set
+ {
+ if (value != this.courseString)
+ {
+ this.courseString = value;
+ }
+ }
+ }
+
[XmlElement("studiengang")]
public ObservableCollection Course { get; set; }
@@ -44,6 +96,45 @@ namespace CampusAppWP8.Model.Lecture
[XmlElement("termin")]
public ObservableCollection Dates { get; set; }
+ [XmlElement("zugeordnete_einrichtung")]
+ public string Department { get; set; }
+
+ [XmlElement("lehrinhalt")]
+ public string Topic
+ {
+ get
+ {
+ return topic;
+ }
+ set
+ {
+ if (value != topic)
+ {
+ topic = StringManager.StripHTML(value);
+ }
+ }
+ }
+
#endregion
+
+ public void createLectureString()
+ {
+ string result = string.Empty;
+ foreach (LectureLecturer tmpLecturer in Lecturer)
+ {
+ result += tmpLecturer.ToString() + "\n";
+ }
+ this.LecturerString = result.TrimEnd('\n');
+ }
+
+ public void createCourseString()
+ {
+ string result = string.Empty;
+ foreach (LectureCourse course in Course)
+ {
+ result += course.Title + "\n";
+ }
+ this.CourseString = result.TrimEnd('\n');
+ }
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs
index 04990c7f..c0cc8b42 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs
@@ -23,5 +23,24 @@ namespace CampusAppWP8.Model.Lecture
[XmlAttribute("zustaendigkeit")]
public string Responsibility { get; set; }
+
+ public override string ToString()
+ {
+ string result = string.Empty;
+
+ if (!Title.Equals(string.Empty))
+ {
+ result += Title + " ";
+ }
+
+ result += FirstName + " ";
+ result += LastName + " ";
+
+ if (!Responsibility.Equals(string.Empty))
+ {
+ result += "(" + Responsibility + ") ";
+ }
+ return result;
+ }
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs
index 167d9457..6dff6569 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs
@@ -7,8 +7,11 @@
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
{
+ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
+ using System.Linq;
+
[XmlRoot("lsf_auszug")]
public class LectureList
{
@@ -32,5 +35,14 @@ namespace CampusAppWP8.Model.Lecture
#endregion
+ #region Methods
+
+ public LectureActivity GetActivity(int id)
+ {
+ LectureActivity activity = Activities.Where(p => p.Id == id).First();
+ return activity;
+ }
+ #endregion
+
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml
index f52dd8f2..607d04b8 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml
@@ -24,5 +24,4 @@
-
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs
index dc55b355..989f0b51 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs
@@ -1,32 +1,42 @@
-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 System.Threading.Tasks;
-
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 11.06.2013
+//----------------------------------------------------------------------
namespace CampusAppWP8.Pages.Lecture
{
+ using System;
+ using System.Windows.Navigation;
+ using CampusAppWP8.Resources;
+ using Microsoft.Phone.Controls;
+
+ ///
+ /// Class for the page which shows Webpages from the BaseAddress
+ ///
public partial class ModulWebPage : PhoneApplicationPage
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
public ModulWebPage()
{
- InitializeComponent();
+ this.InitializeComponent();
}
+ ///
+ /// Override the OnNavigatedTo method
+ ///
+ /// Arguments of navigation
protected override void OnNavigatedTo(NavigationEventArgs e)
{
-
- if (NavigationContext.QueryString.ContainsKey("URL"))
+ if (NavigationContext.QueryString.ContainsKey(Constants.ParamLectureModulNumber))
{
- string url = NavigationContext.QueryString["URL"];
-
- this.WebmailBrowser.Navigate(new Uri(url, UriKind.Absolute));
+ string number = NavigationContext.QueryString[Constants.ParamLectureModulNumber];
+ this.WebmailBrowser.Navigate(new Uri(Constants.UrlLectureModulBaseAddr + number, UriKind.Absolute));
}
+
base.OnNavigatedTo(e);
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
new file mode 100644
index 00000000..b504341b
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs
new file mode 100644
index 00000000..6a404776
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs
@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 11.06.2013
+//----------------------------------------------------------------------
+namespace CampusAppWP8.Pages.Lecture
+{
+ using System.Windows.Navigation;
+ using CampusAppWP8.Model.Lecture;
+ using CampusAppWP8.Resources;
+ using Microsoft.Phone.Controls;
+
+ ///
+ /// Class for the page which shows details of an activity
+ ///
+ public partial class ResultDetailPage : PhoneApplicationPage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ResultDetailPage()
+ {
+ this.InitializeComponent();
+ }
+
+ ///
+ /// Override the OnNavigatedTo method
+ ///
+ /// Arguments of navigation
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ if (NavigationContext.QueryString.ContainsKey(Constants.ParamLectureActivityId))
+ {
+ string activityId = NavigationContext.QueryString[Constants.ParamLectureActivityId];
+ this.LoadActivity(int.Parse(activityId));
+ }
+
+ base.OnNavigatedTo(e);
+ }
+
+ ///
+ /// Method load a certain Activity from the model
+ ///
+ /// id of the activity
+ private void LoadActivity(int activityId)
+ {
+ LectureList list = App.LoadFromIsolatedStorage(Constants.IsolatedStorageLectureModel);
+ if (list != null)
+ {
+ LectureActivity activity = list.GetActivity(activityId);
+ activity.createLectureString();
+ activity.createCourseString();
+ this.ContentPanel.DataContext = activity;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
index f75742c6..a836dfba 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
@@ -32,8 +32,8 @@
-
-
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
index b2c0f4f8..22bce8b3 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
@@ -8,6 +8,9 @@ using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using CampusAppWP8.Utility;
+using CampusAppWP8.Resources;
+using System.IO.IsolatedStorage;
+using CampusAppWP8.Model.Lecture;
namespace CampusAppWP8.Pages.Lecture
{
@@ -28,6 +31,7 @@ namespace CampusAppWP8.Pages.Lecture
private void FeedIsReady()
{
ResultList.ItemsSource = feed.Model.Activities;
+ App.SaveToIsolatedStorage("LectureModel", feed.Model);
}
private void ShowOptions(object sender, RoutedEventArgs e)
@@ -55,10 +59,14 @@ namespace CampusAppWP8.Pages.Lecture
private void ShowModulWebPage(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
- NavigationService.Navigate(new Uri("/Pages/Lecture/ModulWebPage.xaml?URL="+btn.Tag, UriKind.Relative));
+ Uri url = new Uri(Constants.PathLectureModulWebPage + Constants.Paramseparator + Constants.ParamLectureModulNumber + "=" + btn.Tag, UriKind.Relative);
+ NavigationService.Navigate(url);
}
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);
+ NavigationService.Navigate(url);
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
index e5345b13..446254fd 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
@@ -177,6 +177,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Vorlesungen - Details ähnelt.
+ ///
+ public static string LectureDetails_Header {
+ get {
+ return ResourceManager.GetString("LectureDetails_Header", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Links ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
index 9ce3f841..b94f04e0 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
@@ -233,4 +233,7 @@
84
+
+ Vorlesungen - Details
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
index a4b83da5..5a0a3efd 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
@@ -60,6 +60,78 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt.
+ ///
+ internal static string IsolatedStorageLectureModel {
+ get {
+ return ResourceManager.GetString("IsolatedStorageLectureModel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die ActivityId ähnelt.
+ ///
+ internal static string ParamLectureActivityId {
+ get {
+ return ResourceManager.GetString("ParamLectureActivityId", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die ModulNumber ähnelt.
+ ///
+ internal static string ParamLectureModulNumber {
+ get {
+ return ResourceManager.GetString("ParamLectureModulNumber", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die ? ähnelt.
+ ///
+ internal static string Paramseparator {
+ get {
+ return ResourceManager.GetString("Paramseparator", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt.
+ ///
+ internal static string ParamUrl {
+ get {
+ return ResourceManager.GetString("ParamUrl", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ModulWebPage.xaml ähnelt.
+ ///
+ internal static string PathLectureModulWebPage {
+ get {
+ return ResourceManager.GetString("PathLectureModulWebPage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultDetailPage.xaml ähnelt.
+ ///
+ internal static string PathResultDetailWebPage {
+ get {
+ return ResourceManager.GetString("PathResultDetailWebPage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt.
+ ///
+ internal static string UrlLectureModulBaseAddr {
+ get {
+ return ResourceManager.GetString("UrlLectureModulBaseAddr", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die root ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
index 8039a024..157d81a4 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
@@ -117,6 +117,30 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ LectureModel
+
+
+ ActivityId
+
+
+ ModulNumber
+
+
+ ?
+
+
+ Url
+
+
+ /Pages/Lecture/ModulWebPage.xaml
+
+
+ /Pages/Lecture/ResultDetailPage.xaml
+
+
+ https://www.tu-cottbus.de/modul/
+
root