mv personmodels
This commit is contained in:
@@ -15,7 +15,7 @@ namespace CampusAppWP8.Api.Person
|
||||
|
||||
/// <summary>Person search api.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonSearchApi : XmlModel<PersonListModel>
|
||||
public class PersonSearchApi : XmlModel<PersonListWp8Model>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@
|
||||
<Compile Include="Model\GeoDb\PlaceModel.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceService.cs" />
|
||||
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||
<Compile Include="Model\Person\PersonFunctionModel.cs" />
|
||||
<Compile Include="Model\Person\PersonListModel.cs" />
|
||||
<Compile Include="Model\Person\PersonModel.cs" />
|
||||
<Compile Include="Model\Person\PersonFunctionWp8Model.cs" />
|
||||
<Compile Include="Model\Person\PersonListWp8Model.cs" />
|
||||
<Compile Include="Model\Person\PersonWp8Model.cs" />
|
||||
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListWp8Model.cs" />
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonFunctionWp8Model.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Person function model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonFunctionWp8Model : CampusAppWPortalLib8.Model.Person.PersonFunctionModel
|
||||
{
|
||||
#region Property
|
||||
|
||||
/// <summary>Gets or sets the function.</summary>
|
||||
/// <value>The function.</value>
|
||||
[XmlAttribute("funktion")]
|
||||
public new string Function
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Function;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.Function)
|
||||
{
|
||||
base.Function = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the appointment.</summary>
|
||||
/// <value>The appointment.</value>
|
||||
[XmlAttribute("einrichtung")]
|
||||
public new string Appointment
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Appointment;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.Appointment)
|
||||
{
|
||||
base.Appointment = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the building.</summary>
|
||||
/// <value>The building.</value>
|
||||
[XmlAttribute("gebaeude")]
|
||||
public new string Building
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Building;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.Building)
|
||||
{
|
||||
base.Building = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
29
CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs
Normal file
29
CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonListWp8Model.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWPortalLib8.Model.Person;
|
||||
|
||||
/// <summary>Person list model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
[XmlRoot("Uebersicht")]
|
||||
public class PersonListWp8Model : CampusAppWPortalLib8.Model.Person.PersonListModel<PersonWp8Model>
|
||||
{
|
||||
/// <summary>Gets a person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>The person.</returns>
|
||||
public new PersonWp8Model GetPerson(string id)
|
||||
{
|
||||
IPersonModel<PersonWp8Model> tmpPerson = base.GetPerson(id);
|
||||
return tmpPerson as PersonWp8Model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,12 @@ namespace CampusAppWP8.Pages.Person
|
||||
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 CampusAppWPortalLib8.Model.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Tasks;
|
||||
using CampusAppWPortalLib8.Model.Utility;
|
||||
|
||||
/// <summary>Person page.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
@@ -115,7 +114,7 @@ namespace CampusAppWP8.Pages.Person
|
||||
string personID = btn.PersonId as string;
|
||||
int functionIndex = (int)btn.FunctionIndex;
|
||||
|
||||
PersonModel person = this.api.Model.GetPerson(personID);
|
||||
PersonWp8Model person = this.api.Model.GetPerson(personID);
|
||||
if (person == null)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="IPersonFunctionModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>01.10.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Person
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for PersonFunctionModel classes
|
||||
/// </summary>
|
||||
public interface IPersonFunctionModel
|
||||
{
|
||||
/// <summary>Gets or sets the identifier of the person.</summary>
|
||||
/// <value>The identifier of the person.</value>
|
||||
string PersonID { get; set; }
|
||||
|
||||
/// <summary>Gets or sets zero-based index of the function.</summary>
|
||||
/// <value>The function index.</value>
|
||||
int FunctionIndex { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="IPersonModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>01.10.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Person
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for PersonModel classes
|
||||
/// </summary>
|
||||
/// <typeparam name="T">PersonFunctionModel template</typeparam>
|
||||
public interface IPersonModel<T>
|
||||
{
|
||||
/// <summary>Gets or sets the functions of a person.</summary>
|
||||
/// <value>The functions.</value>
|
||||
ObservableCollection<T> Functions { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the identifier.</summary>
|
||||
/// <value>The identifier.</value>
|
||||
string ID { get; set; }
|
||||
|
||||
/// <summary>Sets person identifier to function.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
void SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,14 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Person
|
||||
namespace CampusAppWPortalLib8.Model.Person
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
/// <summary>Person function model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonFunctionModel
|
||||
public class PersonFunctionModel : IPersonFunctionModel
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.tel1)
|
||||
{
|
||||
this.tel1 = Wp8StringManager.CreateUniTelefonNumber(value);
|
||||
this.tel1 = DefaultStringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.tel2)
|
||||
{
|
||||
this.tel2 = Wp8StringManager.CreateUniTelefonNumber(value);
|
||||
this.tel2 = DefaultStringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.fax)
|
||||
{
|
||||
this.fax = Wp8StringManager.CreateUniTelefonNumber(value);
|
||||
this.fax = DefaultStringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.function)
|
||||
{
|
||||
this.function = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.function = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.appointment)
|
||||
{
|
||||
this.appointment = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.appointment = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.building)
|
||||
{
|
||||
this.building = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.building = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ namespace CampusAppWP8.Model.Person
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null && value != this.mail && Wp8StringManager.IsValidEmail(value))
|
||||
if (value != null && value != this.mail && DefaultStringManager.IsValidEmail(value))
|
||||
{
|
||||
this.mail = value;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Person
|
||||
namespace CampusAppWPortalLib8.Model.Person
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
@@ -14,15 +14,16 @@ namespace CampusAppWP8.Model.Person
|
||||
|
||||
/// <summary>Person list model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <typeparam name="T">personModel template</typeparam>
|
||||
[XmlRoot("Uebersicht")]
|
||||
public class PersonListModel
|
||||
public class PersonListModel<T>
|
||||
{
|
||||
#region Property
|
||||
|
||||
/// <summary>Gets or sets the persons.</summary>
|
||||
/// <value>The persons.</value>
|
||||
[XmlElement("person")]
|
||||
public ObservableCollection<PersonModel> Persons { get; set; }
|
||||
public ObservableCollection<T> Persons { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -32,9 +33,13 @@ namespace CampusAppWP8.Model.Person
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void SetPersonIdToFunction()
|
||||
{
|
||||
foreach (PersonModel person in this.Persons)
|
||||
foreach (T item in this.Persons)
|
||||
{
|
||||
person.SetPersonIdToFunction();
|
||||
IPersonModel<T> person = item as IPersonModel<T>;
|
||||
if (person != null)
|
||||
{
|
||||
person.SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,17 +47,23 @@ namespace CampusAppWP8.Model.Person
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>The person.</returns>
|
||||
public PersonModel GetPerson(string id)
|
||||
public IPersonModel<T> GetPerson(string id)
|
||||
{
|
||||
foreach (PersonModel tmpPerson in this.Persons)
|
||||
foreach (T item in this.Persons)
|
||||
{
|
||||
IPersonModel<T> tmpPerson = item as IPersonModel<T>;
|
||||
if (tmpPerson == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tmpPerson.ID.Equals(id))
|
||||
{
|
||||
return tmpPerson;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return default(IPersonModel<T>);
|
||||
}
|
||||
|
||||
/// <summary>Removes the non function and set identifiers person.</summary>
|
||||
@@ -67,16 +78,22 @@ namespace CampusAppWP8.Model.Person
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void RemoveNonFunctionPerson()
|
||||
{
|
||||
List<PersonModel> removeList = new List<PersonModel>();
|
||||
foreach (PersonModel tmpPerson in this.Persons)
|
||||
List<T> removeList = new List<T>();
|
||||
foreach (T item in this.Persons)
|
||||
{
|
||||
IPersonModel<T> tmpPerson = item as IPersonModel<T>;
|
||||
if (tmpPerson == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tmpPerson.Functions.Count < 1)
|
||||
{
|
||||
removeList.Add(tmpPerson);
|
||||
removeList.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PersonModel removePerson in removeList)
|
||||
foreach (T removePerson in removeList)
|
||||
{
|
||||
this.Persons.Remove(removePerson);
|
||||
}
|
||||
@@ -5,15 +5,15 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Person
|
||||
namespace CampusAppWPortalLib8.Model.Person
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Person model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonModel
|
||||
/// <typeparam name="T">template for the PersonFunction-Class</typeparam>
|
||||
public class PersonModel<T> : IPersonModel<T>
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CampusAppWP8.Model.Person
|
||||
private string id;
|
||||
|
||||
/// <summary>The functions.</summary>
|
||||
private ObservableCollection<PersonFunctionModel> functions;
|
||||
private ObservableCollection<T> functions;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.akadgrad)
|
||||
{
|
||||
this.akadgrad = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.akadgrad = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.surName)
|
||||
{
|
||||
this.surName = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.surName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
if (value != this.firstName)
|
||||
{
|
||||
this.firstName = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.firstName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace CampusAppWP8.Model.Person
|
||||
/// <summary>Gets or sets the functions of a person.</summary>
|
||||
/// <value>The functions.</value>
|
||||
[XmlElement("funktion")]
|
||||
public ObservableCollection<PersonFunctionModel> Functions
|
||||
public ObservableCollection<T> Functions
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -157,10 +157,14 @@ namespace CampusAppWP8.Model.Person
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
foreach (PersonFunctionModel function in this.functions)
|
||||
foreach (T item in this.functions)
|
||||
{
|
||||
function.PersonID = this.ID;
|
||||
function.FunctionIndex = index++;
|
||||
IPersonFunctionModel function = item as IPersonFunctionModel;
|
||||
if (function != null)
|
||||
{
|
||||
function.PersonID = this.ID;
|
||||
function.FunctionIndex = index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<GlobalSettings>
|
||||
<CollectionProperty Name="RecognizedWords">
|
||||
<Value>akadgrad</Value>
|
||||
<Value>api</Value>
|
||||
<Value>nfc</Value>
|
||||
<Value>param</Value>
|
||||
|
||||
Reference in New Issue
Block a user