diff --git a/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj b/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj
index ac3271f3..d039f9d6 100644
--- a/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj
+++ b/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj
@@ -9,8 +9,9 @@
Properties
CampusAppDLL
CampusAppDLL
- v4.5
+ v4.0
512
+ Client
true
diff --git a/CampusAppWP8/CampusAppW8.sln b/CampusAppWP8/CampusAppW8.sln
index 8403729e..f65bd6ee 100644
--- a/CampusAppWP8/CampusAppW8.sln
+++ b/CampusAppWP8/CampusAppW8.sln
@@ -33,9 +33,9 @@ Global
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.ActiveCfg = Debug|ARM
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.Build.0 = Debug|ARM
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.Deploy.0 = Debug|ARM
- {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
+ {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.ActiveCfg = Debug|x86
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.Build.0 = Debug|x86
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.Deploy.0 = Debug|x86
@@ -65,9 +65,9 @@ Global
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.ActiveCfg = Debug|ARM
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.Build.0 = Debug|ARM
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.Deploy.0 = Debug|ARM
- {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
+ {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.ActiveCfg = Debug|x86
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.Build.0 = Debug|x86
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.Deploy.0 = Debug|x86
diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs
index 3502c684..b6a1eeaf 100644
--- a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs
+++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs
@@ -5,16 +5,12 @@
// stubbfel
// 12.08.2013
//----------------------------------------------------------------------
-namespace CampusAppWP8.Feed.GeoApi
+namespace CampusAppWP8.Api.GeoApi
{
using System;
- using System.Collections.Generic;
- using CampusAppWP8.Model;
using CampusAppWP8.Model.GeoDb;
- using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
- using CampusAppWP8.Utility;
- using System.Device.Location;
+ using CampusAppWP8.Utility;
///
/// Class for SPSAPI
diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs
index 7972517f..3bef6f90 100644
--- a/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs
+++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs
@@ -5,7 +5,7 @@
// stubbfel
// 06.08.2013
//----------------------------------------------------------------------
-namespace CampusAppWP8.Feed.GeoApi
+namespace CampusAppWP8.Api.GeoApi
{
using System;
using System.Collections.Generic;
diff --git a/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs b/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs
index da60d1a9..96ce98a2 100644
--- a/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs
+++ b/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs
@@ -5,7 +5,7 @@
// stubbfel
// 13.06.2013
//----------------------------------------------------------------------
-namespace CampusAppWP8.Feed.Lecture
+namespace CampusAppWP8.Api.Lecture
{
using CampusAppWP8.Model;
using CampusAppWP8.Model.Lecture;
diff --git a/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
new file mode 100644
index 00000000..fbc838e7
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
@@ -0,0 +1,27 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 05.09.2013
+//-----------------------------------------------------------------------------
+
+namespace CampusAppWP8.Api.Person
+{
+ using CampusAppWP8.Model;
+ using CampusAppWP8.Model.Person;
+ using CampusAppWP8.Resources;
+
+ /// Person search api.
+ /// Stubbfel, 05.09.2013.
+ public class PersonSearchApi : XmlModel
+ {
+ /// Initializes a new instance of the PersonSearchApi class.
+ /// Stubbfel, 05.09.2013.
+ public PersonSearchApi()
+ : base(ModelType.Feed, Constants.UrlPerson_PersonSearchByName)
+ {
+ this.ValidRootName = Constants.PersonListValidRootName;
+ }
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index d3a8f03c..a6d11552 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -95,6 +95,7 @@
+
App.xaml
@@ -119,6 +120,7 @@
+
@@ -132,6 +134,7 @@
PersonPage.xaml
+
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
index 6e558548..147fbc5d 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
@@ -1,24 +1,42 @@
-using CampusAppWP8.Resources;
-using CampusAppWP8.Utility;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Xml.Serialization;
-
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 05.09.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
{
+ using System.Xml.Serialization;
+ using CampusAppWP8.Utility;
+
+ /// Person function model.
+ /// Stubbfel, 05.09.2013.
public class PersonFunctionModel
{
+ /// The first tel.
private string tel1;
+ /// The second tel.
private string tel2;
+ /// The fax.
private string fax;
+ /// The mail.
private string mail;
+ /// The function.
+ private string function;
+
+ /// The appointment.
+ private string appointment;
+
+ /// The building.
+ private string building;
+
+ /// Gets or sets the tel 1.
+ /// The tel 1.
[XmlAttribute("telefon")]
public string Tel1
{
@@ -26,15 +44,18 @@ namespace CampusAppWP8.Model.Person
{
return this.tel1;
}
+
set
{
- if (value != null && value != this.tel1)
+ if (value != null && value != string.Empty && value != this.tel1)
{
this.tel1 = StringManager.CreateUniTelefonNumber(value);
}
}
}
+ /// Gets or sets the tel 2.
+ /// The tel 2.
[XmlAttribute("telefon2")]
public string Tel2
{
@@ -42,15 +63,18 @@ namespace CampusAppWP8.Model.Person
{
return this.tel2;
}
+
set
{
- if (value != null && value != this.tel2)
+ if (value != null && value != string.Empty && value != this.tel2)
{
this.tel2 = StringManager.CreateUniTelefonNumber(value);
}
}
}
+ /// Gets or sets the fax.
+ /// The fax.
[XmlAttribute("fax")]
public string Fax
{
@@ -58,24 +82,75 @@ namespace CampusAppWP8.Model.Person
{
return this.fax;
}
+
set
{
- if (value != null && value != this.fax)
+ if (value != null && value != string.Empty && value != this.fax)
{
this.fax = StringManager.CreateUniTelefonNumber(value);
}
}
}
+ /// Gets or sets the function.
+ /// The function.
[XmlAttribute("funktion")]
- public string Function { get; set; }
+ public string Function
+ {
+ get
+ {
+ return this.function;
+ }
+ set
+ {
+ if (value != this.function)
+ {
+ this.function = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the appointment.
+ /// The appointment.
[XmlAttribute("einrichtung")]
- public string Appointment { get; set; }
+ public string Appointment
+ {
+ get
+ {
+ return this.appointment;
+ }
+ set
+ {
+ if (value != this.appointment)
+ {
+ this.appointment = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the building.
+ /// The building.
[XmlAttribute("gebaeude")]
- public string Building { get; set; }
+ public string Building
+ {
+ get
+ {
+ return this.building;
+ }
+ set
+ {
+ if (value != this.building)
+ {
+ this.building = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the mail.
+ /// The mail.
[XmlAttribute("mail")]
public string Mail
{
@@ -83,6 +158,7 @@ namespace CampusAppWP8.Model.Person
{
return this.mail;
}
+
set
{
if (value != null && value != this.mail && StringManager.IsValidEmail(value))
@@ -92,6 +168,12 @@ namespace CampusAppWP8.Model.Person
}
}
-
+ /// Gets or sets the identifier of the person.
+ /// The identifier of the person.
+ public string PersonID { get; set; }
+
+ /// Gets or sets zero-based index of the function.
+ /// The function index.
+ public int FunctionIndex { get; set; }
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
new file mode 100644
index 00000000..0182d9ce
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
@@ -0,0 +1,79 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 05.09.2013
+//-----------------------------------------------------------------------------
+
+namespace CampusAppWP8.Model.Person
+{
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Xml.Serialization;
+
+ /// Person list model.
+ /// Stubbfel, 05.09.2013.
+ [XmlRoot("Uebersicht")]
+ public class PersonListModel
+ {
+ /// Gets or sets the persons.
+ /// The persons.
+ [XmlElement("person")]
+ public ObservableCollection Persons { get; set; }
+
+ /// Sets person identifier to function.
+ /// Stubbfel, 05.09.2013.
+ public void SetPersonIdToFunction()
+ {
+ foreach (PersonModel person in this.Persons)
+ {
+ person.SetPersonIdToFunction();
+ }
+ }
+
+ /// Gets a person.
+ /// Stubbfel, 05.09.2013.
+ /// The identifier.
+ /// The person.
+ public PersonModel GetPerson(string id)
+ {
+ foreach (PersonModel tmpPerson in this.Persons)
+ {
+ if (tmpPerson.ID.Equals(id))
+ {
+ return tmpPerson;
+ }
+ }
+
+ return null;
+ }
+
+ /// Removes the non function and set identifiers person.
+ /// Stubbfel, 05.09.2013.
+ public void RemoveNonFunctionAndSetIdsPerson()
+ {
+ this.RemoveNonFunctionPerson();
+ this.SetPersonIdToFunction();
+ }
+
+ /// Removes the non function person.
+ /// Stubbfel, 05.09.2013.
+ public void RemoveNonFunctionPerson()
+ {
+ List removeList = new List();
+ foreach (PersonModel tmpPerson in this.Persons)
+ {
+ if (tmpPerson.Functions.Count < 1)
+ {
+ removeList.Add(tmpPerson);
+ }
+ }
+
+ foreach (PersonModel removePerson in removeList)
+ {
+ this.Persons.Remove(removePerson);
+ }
+ }
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
index e5cc4d8d..a8b51572 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
@@ -1,28 +1,157 @@
-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
+// 05.09.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
{
+ using System.Collections.ObjectModel;
+ using System.Xml.Serialization;
+ using CampusAppWP8.Utility;
+
+ /// Person model.
+ /// Stubbfel, 05.09.2013.
public class PersonModel
{
+ /// The akadgrad.
+ private string akadgrad;
+
+ /// Name of the sur.
+ private string surName;
+
+ /// The person's first name.
+ private string firstName;
+
+ /// The identifier.
+ private string id;
+
+ /// The functions.
+ private ObservableCollection functions;
+
+ /// Gets or sets the identifier.
+ /// The identifier.
[XmlAttribute("id")]
- public string ID {get; set;}
+ public string ID
+ {
+ get
+ {
+ return this.id;
+ }
+ set
+ {
+ if (value != this.id)
+ {
+ this.id = value;
+ this.SetPersonIdToFunction();
+ }
+ }
+ }
+
+ /// Gets or sets the akadgrad.
+ /// The akadgrad.
[XmlAttribute("akadgrad")]
- public string Akadgrad { get; set; }
+ public string Akadgrad
+ {
+ get
+ {
+ return this.akadgrad;
+ }
+ set
+ {
+ if (value != this.akadgrad)
+ {
+ this.akadgrad = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the name of the sur.
+ /// The name of the sur.
[XmlAttribute("nachname")]
- public string SureName { get; set; }
+ public string SurName
+ {
+ get
+ {
+ return this.surName;
+ }
+ set
+ {
+ if (value != this.surName)
+ {
+ this.surName = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the person's first name.
+ /// The name of the first.
[XmlAttribute("vorname")]
- public string FirstName { get; set; }
+ public string FirstName
+ {
+ get
+ {
+ return this.firstName;
+ }
+ set
+ {
+ if (value != this.firstName)
+ {
+ this.firstName = StringManager.StripHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the functions of a person.
+ /// The functions.
[XmlElement("funktion")]
- public ObservableCollection Function { get; set; }
+ public ObservableCollection Functions
+ {
+ get
+ {
+ return this.functions;
+ }
+
+ set
+ {
+ if (value != this.functions)
+ {
+ this.functions = value;
+ this.SetPersonIdToFunction();
+ }
+ }
+ }
+
+ /// Gets the name of a Person (FirstName SurName).
+ /// The name of a Person.
+ public string FullName
+ {
+ get
+ {
+ return this.Akadgrad + " " + this.FirstName + " " + this.SurName;
+ }
+ }
+
+ /// Sets person identifier to function.
+ /// Stubbfel, 05.09.2013.
+ public void SetPersonIdToFunction()
+ {
+ if (this.id == null || this.id.Equals(string.Empty) || this.functions == null)
+ {
+ return;
+ }
+
+ int index = 0;
+ foreach (PersonFunctionModel function in this.functions)
+ {
+ function.PersonID = this.ID;
+ function.FunctionIndex = index++;
+ }
+ }
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
index de83647e..f71e932e 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
@@ -50,7 +50,7 @@ namespace CampusAppWP8.Pages.Departments
DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(this.FeedIsFailedWeb);
DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(this.FeedIsFailedFile);
- DepartmentIndexPage.feed.LoadData(Utilities.getLoadModus());
+ DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus());
if (DepartmentIndexPage.favorite == null)
{
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
index be2584e2..b3d55e45 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
@@ -49,7 +49,7 @@ namespace CampusAppWP8.Pages.Events
EventIndexPage.eventFeed.OnLoaded += new EventFeed.OnIO(this.SetupEventPageList);
EventIndexPage.eventFeed.OnFailedWeb += new EventFeed.OnFailed(this.FeedIsFailedWeb);
EventIndexPage.eventFeed.OnFailedFile += new EventFeed.OnFailed(this.FeedIsFailedFile);
- EventIndexPage.eventFeed.LoadData(Utilities.getLoadModus());
+ EventIndexPage.eventFeed.LoadData(Utilities.GetLoadModus());
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs
index 6bcaebe2..1aaaaa0a 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs
@@ -47,7 +47,7 @@ namespace CampusAppWP8.Pages.Exams
}
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
- this.feed.LoadData(Utilities.getLoadModus());
+ this.feed.LoadData(Utilities.GetLoadModus());
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
index df00699e..0ed9ee1b 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
@@ -11,7 +11,7 @@ namespace CampusAppWP8.Pages.Lecture
using System.Collections.Generic;
using System.Windows;
using System.Windows.Navigation;
- using CampusAppWP8.Feed.Lecture;
+ using CampusAppWP8.Api.Lecture;
using CampusAppWP8.Model.Lecture;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
@@ -159,9 +159,6 @@ namespace CampusAppWP8.Pages.Lecture
///
/// Method send a request to the Feed
///
- ///
- /// have to refactors
- ///
/// sender of this event
/// events arguments
private void SendRequest(object sender, RoutedEventArgs e)
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs
index 4cac9c3a..ed045122 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs
@@ -67,8 +67,8 @@ namespace CampusAppWP8.Pages.Links
this.InitializeFeeds();
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.loadingFeeds = 2;
- this.commonLinkFeed.LoadData(Utilities.getLoadModus());
- this.clubLinkFeed.LoadData(Utilities.getLoadModus());
+ this.commonLinkFeed.LoadData(Utilities.GetLoadModus());
+ this.clubLinkFeed.LoadData(Utilities.GetLoadModus());
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs
index 228ffcb9..4559285f 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs
@@ -11,7 +11,7 @@ namespace CampusAppWP8.Pages.Mensa
using System.Threading;
using System.Windows;
using System.Windows.Navigation;
- using CampusAppWP8.Feed.GeoApi;
+ using CampusAppWP8.Api.GeoApi;
using CampusAppWP8.Feed.Mensa;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
@@ -177,7 +177,7 @@ namespace CampusAppWP8.Pages.Mensa
}
else
{
- this.feed.LoadData(Utilities.getLoadModus());
+ this.feed.LoadData(Utilities.GetLoadModus());
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
index b48619c2..c46b20d8 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
@@ -49,7 +49,7 @@ namespace CampusAppWP8.Pages.News
NewsIndexPage.newsFeed.OnLoaded += new NewsFeed.OnIO(this.SetupNewsPageList);
NewsIndexPage.newsFeed.OnFailedWeb += new NewsFeed.OnFailed(this.FeedIsFailWeb);
NewsIndexPage.newsFeed.OnFailedFile += new NewsFeed.OnFailed(this.FeedIsFailFile);
- NewsIndexPage.newsFeed.LoadData(Utilities.getLoadModus());
+ NewsIndexPage.newsFeed.LoadData(Utilities.GetLoadModus());
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs
index ab256c91..276189b1 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs
@@ -52,7 +52,7 @@ namespace CampusAppWP8.Pages.Openinghours
this.feed.OnLoaded += new OpeninghoursFeed.OnIO(this.FeedIsReady);
this.feed.OnFailedWeb += new OpeninghoursFeed.OnFailed(this.FeedIsFailedWeb);
this.feed.OnFailedFile += new OpeninghoursFeed.OnFailed(this.FeedIsFailedFile);
- this.feed.LoadData(Utilities.getLoadModus());
+ this.feed.LoadData(Utilities.GetLoadModus());
}
this.isNewInstance = true;
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml
index 42be8898..bfc4d4ca 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml
@@ -6,6 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -20,6 +21,8 @@
+
+
@@ -33,18 +36,22 @@
-
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
index 42f82e7f..1fa324ca 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
@@ -1,20 +1,131 @@
-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;
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 09.09.2013
+//----------------------------------------------------------------------
namespace CampusAppWP8.Pages.Person
{
+ using System.Collections.Generic;
+ using System.Windows;
+ using CampusAppWP8.Api.Person;
+ using CampusAppWP8.Model.Person;
+ using CampusAppWP8.Model.Utility;
+ using CampusAppWP8.Resources;
+ using CampusAppWP8.Utility.Lui.Button;
+ using CampusAppWP8.Utility.Lui.MessageBoxes;
+ using Microsoft.Phone.Controls;
+ using Microsoft.Phone.Tasks;
+
+ /// Person page.
+ /// Stubbfel, 09.09.2013.
public partial class PersonPage : PhoneApplicationPage
{
+ /// The API.
+ private PersonSearchApi api;
+
+ /// Initializes a new instance of the PersonPage class.
+ /// Stubbfel, 09.09.2013.
public PersonPage()
{
- InitializeComponent();
+ this.InitializeComponent();
+ }
+
+ /// Sends a request.
+ /// Stubbfel, 09.09.2013.
+ /// Source of the event.
+ /// Routed event information.
+ private void SendRequest(object sender, RoutedEventArgs e)
+ {
+ string query = this.SearchName.Text.Trim();
+ if (query.Equals(string.Empty))
+ {
+ return;
+ }
+
+ this.api = new PersonSearchApi();
+ this.api.OnLoaded += new PersonSearchApi.OnIO(this.ApiIsReady);
+ this.api.OnFailedLoad += new PersonSearchApi.OnFailed(this.ApiIsFail);
+ this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
+ List parameterList = this.CreateUrlParameter(query);
+ this.api.SetUriParams(parameterList);
+ this.api.LoadData();
+ }
+
+ /// Creates URL parameter.
+ /// Stubbfel, 09.09.2013.
+ /// The name.
+ /// The new URL parameter.
+ private List CreateUrlParameter(string name)
+ {
+ List parameterList = new List();
+ parameterList.Add(new CleanUrlParamModel(Constants.ParamPersonList, name));
+ return parameterList;
+ }
+
+ /// API is fail.
+ /// Stubbfel, 09.09.2013.
+ private void ApiIsFail()
+ {
+ MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
+ this.ProgressBar.Visibility = Visibility.Collapsed;
+ }
+
+ /// API is ready.
+ /// Stubbfel, 09.09.2013.
+ private void ApiIsReady()
+ {
+ this.SetupResultBox();
+ this.ProgressBar.Visibility = Visibility.Collapsed;
+ }
+
+ /// Sets up the result box.
+ /// Stubbfel, 09.09.2013.
+ private void SetupResultBox()
+ {
+ this.api.Model.RemoveNonFunctionAndSetIdsPerson();
+ this.ResultBox.ItemsSource = this.api.Model.Persons;
+ }
+
+ /// Event handler. Called by Button for click events.
+ /// Stubbfel, 09.09.2013.
+ /// Source of the event.
+ /// Routed event information.
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ AddPersonButton btn = sender as AddPersonButton;
+ if (btn == null)
+ {
+ return;
+ }
+
+ string personID = btn.PersonId as string;
+ int functionIndex = (int)btn.FunctionIndex;
+
+ PersonModel person = this.api.Model.GetPerson(personID);
+ if (person == null)
+ {
+ return;
+ }
+
+ SaveContactTask saveContactTask = new SaveContactTask();
+
+ saveContactTask.FirstName = person.FirstName;
+ saveContactTask.LastName = person.SurName;
+ saveContactTask.Title = person.Akadgrad;
+ saveContactTask.JobTitle = person.Functions[functionIndex].Function;
+ saveContactTask.Company = Constants.Addr_CBMainCompanyName + " - " + person.Functions[functionIndex].Appointment;
+ saveContactTask.WorkAddressCountry = Constants.Addr_CBMainCountry;
+ saveContactTask.WorkAddressCity = Constants.Addr_CBMainCity;
+ saveContactTask.WorkAddressState = Constants.Addr_CBMainState;
+ saveContactTask.WorkAddressZipCode = Constants.Addr_CBMainZipCode;
+ saveContactTask.WorkAddressStreet = person.Functions[functionIndex].Building;
+ saveContactTask.WorkPhone = person.Functions[functionIndex].Tel1;
+ saveContactTask.WorkEmail = person.Functions[functionIndex].Mail;
+
+ saveContactTask.Show();
}
}
}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs
index 63523e6f..a1de45c2 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs
@@ -60,7 +60,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
}
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
- this.feed.LoadData(Utilities.getLoadModus());
+ this.feed.LoadData(Utilities.GetLoadModus());
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
index 9cb9bff8..9bbb8d49 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
@@ -699,6 +699,33 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Einrichtung ähnelt.
+ ///
+ public static string PersonApp_Appointment {
+ get {
+ return ResourceManager.GetString("PersonApp_Appointment", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Sitz ähnelt.
+ ///
+ public static string PersonApp_Building {
+ get {
+ return ResourceManager.GetString("PersonApp_Building", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Tätigkeit ähnelt.
+ ///
+ public static string PersonApp_FunctionName {
+ get {
+ return ResourceManager.GetString("PersonApp_FunctionName", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Personensuche ähnelt.
///
@@ -708,6 +735,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Nachname ähnelt.
+ ///
+ public static string PersonApp_SearchTextLabel {
+ get {
+ return ResourceManager.GetString("PersonApp_SearchTextLabel", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Personen ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
index 72626477..8c61fce3 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
@@ -431,4 +431,16 @@
Personen
+
+ Einrichtung
+
+
+ Sitz
+
+
+ Tätigkeit
+
+
+ Nachname
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
index d4c18d60..e50aa78f 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
@@ -60,6 +60,51 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Cottbus ähnelt.
+ ///
+ public static string Addr_CBMainCity {
+ get {
+ return ResourceManager.GetString("Addr_CBMainCity", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die BTU ähnelt.
+ ///
+ public static string Addr_CBMainCompanyName {
+ get {
+ return ResourceManager.GetString("Addr_CBMainCompanyName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die De ähnelt.
+ ///
+ public static string Addr_CBMainCountry {
+ get {
+ return ResourceManager.GetString("Addr_CBMainCountry", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Brandenburg ähnelt.
+ ///
+ public static string Addr_CBMainState {
+ get {
+ return ResourceManager.GetString("Addr_CBMainState", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die 03046 ähnelt.
+ ///
+ public static string Addr_CBMainZipCode {
+ get {
+ return ResourceManager.GetString("Addr_CBMainZipCode", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die DevMode ähnelt.
///
@@ -564,6 +609,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt.
+ ///
+ public static string ParamPersonList {
+ get {
+ return ResourceManager.GetString("ParamPersonList", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die pivotindex ähnelt.
///
@@ -780,6 +834,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt.
+ ///
+ public static string PersonListValidRootName {
+ get {
+ return ResourceManager.GetString("PersonListValidRootName", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die [+-]{0,1}[0-9]+[.,]{0,1}[0-9]+[\s][+-]{0,1}[0-9]+[.,]{0,1}[0-9]+ ähnelt.
///
@@ -978,6 +1041,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die https://www.zv.tu-cottbus.de/CMS-Webservice/Person ähnelt.
+ ///
+ public static string UrlPerson_PersonSearchByName {
+ get {
+ return ResourceManager.GetString("UrlPerson_PersonSearchByName", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die http://141.43.76.140/service/sps ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
index ef787291..5710e363 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
@@ -459,4 +459,28 @@
035569
+
+ Uebersicht
+
+
+ https://www.zv.tu-cottbus.de/CMS-Webservice/Person
+
+
+ Cottbus
+
+
+ BTU
+
+
+ De
+
+
+ Brandenburg
+
+
+ 03046
+
+
+ Uebersicht
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Settings.StyleCop b/CampusAppWP8/CampusAppWP8/Settings.StyleCop
index ea0eb655..3ecec60b 100644
--- a/CampusAppWP8/CampusAppWP8/Settings.StyleCop
+++ b/CampusAppWP8/CampusAppWP8/Settings.StyleCop
@@ -1,6 +1,7 @@
+ api
enum
Stubbfel
diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs
new file mode 100644
index 00000000..6653f038
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs
@@ -0,0 +1,43 @@
+using CampusAppWP8.Resources;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+
+namespace CampusAppWP8.Utility.Lui.Button
+{
+ public class AddPersonButton : System.Windows.Controls.Button
+ {
+ private static BitmapImage icon = new BitmapImage(new Uri(Icons.Add, UriKind.Relative));
+
+ public AddPersonButton()
+ : base()
+ {
+ this.Content = new Image
+ {
+ Source = icon
+ };
+ }
+
+ public static readonly DependencyProperty PersonIdProperty = DependencyProperty.Register("PersonID", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
+
+
+ public static readonly DependencyProperty FunctionIndexProperty = DependencyProperty.Register("FunctionIndex", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
+
+ public object PersonId
+ {
+ get { return (object)this.GetValue(PersonIdProperty); }
+ set { this.SetValue(PersonIdProperty, value); }
+ }
+
+ public object FunctionIndex
+ {
+ get { return (object)this.GetValue(FunctionIndexProperty); }
+ set { this.SetValue(FunctionIndexProperty, value); }
+ }
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
index b5543dd9..0cba0d1f 100644
--- a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
+++ b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
@@ -302,12 +302,13 @@ namespace CampusAppWP8.Utility
return true;
}
}
+
return false;
}
- /// Queries if a wifik is available.
+ /// Queries if a wifi is available.
/// Stubbfel, 26.08.2013.
- /// true if a wifik is available, false if not.
+ /// true if a wifi is available, false if not.
public static bool IsWifiAvailable()
{
NetworkInterfaceList networkInterfaceList = new NetworkInterfaceList();
@@ -320,6 +321,7 @@ namespace CampusAppWP8.Utility
return true;
}
}
+
return false;
}
@@ -327,7 +329,7 @@ namespace CampusAppWP8.Utility
/// Stubbfel, 27.08.2013.
/// Generic type parameter.
/// The load modus< t>
- public static MainModel.ForceType getLoadModus()
+ public static MainModel.ForceType GetLoadModus()
{
if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable)
{