add event and news task

This commit is contained in:
stubbfel
2013-09-17 13:48:37 +02:00
parent b0a8b8f6af
commit 98d8a43961
21 changed files with 1172 additions and 162 deletions

View File

@@ -62,41 +62,21 @@ namespace CampusAppWP8ScheduledTaskAgent.Model.Mensa
#region Methods
public string MealToString(string date)
{
string mealString = string.Empty;
foreach (MenuModel menu in this.Menus)
/// <summary>
/// Method calculate this day of the week, which its gets new menus
/// </summary>
/// <returns>Date of NewMenuWeekDay</returns>
public static DateTime CalcFirstWeekDay()
{
DateTime now = DateTime.Now;
while (now.DayOfWeek != DayOfWeek.Monday)
{
if (menu.Date.Equals(date))
{
foreach (MealModel meal in menu.Meals)
{
int lenght = meal.MealDesc.Length;
if (lenght > 30) {
lenght = 30;
}
mealString += meal.MealName + ": " + meal.MealDesc.Substring(0, lenght) +"...";
mealString = StringManager.AddNewLine(mealString);
}
return mealString;
}
now = now.Subtract(new TimeSpan(1, 0, 0, 0));
}
return mealString;
}
public int GetMealCount(string date)
{
foreach (MenuModel menu in this.Menus)
{
if (menu.Date.Equals(date))
{
return menu.Meals.Count;
}
}
return 0;
DateTime monday = new DateTime(now.Year, now.Month, now.Day);
return monday;
}
#endregion