add event and news task
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user