Example #1
0
		public static bool IsWeekLocked(int week)
		{
			using (var db = new SchedulesDb())
			{
				return db.Schedules.Where(s => s.Week == week).All(s => !s.IsPickable);
			}
		}
Example #2
0
		public static int GetWeekCount()
		{
			using (var db = new SchedulesDb())
			{
				return db.Schedules.Select(s => s.Week).Distinct().Count();
			}
		}
Example #3
0
 public static int? GetCurrentWeek()
 {
     using (var db = new SchedulesDb())
     {
         return db.Schedules.Where(s => s.Date >= DateTime.Now).Min(s => (int?)s.Week);
     }
 }
Example #4
0
		public static int GetCurrentWeek()
		{
			using (var db = new SchedulesDb())
			{
				if (db.Schedules == null || db.Schedules.Count() == 0)
				{
					return 0;
				}

				var maxWeek = db.Schedules.Max(s => s.Week);
				return db.Schedules.Where(s => s.Date >= DateTime.Now).Min(s => (int?)s.Week).GetValueOrDefault(maxWeek);
            }
		}