add personmodel
This commit is contained in:
@@ -118,6 +118,8 @@
|
||||
<Compile Include="Model\GeoDb\PlaceService.cs" />
|
||||
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||
<Compile Include="Model\Mensa\MealModel.cs" />
|
||||
<Compile Include="Model\Person\PersonFunctionModel.cs" />
|
||||
<Compile Include="Model\Person\PersonModel.cs" />
|
||||
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
using CampusAppWP8.Resources;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
public class PersonFunctionModel
|
||||
{
|
||||
private string tel1;
|
||||
|
||||
private string tel2;
|
||||
|
||||
private string fax;
|
||||
|
||||
[XmlAttribute("telefon")]
|
||||
public string Tel1
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tel1;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null && value != this.tel1)
|
||||
{
|
||||
this.tel1 = this.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute("telefon2")]
|
||||
public string Tel2
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tel2;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null && value != this.tel2)
|
||||
{
|
||||
this.tel2 = this.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute("fax")]
|
||||
public string Fax
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fax;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null && value != this.fax)
|
||||
{
|
||||
this.fax = this.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute("funktion")]
|
||||
public string Function { get; set; }
|
||||
|
||||
[XmlAttribute("einrichtung")]
|
||||
public string Appointment { get; set; }
|
||||
|
||||
[XmlAttribute("gebaeude")]
|
||||
public string Building { get; set; }
|
||||
|
||||
[XmlAttribute("mail")]
|
||||
public string Mail { get; set; }
|
||||
|
||||
private string CreateUniTelefonNumber (string input)
|
||||
{
|
||||
string result = null;
|
||||
if (input.Length < 5)
|
||||
{
|
||||
result = Constants.UniCBTelPrefix + input.TrimStart('0');
|
||||
}
|
||||
else
|
||||
{
|
||||
result = input;
|
||||
}
|
||||
|
||||
Regex regexObj = new Regex(@"[^\d]");
|
||||
result = regexObj.Replace(this.tel1.TrimStart('0'), "");
|
||||
result = Constants.DeTelPrefix + result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
Normal file
28
CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
public class PersonModel
|
||||
{
|
||||
[XmlAttribute("id")]
|
||||
public string ID {get; set;}
|
||||
|
||||
[XmlAttribute("akadgrad")]
|
||||
public string Akadgrad { get; set; }
|
||||
|
||||
[XmlAttribute("nachname")]
|
||||
public string SureName { get; set; }
|
||||
|
||||
[XmlAttribute("vorname")]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[XmlElement("funktion")]
|
||||
public ObservableCollection<PersonFunctionModel> Function { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -132,6 +132,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die +49 ähnelt.
|
||||
/// </summary>
|
||||
public static string DeTelPrefix {
|
||||
get {
|
||||
return ResourceManager.GetString("DeTelPrefix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die ExamsPage.LastPivotIndex ähnelt.
|
||||
/// </summary>
|
||||
@@ -843,6 +852,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 035569 ähnelt.
|
||||
/// </summary>
|
||||
public static string UniCBTelPrefix {
|
||||
get {
|
||||
return ResourceManager.GetString("UniCBTelPrefix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/professorships.xml ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -453,4 +453,10 @@
|
||||
<data name="PathPerson_Person" xml:space="preserve">
|
||||
<value>/Pages/Person/PersonPage.xaml</value>
|
||||
</data>
|
||||
<data name="DeTelPrefix" xml:space="preserve">
|
||||
<value>+49</value>
|
||||
</data>
|
||||
<data name="UniCBTelPrefix" xml:space="preserve">
|
||||
<value>035569</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user