diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs index e008cee8..b6a1eeaf 100644 --- a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs +++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs @@ -8,13 +8,9 @@ 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/Person/PersonSearchApi.cs b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs index 055c6c2d..fbc838e7 100644 --- a/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs +++ b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs @@ -1,11 +1,11 @@ //----------------------------------------------------------------------------- -// +// // Company copyright tag. // // stubbfel // 05.09.2013 //----------------------------------------------------------------------------- -// + namespace CampusAppWP8.Api.Person { using CampusAppWP8.Model; diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs index 07304ff7..147fbc5d 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs @@ -35,7 +35,6 @@ namespace CampusAppWP8.Model.Person /// The building. private string building; - /// Gets or sets the tel 1. /// The tel 1. [XmlAttribute("telefon")] diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs index 2f6dc513..0182d9ce 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs @@ -45,6 +45,7 @@ namespace CampusAppWP8.Model.Person return tmpPerson; } } + return null; } @@ -60,18 +61,18 @@ namespace CampusAppWP8.Model.Person /// Stubbfel, 05.09.2013. public void RemoveNonFunctionPerson() { - List rmList = new List(); + List removeList = new List(); foreach (PersonModel tmpPerson in this.Persons) { if (tmpPerson.Functions.Count < 1) { - rmList.Add(tmpPerson); + removeList.Add(tmpPerson); } } - foreach (PersonModel rmPerson in rmList) + foreach (PersonModel removePerson in removeList) { - this.Persons.Remove(rmPerson); + this.Persons.Remove(removePerson); } } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs index ef2caedf..a8b51572 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs @@ -39,6 +39,7 @@ namespace CampusAppWP8.Model.Person { return this.id; } + set { if (value != this.id) @@ -115,6 +116,7 @@ namespace CampusAppWP8.Model.Person { return this.functions; } + set { if (value != this.functions) @@ -125,7 +127,7 @@ namespace CampusAppWP8.Model.Person } } - /// Gets the name of a Person ( ). + /// Gets the name of a Person (FirstName SurName). /// The name of a Person. public string FullName { 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/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 3f777e48..4559285f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs @@ -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 f0cd53ea..bfc4d4ca 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml @@ -36,7 +36,11 @@ - + + + + + @@ -58,7 +62,7 @@ - + @@ -67,7 +71,7 @@ - + @@ -82,20 +86,29 @@ - + + + + + - + + + + - + + + + + - - - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs index cc686ab4..1fa324ca 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs @@ -1,31 +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 CampusAppWP8.Api.Person; -using CampusAppWP8.Model.Utility; -using CampusAppWP8.Utility.Lui.MessageBoxes; -using CampusAppWP8.Resources; -using Microsoft.Phone.Tasks; -using CampusAppWP8.Utility.Lui.Button; -using CampusAppWP8.Model.Person; +//----------------------------------------------------------------------- +// +// 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(); @@ -43,51 +54,76 @@ namespace CampusAppWP8.Pages.Person 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("Uebersicht", name)); + 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 fIndex = (int)btn.FunctionIndex; + int functionIndex = (int)btn.FunctionIndex; + PersonModel person = this.api.Model.GetPerson(personID); - // int functionIndex = btn.Parent. - SaveContactTask saveContactTask = new SaveContactTask(); + if (person == null) + { + return; + } + + SaveContactTask saveContactTask = new SaveContactTask(); + saveContactTask.FirstName = person.FirstName; saveContactTask.LastName = person.SurName; saveContactTask.Title = person.Akadgrad; - saveContactTask.JobTitle = person.Functions[fIndex].Function; - saveContactTask.Company = "BTU - " + person.Functions[fIndex].Appointment; - saveContactTask.WorkAddressCountry = "De"; - saveContactTask.WorkAddressCity = "Cottbus"; - saveContactTask.WorkAddressState = "Brandenburg"; - saveContactTask.WorkAddressZipCode = "03046"; - saveContactTask.WorkAddressStreet = person.Functions[fIndex].Building; - saveContactTask.WorkPhone = person.Functions[fIndex].Tel1; - saveContactTask.WorkEmail = person.Functions[fIndex].Mail; + 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(); } 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 c3ead845..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. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 53511539..5710e363 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -465,4 +465,22 @@ 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/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) {