diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/info_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/info_159.png index 1ad39f71..f95a93ca 100644 Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/info_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/info_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 847a75fc..cc5f5a59 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -99,6 +99,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs b/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs new file mode 100644 index 00000000..4f59203d --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs @@ -0,0 +1,268 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 06.08.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Mensa +{ + using System.Xml.Serialization; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + + /// + /// Model for a meal + /// + public class MealModel + { + #region Members + + /// + /// Constant for the vegetarian icon + /// + private const string MealIconNameVegetarian = "CARROTTE"; + + /// + /// Constant for the free icon + /// + private const string MealIconNameFree = "FREI"; + + /// + /// Constant for the pig icon + /// + private const string MealIconNamePig = "SCHWEIN"; + + /// + /// Constant for the cow icon + /// + private const string MealIconNameCow = "RIND"; + + /// + /// Constant for the fowl icon + /// + private const string MealIconNameFowl = "GEFL"; + + /// + /// Constant for the cow-pig icon + /// + private const string MealIconNameCowPig = "RINDSCHWEIN"; + + /// + /// Constant for the fish icon + /// + private const string MealIconNameFish = "FISCH"; + + /// + /// Constant for the wild icon + /// + private const string MealIconNameWild = "WILD"; + + /// + /// Constant for the lamb icon + /// + private const string MealIconNameLamb = "LAMM"; + + /// + /// Variable for the id of the meal + /// + /// + /// ValueRange : 0 - 7 + /// + private int mealId; + + /// + /// Name of the meal + /// + private string mealName; + + /// + /// Name of the icon + /// + private string iconName; + + /// + /// Url of the icon + /// + private string iconUrl; + + /// + /// Description of the meal + /// + private string mealDesc; + + #endregion + + #region Proberty + + /// + /// Gets or sets the mealId + /// + /// + /// ValueRange : 0 - 7 + /// + [XmlAttribute("id")] + public int MealId + { + get + { + return this.mealId; + } + + set + { + if (value > -1 && value < 8) + { + this.mealId = value; + this.CreateMealName(); + } + } + } + + /// + /// Gets the mealName + /// + public string MealName + { + get + { + return this.mealName; + } + } + + /// + /// Gets or sets the iconName + /// + [XmlAttribute("icon")] + public string IconName + { + get + { + return this.iconName; + } + + set + { + if (value != this.iconName) + { + this.iconName = value; + this.CreateIconUrl(); + } + } + } + + /// + /// Gets the iconUrl + /// + public string IconUrl + { + get + { + return this.iconUrl; + } + } + + /// + /// Gets or sets the mealDescription + /// + [XmlAttribute("desc")] + public string MealDesc + { + get + { + return this.mealDesc; + } + + set + { + if (value != this.mealDesc) + { + this.mealDesc = StringManager.StripHTML(value); + } + } + } + + #endregion + + #region Methods + + /// + /// Method create depends of the mealId the mealName + /// + 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; + } + } + + /// + /// Method create depends of the iconUrl the iconName + /// + 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 + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuModel.cs b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuModel.cs index 06d3aa34..b9ef20f1 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuModel.cs @@ -11,6 +11,8 @@ namespace CampusAppWP8.Model.Mensa using System.Xml.Serialization; using CampusAppWP8.Resources; using CampusAppWP8.Utility; + using System.Collections.ObjectModel; + using System.Globalization; /// /// Model for menu @@ -19,36 +21,6 @@ namespace CampusAppWP8.Model.Mensa { #region Member - /// - /// Name for bio dinner - /// - private string bio = AppResources.MensaApp_NotToday; - - /// - /// Name for 1. dinner - /// - private string dinner1 = AppResources.MensaApp_NotToday; - - /// - /// Name for 2. dinner - /// - private string dinner2 = AppResources.MensaApp_NotToday; - - /// - /// Name for 3. dinner - /// - private string dinner3 = AppResources.MensaApp_NotToday; - - /// - /// Name for 4. dinner - /// - private string dinner4 = AppResources.MensaApp_NotToday; - - /// - /// Name for action dinner - /// - private string action = AppResources.MensaApp_NotToday; - /// /// Name of the day /// @@ -57,7 +29,7 @@ namespace CampusAppWP8.Model.Mensa /// /// DateTime of the day /// - private DateTime date; + private string date; /// /// DateTime of the monday @@ -80,10 +52,16 @@ namespace CampusAppWP8.Model.Mensa #region Property + /// + /// Gets or sets the menus for the week + /// + [XmlElement("Meal")] + public ObservableCollection Meals { get; set; } + /// /// Gets or sets the WeekDay /// - [XmlElement("Wochentag")] + [XmlAttribute("day")] public string Day { get @@ -93,19 +71,22 @@ namespace CampusAppWP8.Model.Mensa set { - this.SetValue(value, ref this.dayName); - this.CalcDateOfDay(); + if (value != this.dayName) + { + this.dayName = value; + } } } /// /// Gets or sets of Date /// - public DateTime Date + [XmlAttribute("date")] + public string Date { get { - return this.date; + return this.date.ToString(); } set @@ -117,153 +98,6 @@ namespace CampusAppWP8.Model.Mensa } } - /// - /// Gets or sets dinner 1 - /// - [XmlElement("Essen1")] - public string Dinner1 - { - get - { - return this.dinner1; - } - - set - { - this.SetValue(value, ref this.dinner1); - } - } - - /// - /// Gets or sets dinner 2 - /// - [XmlElement("Essen2")] - public string Dinner2 - { - get - { - return this.dinner2; - } - - set - { - this.SetValue(value, ref this.dinner2); - } - } - - /// - /// Gets or sets dinner 3 - /// - [XmlElement("Essen3")] - public string Dinner3 - { - get - { - return this.dinner3; - } - - set - { - this.SetValue(value, ref this.dinner3); - } - } - - /// - /// Gets or sets dinner 4 - /// - [XmlElement("Essen4")] - public string Dinner4 - { - get - { - return this.dinner4; - } - - set - { - this.SetValue(value, ref this.dinner4); - } - } - - /// - /// Gets or sets dinner bio - /// - [XmlElement("Bio")] - public string Bio - { - get - { - return this.bio; - } - - set - { - this.SetValue(value, ref this.bio); - } - } - - /// - /// Gets or sets dinner action - /// - [XmlElement("Aktionstag")] - public string Action - { - get - { - return this.action; - } - - set - { - this.SetValue(value, ref this.action); - } - } - - #endregion - - #region Method - - /// - /// Methods sets the property - /// - /// maybe move to base class - /// new property value - /// name of the property - private void SetValue(string value, ref string property) - { - if (value != null && !string.Empty.Equals(value) && !value.Equals(property)) - { - property = StringManager.StripHTML(value); - } - } - - /// - /// Method calculate the DateTime of the MenuDay - /// - private void CalcDateOfDay() - { - switch (this.dayName) - { - case "Montag": - this.date = this.monday; - break; - case "Diensttag": - this.date = this.monday.AddDays(1); - break; - case "Mittwoch": - this.date = this.monday.AddDays(2); - break; - case "Donnerstag": - this.date = this.monday.AddDays(3); - break; - case "Freitag": - this.date = this.monday.AddDays(4); - break; - default: - this.date = this.monday; - break; - } - } #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs index 4093eae8..1451075b 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs @@ -22,7 +22,11 @@ namespace CampusAppWP8.Model.Mensa /// Time when the model was created /// private readonly DateTime createTime; + + #endregion + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -33,18 +37,15 @@ namespace CampusAppWP8.Model.Mensa #endregion - #region Constructor + #region Proberty /// /// Gets or sets the menus for the week /// - [XmlArray("BTU")] - [XmlArrayItem("Tagesmenu")] + [XmlArray("Mealplan")] + [XmlArrayItem("Menu")] public ObservableCollection Menus { get; set; } - #endregion - - #region Proberty /// /// Gets the creation time of the model /// diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index 26787ad5..c8dbc61b 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -55,7 +55,7 @@ - + @@ -77,7 +77,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -141,7 +141,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml index d3813f39..b663f264 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml @@ -19,127 +19,47 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs index 18bd2c01..46d5f76d 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs @@ -34,6 +34,11 @@ namespace CampusAppWP8.Pages.Mensa /// private int selectedIndex; + /// + /// Flag indicate that the feed was refreshed + /// + private bool refreshed = false; + #endregion #region Constructor @@ -75,7 +80,7 @@ namespace CampusAppWP8.Pages.Mensa /// Arguments of navigation protected override void OnNavigatedFrom(NavigationEventArgs e) { - this.feed.SaveData(); + this.feed.SaveData(this.refreshed); } #endregion @@ -151,6 +156,7 @@ namespace CampusAppWP8.Pages.Mensa { this.ProgressBar.Visibility = System.Windows.Visibility.Visible; this.feed.ForceWebUpdate(); + this.refreshed = true; } #endregion diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml index 0db945a9..027aa00f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml @@ -45,7 +45,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 9e14041b..e9372b2d 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -303,15 +303,6 @@ namespace CampusAppWP8.Resources { } } - /// - /// Sucht eine lokalisierte Zeichenfolge, die Studiengangauswahl ähnelt. - /// - public static string LectureApp_ListPickerHeaderCourse { - get { - return ResourceManager.GetString("LectureApp_ListPickerHeaderCourse", resourceCulture); - } - } - /// /// Sucht eine lokalisierte Zeichenfolge, die Verantwortlicher ähnelt. /// @@ -384,6 +375,42 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Studiengangsauswahl ähnelt. + /// + public static string ListPickerHeaderCourse { + get { + return ResourceManager.GetString("ListPickerHeaderCourse", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Abschlussauswahl ähnelt. + /// + public static string ListPickerHeaderDegree { + get { + return ResourceManager.GetString("ListPickerHeaderDegree", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Rollenauswahl ähnelt. + /// + public static string ListPickerHeaderRole { + get { + return ResourceManager.GetString("ListPickerHeaderRole", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Semesterauswahl ähnelt. + /// + public static string ListPickerHeaderSemester { + get { + return ResourceManager.GetString("ListPickerHeaderSemester", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Webmail ähnelt. /// @@ -447,6 +474,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Essen 5 ähnelt. + /// + public static string MensaApp_Dinner5 { + get { + return ResourceManager.GetString("MensaApp_Dinner5", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die 84 ähnelt. /// @@ -465,6 +501,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Suppe ähnelt. + /// + public static string MensaApp_Soup { + get { + return ResourceManager.GetString("MensaApp_Soup", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Mensaplan ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index 350cd768..af5596e0 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -269,9 +269,6 @@ Master - - Studiengangauswahl - Gebäude @@ -344,4 +341,22 @@ Student + + Studiengangsauswahl + + + Abschlussauswahl + + + Rollenauswahl + + + Semesterauswahl + + + Essen 5 + + + Suppe + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index 479a1426..1b6ef17d 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -222,6 +222,87 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die RIND ähnelt. + /// + public static string MealIconName_Cow { + get { + return ResourceManager.GetString("MealIconName_Cow", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die RINDSCHWEIN ähnelt. + /// + public static string MealIconName_CowPig { + get { + return ResourceManager.GetString("MealIconName_CowPig", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FISCH ähnelt. + /// + public static string MealIconName_Fish { + get { + return ResourceManager.GetString("MealIconName_Fish", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die GEFL ähnelt. + /// + public static string MealIconName_Fowl { + get { + return ResourceManager.GetString("MealIconName_Fowl", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FREI ähnelt. + /// + public static string MealIconName_Free { + get { + return ResourceManager.GetString("MealIconName_Free", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die LAMM ähnelt. + /// + public static string MealIconName_Lamb { + get { + return ResourceManager.GetString("MealIconName_Lamb", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die SCHWEIN ähnelt. + /// + public static string MealIconName_Pig { + get { + return ResourceManager.GetString("MealIconName_Pig", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die CAROTTE ähnelt. + /// + public static string MealIconName_Vegetarian { + get { + return ResourceManager.GetString("MealIconName_Vegetarian", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die WILD ähnelt. + /// + public static string MealIconName_Wild { + get { + return ResourceManager.GetString("MealIconName_Wild", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt. /// @@ -547,7 +628,7 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/ ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/Studentenwerk/index.php?mensa=CottbusBTU&v=1 ähnelt. /// public static string UrlMensa_Week { get { diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index ba9aa34f..8520e922 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -256,7 +256,7 @@ EventsFeed.xml - http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/ + http://www.tu-cottbus.de/campusapp-data/Studentenwerk/index.php?mensa=CottbusBTU&v=1 OpeninghoursFeed.xml @@ -284,7 +284,7 @@ IsolatedStorage_OpeninghoursModel - + user.xml @@ -306,4 +306,31 @@ 999 + + RIND + + + RINDSCHWEIN + + + FISCH + + + GEFL + + + FREI + + + LAMM + + + SCHWEIN + + + CAROTTE + + + WILD + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index cc44f12f..5f901171 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -123,6 +123,12 @@ campus_159.png + + info_159.png + + + info_159.png + delete_159.png @@ -132,12 +138,24 @@ favorite_159.png + + info_159.png + + + info_159.png + + + info_159.png + homework_159.png info_159.png + + info_159.png + lectures_159.png @@ -156,6 +174,9 @@ phone_159.png + + info_159.png + schedule_159.png @@ -168,7 +189,13 @@ update_159.png + + info_159.png + webmail_159.png + + info_159.png + \ No newline at end of file