예제 #1
0
파일: TodoTest.cs 프로젝트: rcamara32/ToDo
        public void Edit_Existing_Todo()
        {
            var teste   = new TodoService(mockTodoRepository.Object);
            var retorno = teste.Edit(1, "bla bla bla");

            Assert.IsTrue(retorno);
        }
예제 #2
0
        void AppBarButton_Click_1(object sender, RoutedEventArgs e)
        {
            var start = new DateTime(datepic.Date.Year, datepic.Date.Month, datepic.Date.Day, timepic.Time.Hours, timepic.Time.Minutes, timepic.Time.Seconds);

            if (Title.Text == "")
            {
                ErrorText.Text = "Please set a title for this alarm.";
                return;
            }


            if (start < DateTime.Now)
            {
                ErrorText.Text = "Can't set a time in past.";
                return;
            }


            int notiftStatus = 0;

            if (rbs.IsChecked == true)
            {
                notiftStatus = 0;
            }

            if (rbn.IsChecked == true)
            {
                notiftStatus = 1;
            }

            if (rba.IsChecked == true)
            {
                notiftStatus = 2;
            }
            var todo = new Todo()
            {
                Subject   = Title.Text,
                Detail    = Details.Text,
                StartTime = start,
                Notify    = notiftStatus,
                Status    = 2
            };

            if (editmode)
            {
                todo.Id = editing.Id;
                _service.Edit(editing, todo);
            }
            else
            {
                _service.AddTodo(todo);
            }
            Frame.GoBack();
            this.Publish(new Classes.Header("Timeline"));
        }
예제 #3
0
        public ActionResult Edit(int id, string content)
        {
            try
            {
                service.Edit(id, content);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #4
0
        public IActionResult Edit(Todo task)
        {
            if (!ModelState.IsValid)
            {
                return(View(task));
            }

            // Add customer to DB
            service.Edit(task);

            // Redirect to index
            return(RedirectToAction("Create"));
        }
예제 #5
0
 public bool Edit(IEnumerable <Todo> todos)
 {
     return(todoService.Edit(todos));
 }