finish profilsite
This commit is contained in:
@@ -166,14 +166,12 @@ namespace CampusAppWP8
|
||||
// Dieser Code wird beim Schließen der Anwendung nicht ausgeführt
|
||||
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
|
||||
{
|
||||
Settings.UserProfil.SaveData();
|
||||
}
|
||||
|
||||
// Code, der beim Schließen der Anwendung ausgeführt wird (z. B. wenn der Benutzer auf "Zurück" klickt)
|
||||
// Dieser Code wird beim Deaktivieren der Anwendung nicht ausgeführt
|
||||
private void Application_Closing(object sender, ClosingEventArgs e)
|
||||
{
|
||||
Settings.UserProfil.SaveData();
|
||||
// Sicherstellen, dass der erforderliche Anwendungszustand hier beibehalten wird
|
||||
}
|
||||
|
||||
|
||||
@@ -100,10 +100,10 @@
|
||||
<Compile Include="Const.cs" />
|
||||
<Compile Include="File\Setting\UserProfilFile.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel .cs" />
|
||||
<Compile Include="Model\Utility\DegreeListPickerItemListModel .cs" />
|
||||
<Compile Include="Model\Utility\RoleListPickerItemListModel .cs" />
|
||||
<Compile Include="Model\Utility\SemesterListPickerItemListModel .cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
|
||||
<Compile Include="Pages\Setting\UserProfil.xaml.cs">
|
||||
<DependentUpon>UserProfil.xaml</DependentUpon>
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace CampusAppWP8.File.Setting
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserProfilFile" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoLoad">automatic loading of the data</param>
|
||||
public UserProfilFile()
|
||||
: base(ModelType.File, Constants.FileProfil_User)
|
||||
{
|
||||
|
||||
@@ -27,17 +27,17 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <remarks>
|
||||
/// need to be extend to full list
|
||||
/// </remarks>
|
||||
private List<ListPickerItemModel> courseList;
|
||||
private CourseListPickerItemListModel courseList;
|
||||
|
||||
/// <summary>
|
||||
/// List of the degrees
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> degreeList;
|
||||
private DegreeListPickerItemListModel degreeList;
|
||||
|
||||
/// <summary>
|
||||
/// List of the semester
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> semesterList;
|
||||
private SemesterListPickerItemListModel semesterList;
|
||||
|
||||
/// <summary>
|
||||
/// List for the number of semester (from)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CampusAppWP8.Model.Setting
|
||||
/// <summary>
|
||||
/// Gets or Sets the course of the user
|
||||
/// </summary>
|
||||
private int course = UserProfilModel.DefaultCourseNumber;
|
||||
private int course = UserProfilModel.DefaultCourseNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the role of the user
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
// <copyright file="CourseListPickerItemListModel .cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using System.Linq;
|
||||
public class CourseListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public CourseListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.addItem(new ListPickerItemModel("013", "Architektur"));
|
||||
this.addItem(new ListPickerItemModel("017", "Bauingenieurwesen"));
|
||||
this.addItem(new ListPickerItemModel("021", "Betriebswirtschaftslehre"));
|
||||
this.addItem(new ListPickerItemModel("042", "Wirtschaftsrecht für Technologieunternehmen"));
|
||||
this.addItem(new ListPickerItemModel("048", "Elektrotechnik"));
|
||||
this.addItem(new ListPickerItemModel("079", "Informatik "));
|
||||
this.addItem(new ListPickerItemModel("104", "Maschinenbau"));
|
||||
this.addItem(new ListPickerItemModel("105", "Mathematik"));
|
||||
this.addItem(new ListPickerItemModel("128", "Physik "));
|
||||
this.addItem(new ListPickerItemModel("179", "Wirtschaftsingenieurwesen"));
|
||||
this.addItem(new ListPickerItemModel("184", "Wirtschaftswissenschaften "));
|
||||
this.addItem(new ListPickerItemModel("215", "Biomedizinische Gerätetechnik "));
|
||||
this.addItem(new ListPickerItemModel("226", "Verfahrenstechnik"));
|
||||
this.addItem(new ListPickerItemModel("276", "Wirtschaftsmathematik "));
|
||||
this.addItem(new ListPickerItemModel("711", "Kultur und Technik "));
|
||||
this.addItem(new ListPickerItemModel("744", "Physik der Halbleiter-Technologie"));
|
||||
this.addItem(new ListPickerItemModel("749", "Angewandte Mathematik "));
|
||||
this.addItem(new ListPickerItemModel("764", "Technologie- und Innovationsmanagement"));
|
||||
this.addItem(new ListPickerItemModel("766", "Stadt- und Regionalplanung"));
|
||||
this.addItem(new ListPickerItemModel("767", "Informations- und Medientechnik "));
|
||||
this.addItem(new ListPickerItemModel("768", "World Heritage Studies"));
|
||||
this.addItem(new ListPickerItemModel("770", "Umweltingenieurwesen und Verfahrenstechnik"));
|
||||
this.addItem(new ListPickerItemModel("771", "Environmental and Resource Management"));
|
||||
this.addItem(new ListPickerItemModel("772", "Landnutzung und Wasserbewirtschaftung"));
|
||||
this.addItem(new ListPickerItemModel("773", "Bauen und Erhalten"));
|
||||
this.addItem(new ListPickerItemModel("774", "Umweltingenieurwesen"));
|
||||
this.addItem(new ListPickerItemModel("794", "eBusiness"));
|
||||
this.addItem(new ListPickerItemModel("798", "Civil Engineering"));
|
||||
this.addItem(new ListPickerItemModel("799", "Structural Engineering"));
|
||||
this.addItem(new ListPickerItemModel("800", "Electrical Power Engineering "));
|
||||
this.addItem(new ListPickerItemModel("841", "Euro Hydroinformatics and Water Management"));
|
||||
this.addItem(new ListPickerItemModel("842", "Technologien Biogener Rohstoffe"));
|
||||
this.addItem(new ListPickerItemModel("843", "Environmental Technologies"));
|
||||
this.addItem(new ListPickerItemModel("844", "Process Engineering and Plant Design"));
|
||||
this.addItem(new ListPickerItemModel("845", "Architekturvermittlung"));
|
||||
this.addItem(new ListPickerItemModel("851", "Nachwachsende Rohstoffe und Erneuerbare Energien"));
|
||||
this.addItem(new ListPickerItemModel("852", "Energieträger aus Biomasse und Abfällen"));
|
||||
this.addItem(new ListPickerItemModel("853", "Power Engineering"));
|
||||
this.addItem(new ListPickerItemModel("857", "Verfahrenstechnik - Prozess- und Anlagentechnik"));
|
||||
this.addItem(new ListPickerItemModel("858", "Architektur.Studium.Generale"));
|
||||
this.addItem(new ListPickerItemModel("860", "Verarbeitungstechnologien der Werkstoffe"));
|
||||
this.addItem(new ListPickerItemModel("871", "Forensic Sciences and Engineering"));
|
||||
this.List = this.List.OrderBy(o => o.Text).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
// <copyright file="CourseListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// This is a class for the courseList
|
||||
/// </summary>
|
||||
public class CourseListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public CourseListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel("013", "Architektur"));
|
||||
this.AddItem(new ListPickerItemModel("017", "Bauingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("021", "Betriebswirtschaftslehre"));
|
||||
this.AddItem(new ListPickerItemModel("042", "Wirtschaftsrecht für Technologieunternehmen"));
|
||||
this.AddItem(new ListPickerItemModel("048", "Elektrotechnik"));
|
||||
this.AddItem(new ListPickerItemModel("079", "Informatik "));
|
||||
this.AddItem(new ListPickerItemModel("104", "Maschinenbau"));
|
||||
this.AddItem(new ListPickerItemModel("105", "Mathematik"));
|
||||
this.AddItem(new ListPickerItemModel("128", "Physik "));
|
||||
this.AddItem(new ListPickerItemModel("179", "Wirtschaftsingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("184", "Wirtschaftswissenschaften "));
|
||||
this.AddItem(new ListPickerItemModel("215", "Biomedizinische Gerätetechnik "));
|
||||
this.AddItem(new ListPickerItemModel("226", "Verfahrenstechnik"));
|
||||
this.AddItem(new ListPickerItemModel("276", "Wirtschaftsmathematik "));
|
||||
this.AddItem(new ListPickerItemModel("711", "Kultur und Technik "));
|
||||
this.AddItem(new ListPickerItemModel("744", "Physik der Halbleiter-Technologie"));
|
||||
this.AddItem(new ListPickerItemModel("749", "Angewandte Mathematik "));
|
||||
this.AddItem(new ListPickerItemModel("764", "Technologie- und Innovationsmanagement"));
|
||||
this.AddItem(new ListPickerItemModel("766", "Stadt- und Regionalplanung"));
|
||||
this.AddItem(new ListPickerItemModel("767", "Informations- und Medientechnik "));
|
||||
this.AddItem(new ListPickerItemModel("768", "World Heritage Studies"));
|
||||
this.AddItem(new ListPickerItemModel("770", "Umweltingenieurwesen und Verfahrenstechnik"));
|
||||
this.AddItem(new ListPickerItemModel("771", "Environmental and Resource Management"));
|
||||
this.AddItem(new ListPickerItemModel("772", "Landnutzung und Wasserbewirtschaftung"));
|
||||
this.AddItem(new ListPickerItemModel("773", "Bauen und Erhalten"));
|
||||
this.AddItem(new ListPickerItemModel("774", "Umweltingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("794", "eBusiness"));
|
||||
this.AddItem(new ListPickerItemModel("798", "Civil Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("799", "Structural Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("800", "Electrical Power Engineering "));
|
||||
this.AddItem(new ListPickerItemModel("841", "Euro Hydroinformatics and Water Management"));
|
||||
this.AddItem(new ListPickerItemModel("842", "Technologien Biogener Rohstoffe"));
|
||||
this.AddItem(new ListPickerItemModel("843", "Environmental Technologies"));
|
||||
this.AddItem(new ListPickerItemModel("844", "Process Engineering and Plant Design"));
|
||||
this.AddItem(new ListPickerItemModel("845", "Architekturvermittlung"));
|
||||
this.AddItem(new ListPickerItemModel("851", "Nachwachsende Rohstoffe und Erneuerbare Energien"));
|
||||
this.AddItem(new ListPickerItemModel("852", "Energieträger aus Biomasse und Abfällen"));
|
||||
this.AddItem(new ListPickerItemModel("853", "Power Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("857", "Verfahrenstechnik - Prozess- und Anlagentechnik"));
|
||||
this.AddItem(new ListPickerItemModel("858", "Architektur.Studium.Generale"));
|
||||
this.AddItem(new ListPickerItemModel("860", "Verarbeitungstechnologien der Werkstoffe"));
|
||||
this.AddItem(new ListPickerItemModel("871", "Forensic Sciences and Engineering"));
|
||||
this.List = this.List.OrderBy(o => o.Text).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// <copyright file="DegreeListPickerItemListModel .cs" company="BTU/IIT">
|
||||
// <copyright file="DegreeListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
@@ -7,14 +7,16 @@
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// This Class creates a list of degrees
|
||||
/// </summary>
|
||||
public class DegreeListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// Initializes a new instance of the <see cref="DegreeListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public DegreeListPickerItemListModel()
|
||||
: base()
|
||||
@@ -27,11 +29,14 @@ namespace CampusAppWP8.Model.Utility
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.addItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR.ToString(), AppResources.Degree_Bachelor));
|
||||
this.addItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER.ToString(), AppResources.Degree_Master));
|
||||
this.addItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM.ToString(), AppResources.Degree_Diploma));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR.ToString(), AppResources.Degree_Bachelor));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER.ToString(), AppResources.Degree_Master));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM.ToString(), AppResources.Degree_Diploma));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -8,17 +8,23 @@
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Class for a List of ListPickerItems
|
||||
/// </summary>
|
||||
public class ListPickerItemListModel
|
||||
{
|
||||
#region Members
|
||||
|
||||
List<ListPickerItemModel> list;
|
||||
/// <summary>
|
||||
/// reference of the itemList
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> list;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
@@ -32,12 +38,16 @@ namespace CampusAppWP8.Model.Utility
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ItemList
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> List
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.list)
|
||||
@@ -58,7 +68,7 @@ namespace CampusAppWP8.Model.Utility
|
||||
/// </summary>
|
||||
/// <param name="value">a certain value</param>
|
||||
/// <returns>return index of value or default(0)</returns>
|
||||
virtual public int GetIndexOrDefault(string value)
|
||||
public virtual int GetIndexOrDefault(string value)
|
||||
{
|
||||
int index = 0;
|
||||
int i = 0;
|
||||
@@ -76,23 +86,42 @@ namespace CampusAppWP8.Model.Utility
|
||||
return index;
|
||||
}
|
||||
|
||||
public void addItem(string value, string text)
|
||||
/// <summary>
|
||||
/// add an new item to the list
|
||||
/// </summary>
|
||||
/// <param name="value">value of the item</param>
|
||||
/// <param name="text">text of the item</param>
|
||||
public void AddItem(string value, string text)
|
||||
{
|
||||
this.addItem(new ListPickerItemModel(value, text));
|
||||
this.AddItem(new ListPickerItemModel(value, text));
|
||||
}
|
||||
|
||||
public void addItem(ListPickerItemModel item)
|
||||
/// <summary>
|
||||
/// add an new item to the list
|
||||
/// </summary>
|
||||
/// <param name="item">new item of the list</param>
|
||||
public void AddItem(ListPickerItemModel item)
|
||||
{
|
||||
this.list.Add(item);
|
||||
}
|
||||
|
||||
|
||||
public bool removeItem(string value, string text)
|
||||
/// <summary>
|
||||
/// remove an item
|
||||
/// </summary>
|
||||
/// <param name="value">value of the item</param>
|
||||
/// <param name="text">text of the item</param>
|
||||
/// <returns>true if removing was successful, otherwise false</returns>
|
||||
public bool RemoveItem(string value, string text)
|
||||
{
|
||||
return this.removeItem(new ListPickerItemModel(value, text));
|
||||
return this.RemoveItem(new ListPickerItemModel(value, text));
|
||||
}
|
||||
|
||||
public bool removeItem(ListPickerItemModel item)
|
||||
/// <summary>
|
||||
/// remove an item
|
||||
/// </summary>
|
||||
/// <param name="item">item which has to be remove</param>
|
||||
/// <returns>true if removing was successful, otherwise false</returns>
|
||||
public bool RemoveItem(ListPickerItemModel item)
|
||||
{
|
||||
return this.list.Remove(item);
|
||||
}
|
||||
@@ -101,7 +130,13 @@ namespace CampusAppWP8.Model.Utility
|
||||
|
||||
#region private
|
||||
|
||||
virtual protected void LoadList()
|
||||
/// <summary>
|
||||
/// Method load an default list
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// load an empty list
|
||||
/// </remarks>
|
||||
protected virtual void LoadList()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace CampusAppWP8.Model.Utility
|
||||
/// </summary>
|
||||
public class ListPickerItemModel
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListPickerItemModel" /> class.
|
||||
/// </summary>
|
||||
@@ -30,6 +29,7 @@ namespace CampusAppWP8.Model.Utility
|
||||
this.Value = value;
|
||||
this.Text = text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Value of an Item
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// <copyright file="RoleListPickerItemListModel .cs" company="BTU/IIT">
|
||||
// <copyright file="RoleListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
@@ -7,14 +7,16 @@
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the RoleList
|
||||
/// </summary>
|
||||
public class RoleListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// Initializes a new instance of the <see cref="RoleListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public RoleListPickerItemListModel()
|
||||
: base()
|
||||
@@ -27,10 +29,13 @@ namespace CampusAppWP8.Model.Utility
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.addItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STUDENT.ToString(), AppResources.Setting_RoleStudent));
|
||||
this.addItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STAFF.ToString(), AppResources.Setting_RoleStaff));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STUDENT.ToString(), AppResources.Setting_RoleStudent));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STAFF.ToString(), AppResources.Setting_RoleStaff));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -7,14 +7,16 @@
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the SemesterList
|
||||
/// </summary>
|
||||
public class SemesterListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// Initializes a new instance of the <see cref="SemesterListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public SemesterListPickerItemListModel()
|
||||
: base()
|
||||
@@ -27,11 +29,14 @@ namespace CampusAppWP8.Model.Utility
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.addItem(new ListPickerItemModel("20131", "SoSe 13"));
|
||||
this.addItem(new ListPickerItemModel("20132", "WiSe 13/14"));
|
||||
this.addItem(new ListPickerItemModel("20141", "SoSe 14"));
|
||||
this.AddItem(new ListPickerItemModel("20131", "SoSe 13"));
|
||||
this.AddItem(new ListPickerItemModel("20132", "WiSe 13/14"));
|
||||
this.AddItem(new ListPickerItemModel("20141", "SoSe 14"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -10,13 +10,11 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.Lecture;
|
||||
using CampusAppWP8.Model.Lecture;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,45 +1,55 @@
|
||||
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.Model.Setting;
|
||||
using CampusAppWP8.File.Setting;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UserProfil.xaml.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Setting;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the UserProfilePage
|
||||
/// </summary>
|
||||
public partial class UserProfil : PhoneApplicationPage
|
||||
{
|
||||
UserProfilFile userFile;
|
||||
/// <summary>
|
||||
/// Reference of the profileFile
|
||||
/// </summary>
|
||||
private UserProfilFile userFile;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserProfil" /> class.
|
||||
/// </summary>
|
||||
public UserProfil()
|
||||
{
|
||||
InitializeComponent();
|
||||
userFile = Settings.UserProfil;
|
||||
this.InitializeComponent();
|
||||
this.userFile = Settings.UserProfil;
|
||||
|
||||
this.SetupListPickers();
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom method
|
||||
/// </summary>
|
||||
/// <param name="e">Arguments of navigation</param>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
this.SaveProfile();
|
||||
if (NavigationMode.Back == e.NavigationMode)
|
||||
{
|
||||
this.SaveProfile();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Method sets the ItemSource of the ListPickers
|
||||
/// </summary>
|
||||
private void SetupListPickers()
|
||||
{
|
||||
CourseListPickerItemListModel courseList = new CourseListPickerItemListModel();
|
||||
@@ -52,20 +62,24 @@ namespace CampusAppWP8.Pages.Setting
|
||||
this.Semster.ItemsSource = semesterList.List;
|
||||
this.Role.ItemsSource = roleList.List;
|
||||
|
||||
this.Course.SelectedIndex = courseList.GetIndexOrDefault(userFile.Model.Course.ToString().PadLeft(3,'0'));
|
||||
this.Degree.SelectedIndex = degreeList.GetIndexOrDefault(userFile.Model.Degree.ToString());
|
||||
this.Semster.SelectedIndex = semesterList.GetIndexOrDefault(userFile.Model.Semester.ToString());
|
||||
this.Role.SelectedIndex = roleList.GetIndexOrDefault(userFile.Model.Role.ToString());
|
||||
this.Course.SelectedIndex = courseList.GetIndexOrDefault(this.userFile.Model.Course.ToString().PadLeft(3, '0'));
|
||||
this.Degree.SelectedIndex = degreeList.GetIndexOrDefault(this.userFile.Model.Degree.ToString());
|
||||
this.Semster.SelectedIndex = semesterList.GetIndexOrDefault(this.userFile.Model.Semester.ToString());
|
||||
this.Role.SelectedIndex = roleList.GetIndexOrDefault(this.userFile.Model.Role.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method save the current profile
|
||||
/// </summary>
|
||||
private void SaveProfile()
|
||||
{
|
||||
try
|
||||
{
|
||||
userFile.Model.Course = int.Parse(((ListPickerItemModel)this.Course.SelectedItem).Value);
|
||||
userFile.Model.Degree = (CampusAppWP8.Model.Setting.UserProfilModel.DegreeType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType), ((ListPickerItemModel)this.Degree.SelectedItem).Value);
|
||||
userFile.Model.Semester = int.Parse(((ListPickerItemModel)this.Semster.SelectedItem).Value);
|
||||
userFile.Model.Role = (CampusAppWP8.Model.Setting.UserProfilModel.RoleType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.RoleType), ((ListPickerItemModel)this.Role.SelectedItem).Value);
|
||||
this.userFile.Model.Course = int.Parse(((ListPickerItemModel)this.Course.SelectedItem).Value);
|
||||
this.userFile.Model.Degree = (CampusAppWP8.Model.Setting.UserProfilModel.DegreeType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType), ((ListPickerItemModel)this.Degree.SelectedItem).Value);
|
||||
this.userFile.Model.Semester = int.Parse(((ListPickerItemModel)this.Semster.SelectedItem).Value);
|
||||
this.userFile.Model.Role = (CampusAppWP8.Model.Setting.UserProfilModel.RoleType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.RoleType), ((ListPickerItemModel)this.Role.SelectedItem).Value);
|
||||
this.userFile.SaveData();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user