add LecturepageModel

This commit is contained in:
stubbfel
2013-06-18 10:34:09 +02:00
parent 919c1f8d08
commit 8f472d7662
4 changed files with 188 additions and 82 deletions

View File

@@ -109,6 +109,7 @@
<Compile Include="Model\Lecture\LectureLecturer.cs" />
<Compile Include="Model\Lecture\LectureList.cs" />
<Compile Include="Model\Lecture\LectureModule.cs" />
<Compile Include="Model\Lecture\LecturePageModel.cs" />
<Compile Include="Model\Mensa\MenuModel.cs" />
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
<Compile Include="Model\Utility\UrlParamModel.cs" />

View File

@@ -0,0 +1,171 @@
//-----------------------------------------------------------------------
// <copyright file="LecturePageModel.xaml.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>18.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
{
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using System.Collections.Generic;
public class LecturePageModel
{
#region Members
/// <summary>
/// List for the courses of the BTU
/// </summary>
/// <remarks>
/// need to be extend to full list
/// </remarks>
private List<ListPickerItemModel> courseList;
/// <summary>
/// List of the degrees
/// </summary>
private List<ListPickerItemModel> degreeList;
/// <summary>
/// List of the semester
/// </summary>
private List<ListPickerItemModel> semesterList;
/// <summary>
/// List for the number of semester
/// </summary>
private List<ListPickerItemModel> numberList;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="LecturePageModel" /> class.
/// </summary>
public LecturePageModel()
{
}
#endregion
#region Proberty
/// <summary>
/// Gets List for the courses of the BTU
/// </summary>
/// <remarks>
/// need to be extend to full list
/// </remarks>
public List<ListPickerItemModel> CourseList
{
get
{
return this.courseList;
}
}
/// <summary>
/// Gets List of the degrees
/// </summary>
public List<ListPickerItemModel> DegreeList
{
get
{
return this.degreeList;
}
}
/// <summary>
/// Gets List of the semester
/// </summary>
public List<ListPickerItemModel> SemesterList
{
get
{
return this.semesterList;
}
}
/// <summary>
/// Gets List for the number of semester
/// </summary>
public List<ListPickerItemModel> NumberList
{
get
{
return this.numberList;
}
}
#endregion
#region Methods
#region public
/// <summary>
/// Load all ListpickerLists
/// </summary>
public void LoadLists()
{
this.LoadCourseList();
this.LoadDegreeList();
this.LoadNumberList();
this.LoadSemesterList();
}
#endregion
#region private
/// <summary>
/// Load the NumberList
/// </summary>
private void LoadNumberList()
{
this.numberList = new List<ListPickerItemModel>();
this.numberList.Add(new ListPickerItemModel() { Text = "1", Value = "1" });
this.numberList.Add(new ListPickerItemModel() { Text = "2", Value = "2" });
this.numberList.Add(new ListPickerItemModel() { Text = "3", Value = "3" });
this.numberList.Add(new ListPickerItemModel() { Text = "4", Value = "4" });
}
/// <summary>
/// Load the SemesterList
/// </summary>
private void LoadSemesterList()
{
this.semesterList = new List<ListPickerItemModel>();
this.semesterList.Add(new ListPickerItemModel() { Text = "SoSe 13", Value = "20131" });
this.semesterList.Add(new ListPickerItemModel() { Text = "WiSe 13/14", Value = "20132" });
this.semesterList.Add(new ListPickerItemModel() { Text = "SoSe 14", Value = "20131" });
}
/// <summary>
/// Load the DegreeList
/// </summary>
private void LoadDegreeList()
{
this.degreeList = new List<ListPickerItemModel>();
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Bachelor, Value = "82" });
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Master, Value = "88" });
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Diploma, Value = "11" });
}
/// <summary>
/// Load the DegreeList
/// </summary>
private void LoadCourseList()
{
this.courseList = new List<ListPickerItemModel>();
this.courseList.Add(new ListPickerItemModel() { Text = "Architektur", Value = "013" });
this.courseList.Add(new ListPickerItemModel() { Text = "Bauingenieurwesen", Value = "017" });
this.courseList.Add(new ListPickerItemModel() { Text = "Betriebswirtschaftslehre", Value = "021" });
}
#endregion
#endregion
}
}

