add mealmodel
This commit is contained in:
@@ -99,6 +99,7 @@
|
||||
<Compile Include="Feed\Departments\DepartmentFavoriteFeed.cs" />
|
||||
<Compile Include="Const.cs" />
|
||||
<Compile Include="File\Setting\UserProfilFile.cs" />
|
||||
<Compile Include="Model\Mensa\MealModel.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
|
||||
|
||||
267
CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs
Normal file
267
CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs
Normal file
@@ -0,0 +1,267 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MealModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>06.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Mensa
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a meal
|
||||
/// </summary>
|
||||
public class MealModel
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the vegetarian icon
|
||||
/// </summary>
|
||||
private const string MealIconNameVegetarian = "CAROTTE";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the free icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFree = "FREI";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the pig icon
|
||||
/// </summary>
|
||||
private const string MealIconNamePig = "SCHWEIN";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the cow icon
|
||||
/// </summary>
|
||||
private const string MealIconNameCow = "RIND";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the fowl icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFowl = "GEFL";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the cow-pig icon
|
||||
/// </summary>
|
||||
private const string MealIconNameCowPig = "RINDSCHWEIN";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the fish icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFish = "FISCH";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the wild icon
|
||||
/// </summary>
|
||||
private const string MealIconNameWild = "WILD";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the lamb icon
|
||||
/// </summary>
|
||||
private const string MealIconNameLamb = "LAMM";
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the id of the meal
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ValueRange : 0 - 7
|
||||
/// </remarks>
|
||||
private int mealId;
|
||||
|
||||
/// <summary>
|
||||
/// Name of the meal
|
||||
/// </summary>
|
||||
private string mealName;
|
||||
|
||||
/// <summary>
|
||||
/// Name of the icon
|
||||
/// </summary>
|
||||
private string iconName;
|
||||
|
||||
/// <summary>
|
||||
/// Url of the icon
|
||||
/// </summary>
|
||||
private string iconUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Description of the meal
|
||||
/// </summary>
|
||||
private string mealDesc;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Proberty
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mealId
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ValueRange : 0 - 7
|
||||
/// </remarks>
|
||||
[XmlAttribute("id")]
|
||||
public int MealId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mealId;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.mealId && value > -1 && value < 8)
|
||||
{
|
||||
this.mealId = value;
|
||||
this.CreateMealName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mealName
|
||||
/// </summary>
|
||||
public string MealName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mealName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the iconName
|
||||
/// </summary>
|
||||
[XmlAttribute("icon")]
|
||||
public string IconName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.iconName;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.iconName)
|
||||
{
|
||||
this.iconName = value;
|
||||
this.CreateIconUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the iconUrl
|
||||
/// </summary>
|
||||
public string IconUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.iconUrl;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mealDescription
|
||||
/// </summary>
|
||||
[XmlAttribute("desc")]
|
||||
public string MealDesc
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mealDesc;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.mealDesc)
|
||||
{
|
||||
this.mealDesc = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Method create depends of the mealId the mealName
|
||||
/// </summary>
|
||||
private void CreateMealName()
|
||||
{
|
||||
switch (this.mealId)
|
||||
{
|
||||
case 0:
|
||||
this.mealName = AppResources.MensaApp_Soup;
|
||||
break;
|
||||
case 1:
|
||||
this.mealName = AppResources.MensaApp_Dinner1;
|
||||
break;
|
||||
case 2:
|
||||
this.mealName = AppResources.MensaApp_Dinner2;
|
||||
break;
|
||||
case 3:
|
||||
this.mealName = AppResources.MensaApp_Dinner3;
|
||||
break;
|
||||
case 4:
|
||||
this.mealName = AppResources.MensaApp_Dinner4;
|
||||
break;
|
||||
case 5:
|
||||
this.mealName = AppResources.MensaApp_Dinner5;
|
||||
break;
|
||||
case 6:
|
||||
this.mealName = AppResources.MensaApp_Bio;
|
||||
break;
|
||||
case 7:
|
||||
this.mealName = AppResources.MensaApp_Action;
|
||||
break;
|
||||
default:
|
||||
this.mealName = string.Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method create depends of the iconUrl the iconName
|
||||
/// </summary>
|
||||
private void CreateIconUrl()
|
||||
{
|
||||
switch (this.iconName)
|
||||
{
|
||||
case MealModel.MealIconNameVegetarian:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameFree:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameCowPig:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameFish:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameFowl:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameLamb:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNamePig:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameWild:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
case MealModel.MealIconNameCow:
|
||||
this.iconUrl = Icons.Info;
|
||||
break;
|
||||
default:
|
||||
this.iconUrl = string.Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,11 @@ namespace CampusAppWP8.Model.Mensa
|
||||
/// Time when the model was created
|
||||
/// </summary>
|
||||
private readonly DateTime createTime;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MenuWeekModel" /> class.
|
||||
/// </summary>
|
||||
@@ -33,7 +37,7 @@ namespace CampusAppWP8.Model.Mensa
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
#region Proberty
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the menus for the week
|
||||
@@ -42,9 +46,6 @@ namespace CampusAppWP8.Model.Mensa
|
||||
[XmlArrayItem("Tagesmenu")]
|
||||
public ObservableCollection<MenuModel> Menus { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Proberty
|
||||
/// <summary>
|
||||
/// Gets the creation time of the model
|
||||
/// </summary>
|
||||
|
||||
@@ -474,6 +474,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Essen 5 ähnelt.
|
||||
/// </summary>
|
||||
public static string MensaApp_Dinner5 {
|
||||
get {
|
||||
return ResourceManager.GetString("MensaApp_Dinner5", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 84 ähnelt.
|
||||
/// </summary>
|
||||
@@ -492,6 +501,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Suppe ähnelt.
|
||||
/// </summary>
|
||||
public static string MensaApp_Soup {
|
||||
get {
|
||||
return ResourceManager.GetString("MensaApp_Soup", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Mensaplan ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -353,4 +353,10 @@
|
||||
<data name="ListPickerHeaderSemester" xml:space="preserve">
|
||||
<value>Semesterauswahl</value>
|
||||
</data>
|
||||
<data name="MensaApp_Dinner5" xml:space="preserve">
|
||||
<value>Essen 5</value>
|
||||
</data>
|
||||
<data name="MensaApp_Soup" xml:space="preserve">
|
||||
<value>Suppe</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -222,6 +222,87 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die RIND ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Cow {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Cow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die RINDSCHWEIN ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_CowPig {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_CowPig", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die FISCH ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Fish {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Fish", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die GEFL ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Fowl {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Fowl", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die FREI ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Free {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Free", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die LAMM ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Lamb {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Lamb", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die SCHWEIN ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Pig {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Pig", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die CAROTTE ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Vegetarian {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Vegetarian", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die WILD ähnelt.
|
||||
/// </summary>
|
||||
public static string MealIconName_Wild {
|
||||
get {
|
||||
return ResourceManager.GetString("MealIconName_Wild", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
</data>
|
||||
<data name="IsolatedStorage_OpeninghoursModel" xml:space="preserve">
|
||||
<value>IsolatedStorage_OpeninghoursModel</value>
|
||||
</data>
|
||||
</data>
|
||||
<data name="FileProfil_User" xml:space="preserve">
|
||||
<value>user.xml</value>
|
||||
</data>
|
||||
@@ -306,4 +306,31 @@
|
||||
<data name="Valid_MaxCourseNumber" xml:space="preserve">
|
||||
<value>999</value>
|
||||
</data>
|
||||
<data name="MealIconName_Cow" xml:space="preserve">
|
||||
<value>RIND</value>
|
||||
</data>
|
||||
<data name="MealIconName_CowPig" xml:space="preserve">
|
||||
<value>RINDSCHWEIN</value>
|
||||
</data>
|
||||
<data name="MealIconName_Fish" xml:space="preserve">
|
||||
<value>FISCH</value>
|
||||
</data>
|
||||
<data name="MealIconName_Fowl" xml:space="preserve">
|
||||
<value>GEFL</value>
|
||||
</data>
|
||||
<data name="MealIconName_Free" xml:space="preserve">
|
||||
<value>FREI</value>
|
||||
</data>
|
||||
<data name="MealIconName_Lamb" xml:space="preserve">
|
||||
<value>LAMM</value>
|
||||
</data>
|
||||
<data name="MealIconName_Pig" xml:space="preserve">
|
||||
<value>SCHWEIN</value>
|
||||
</data>
|
||||
<data name="MealIconName_Vegetarian" xml:space="preserve">
|
||||
<value>CAROTTE</value>
|
||||
</data>
|
||||
<data name="MealIconName_Wild" xml:space="preserve">
|
||||
<value>WILD</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -123,6 +123,12 @@
|
||||
<data name="Campus" xml:space="preserve">
|
||||
<value>campus_159.png</value>
|
||||
</data>
|
||||
<data name="Cow" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="CowPig" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Delete" xml:space="preserve">
|
||||
<value>delete_159.png</value>
|
||||
</data>
|
||||
@@ -132,12 +138,24 @@
|
||||
<data name="Favorite" xml:space="preserve">
|
||||
<value>favorite_159.png</value>
|
||||
</data>
|
||||
<data name="Fish" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Fowl" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Free" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Homework" xml:space="preserve">
|
||||
<value>homework_159.png</value>
|
||||
</data>
|
||||
<data name="Info" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Lamb" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Lectures" xml:space="preserve">
|
||||
<value>lectures_159.png</value>
|
||||
</data>
|
||||
@@ -156,6 +174,9 @@
|
||||
<data name="Phone" xml:space="preserve">
|
||||
<value>phone_159.png</value>
|
||||
</data>
|
||||
<data name="Pig" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="Schedule" xml:space="preserve">
|
||||
<value>schedule_159.png</value>
|
||||
</data>
|
||||
@@ -168,7 +189,13 @@
|
||||
<data name="Update" xml:space="preserve">
|
||||
<value>update_159.png</value>
|
||||
</data>
|
||||
<data name="Vegetarian" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
<data name="WebMail" xml:space="preserve">
|
||||
<value>webmail_159.png</value>
|
||||
</data>
|
||||
<data name="Wild" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user