public static int GetToDoCountByWeek(ToDoListWeekManager toDoListWeekManager) { int currentWeek = DateTime.Now.DayOfYear / 7; int currentYear = DateTime.Now.Year; return(toDoListWeekManager.GetAll().Where(x => x.Week == currentWeek && x.Year == currentYear).ToList().Count); }
void ShowData() { if (toDoType == "Ozel") { int currentWeek = DateTime.Now.DayOfYear / 7; int currentYear = DateTime.Now.Year; dataGridView1.DataSource = toDoListWeekManager.GetAll().Where(x => x.Week == currentWeek && x.Year == currentYear).ToList(); dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[2].Visible = false; dataGridView1.Columns[3].Visible = false; dataGridView1.Columns[4].Visible = false; } else { dataGridView1.DataSource = toDoListWeekManager.GetAll(); } }
public static int GetToDoCountAll(ToDoListTodayManager today, ToDoListWeekManager week, ToDoListMonthManager month) { int countToday = today.GetAll().Count; int countWeek = week.GetAll().Count; int countMonth = month.GetAll().Count; int result = countToday + countWeek + countMonth; return(result); }
public void ShowToDoListWeek() { listBox2.Items.Clear(); int currentWeek = DateTime.Now.DayOfYear / 7; int currentYear = DateTime.Now.Year; List <ToDoListWeek> todos = toDoListWeekManager.GetAll().Where(x => x.Week == currentWeek && x.Year == currentYear).ToList(); for (int i = 0; i < todos.Count; i++) { listBox2.Items.Add((i + 1).ToString() + " - " + todos[i].Title + " - " + todos[i].Completed); } }