コード例 #1
0
        public ActionResult Remove(int?id)
        {
            var toDoViewModel = new ToDoCollectionViewModel();

            if (id != null)
            {
                _toDoService.RemoveToDo(id.Value);
            }

            toDoViewModel.ToDoCollection = _toDoService.GetAll();

            return(View("Index", toDoViewModel));
        }
コード例 #2
0
        public ActionResult Complete(int?id, bool complete)
        {
            var toDoViewModel = new ToDoCollectionViewModel();

            if (id != null)
            {
                _toDoService.CompleteToDo(id.Value, complete);
            }

            toDoViewModel.ToDoCollection = _toDoService.GetAll();

            return(View("Index", toDoViewModel));
        }
コード例 #3
0
        public ActionResult Index(string newDescription)
        {
            var toDoViewModel = new ToDoCollectionViewModel();

            if (!string.IsNullOrEmpty(newDescription))
            {
                toDoViewModel.Added = _toDoService.AddNewToDo(newDescription);
            }

            toDoViewModel.ToDoCollection = _toDoService.GetAll();

            return(View(toDoViewModel));
        }