public static int checkPendingCard() { int num; using (var dbContext = new TODOContext()) { num = dbContext.Cards.Where(c => c.IsDone == false).Count(); } return(num); }
public static int checkOutOfDatelineCard() { int num; using (var dbContext = new TODOContext()) { num = dbContext.Cards.Where(c => c.EndTime < DateTime.Now) .Where(c => c.IsDone == false) .Where(c => c.Notification == true) .Count(); } return(num); }
private void timer1_Tick(object sender, EventArgs e) { using (var dbContext = new TODOContext()) { Noti = dbContext.UserSettings.Find(1).Noti; } if (Noti) { int num = CheckTask.checkOutOfDatelineCard(); if (num > 0) { AlertForm af = new AlertForm(); af.setAlert(String.Format("You have {0} unfinished cards !", num), AlertForm.alertTypeEnum.Warning); } } }