View File

@@ -36,82 +36,7 @@ namespace CampusAppWP8.Pages.Lecture
/// <remarks>
/// need to be extend to full list
/// </remarks>
private List<ListPickerItemModel> courseList = new List<ListPickerItemModel>()
{
new ListPickerItemModel()
{
Text = "Architektur", Value = "013"
},
new ListPickerItemModel()
{
Text = "Bauingenieurwesen", Value = "017"
},
new ListPickerItemModel()
{
Text = "Betriebswirtschaftslehre", Value = "021"
}
};
/// <summary>
/// List of the degrees
/// </summary>
private List<ListPickerItemModel> degreeList = new List<ListPickerItemModel>()
{
new ListPickerItemModel()
{
Text = AppResources.Degree_Bachelor, Value = "82"
},
new ListPickerItemModel()
{
Text = AppResources.Degree_Master, Value = "88"
},
new ListPickerItemModel()
{
Text = AppResources.Degree_Diploma, Value = "11"
}
};
/// <summary>
/// List of the semester
/// </summary>
private List<ListPickerItemModel> semesterList = new List<ListPickerItemModel>()
{
new ListPickerItemModel()
{
Text = "SoSe 13", Value = "20131"
},
new ListPickerItemModel()
{
Text = "WiSe 13/14", Value = "20132"
},
new ListPickerItemModel()
{
Text = "SoSe 14", Value = "20141"
}
};
/// <summary>
/// List for the number of semester
/// </summary>
private List<ListPickerItemModel> numberList = new List<ListPickerItemModel>()
{
new ListPickerItemModel()
{
Text = "1", Value = "1"
},
new ListPickerItemModel()
{
Text = "2", Value = "2"
},
new ListPickerItemModel()
{
Text = "3", Value = "3"
},
new ListPickerItemModel()
{
Text = "4", Value = "4"
}
};
private LecturePageModel pageModel;
/// <summary>
/// Initializes a new instance of the <see cref="LecturePage" /> class.
@@ -119,6 +44,7 @@ namespace CampusAppWP8.Pages.Lecture
public LecturePage()
{
this.InitializeComponent();
this.LoadPageModel();
this.SetupListPickers();
if ((Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible)
{
@@ -126,16 +52,24 @@ namespace CampusAppWP8.Pages.Lecture
}
}
/// <summary>
/// Load the PageModel
/// </summary>
private void LoadPageModel()
{
this.pageModel = new LecturePageModel();
this.pageModel.LoadLists();
}
/// <summary>
/// Method sets the ItemSource of the ListPickers
/// </summary>
private void SetupListPickers()
{
this.Course.ItemsSource = this.courseList;
this.Degree.ItemsSource = this.degreeList;
this.From.ItemsSource = this.numberList;
this.To.ItemsSource = this.numberList;
this.Semester.ItemsSource = this.semesterList;
this.Course.ItemsSource = pageModel.CourseList;
this.Degree.ItemsSource = pageModel.DegreeList;
this.From.ItemsSource = pageModel.NumberList;
this.To.ItemsSource = pageModel.NumberList;
this.Semester.ItemsSource = pageModel.SemesterList;
}
/// <summary>

View File

@@ -13,7 +13,7 @@
<Capability Name="ID_CAP_ISV_CAMERA" />
</Capabilities>
<Tasks>
<DefaultTask Name="_default" NavigationPage="pages/StartPage.xaml" />
<DefaultTask Name="_default" NavigationPage="pages/Lecture/LecturePage.xaml" />
</Tasks>
<Tokens>
<PrimaryToken TokenID="CampusAppWP8Token" TaskName="_default">