Beispiel #1
0
        private async void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            var dao = new TodoDAO();

            _todos = await Todo.GetAllTodos(dao);

            lstTodos.ItemsSource = _todos;
        }
Beispiel #2
0
 private static void CheckChanged(RoutedEventArgs e)
 {
     var dao = new TodoDAO();
     var todo = ((e.Source as CheckBox).DataContext as Todo);
     if (todo != null)
     {
         todo.Complete(dao);
     }
 }
Beispiel #3
0
        private static void CheckChanged(RoutedEventArgs e)
        {
            var dao  = new TodoDAO();
            var todo = ((e.Source as CheckBox).DataContext as Todo);

            if (todo != null)
            {
                todo.Complete(dao);
            }
        }
Beispiel #4
0
 public static async Task <ObservableCollection <Todo> > GetAllTodos(TodoDAO dao)
 {
     try
     {
         return(await dao.GetTodos());
     }
     catch
     {
         throw new ApplicationException("Error retrieving todo items.");
     }
 }
Beispiel #5
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            _todo.Task = txtTask.Text;
            _todo.CreateDate = DateTime.Now;
            _todo.DueDate = dtpDueDate.SelectedDate.Value;

            var dao = new TodoDAO();
            dao.AddTodo(_todo);
            this.DialogResult = true;
            this.Close();
        }
Beispiel #6
0
        public static async Task<ObservableCollection<Todo>> GetAllTodos(TodoDAO dao)
        {
            try
            {
                return await dao.GetTodos();
            }
            catch
            {
                throw new ApplicationException("Error retrieving todo items.");
            }

        }
Beispiel #7
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            _todo.Task       = txtTask.Text;
            _todo.CreateDate = DateTime.Now;
            _todo.DueDate    = dtpDueDate.SelectedDate.Value;

            var dao = new TodoDAO();

            dao.AddTodo(_todo);
            this.DialogResult = true;
            this.Close();
        }
Beispiel #8
0
 public void Complete(TodoDAO dao)
 {
     dao.SetComplete(this);
 }
Beispiel #9
0
 private async void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     var dao = new TodoDAO();
     _todos = await Todo.GetAllTodos(dao);
     lstTodos.ItemsSource = _todos;
 }
Beispiel #10
0
 public void Complete(TodoDAO dao)
 {
     dao.SetComplete(this);
 }