Пример #1
0
        private void listConfirm_Click(object sender, RoutedEventArgs e)
        {
            ToDoList _newList = new ToDoList();

            _newList.created_at     = DateTime.Now;
            _newList.ToDoListUserId = _user.UserId;
            _newList.name           = listName.Text;

            _toDoListRepository.Insert(_newList);
            _toDoListRepository.Save();

            _main.Populate();
            _main.RefreshList();

            this.Close();
        }
Пример #2
0
        private void MenuItemDelete_Click(object sender, RoutedEventArgs e)
        {
            int listId = 0;

            if (lbTodoList.SelectedItem != null)
            {
                listId = (lbTodoList.SelectedItem as ToDoList).ToDoListId;
            }
            else
            {
                return;
            }

            _toDoListRepository.Delete(listId);

            _toDoListRepository.Save();

            Populate();
            RefreshList();
        }