104 lines
2.3 KiB
C#
104 lines
2.3 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="MenuModel.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>04.05.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
namespace CampusAppWP8.Model.Mensa
|
|
{
|
|
using System;
|
|
using System.Xml.Serialization;
|
|
using CampusAppWP8.Resources;
|
|
using CampusAppWP8.Utility;
|
|
using System.Collections.ObjectModel;
|
|
using System.Globalization;
|
|
|
|
/// <summary>
|
|
/// Model for menu
|
|
/// </summary>
|
|
public class MenuModel
|
|
{
|
|
#region Member
|
|
|
|
/// <summary>
|
|
/// Name of the day
|
|
/// </summary>
|
|
private string dayName;
|
|
|
|
/// <summary>
|
|
/// DateTime of the day
|
|
/// </summary>
|
|
private string date;
|
|
|
|
/// <summary>
|
|
/// DateTime of the monday
|
|
/// </summary>
|
|
private DateTime monday;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="MenuModel" /> class.
|
|
/// </summary>
|
|
public MenuModel()
|
|
{
|
|
this.monday = MenuWeekModel.CalcFirstWeekDay();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Property
|
|
|
|
/// <summary>
|
|
/// Gets or sets the menus for the week
|
|
/// </summary>
|
|
[XmlElement("Meal")]
|
|
public ObservableCollection<MealModel> Meals { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the WeekDay
|
|
/// </summary>
|
|
[XmlAttribute("day")]
|
|
public string Day
|
|
{
|
|
get
|
|
{
|
|
return this.dayName;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.dayName)
|
|
{
|
|
this.dayName = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets of Date
|
|
/// </summary>
|
|
[XmlAttribute("date")]
|
|
public string Date
|
|
{
|
|
get
|
|
{
|
|
return this.date.ToString();
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != this.date)
|
|
{
|
|
this.date = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|