예제 #1
0
        public ActionResult Edit(NoteViewModel model)
        {
            NoteDto noteDto = new NoteDto
            {
                Id = model.Id,
                Text = model.Text
            };

            _notesService.EditNote(noteDto);

            return RedirectToAction("Index");
        }
예제 #2
0
        public ActionResult Edit(int id)
        {
            var noteDto = _notesService.GetNote(id);

            var model = new NoteViewModel
            {
                Text = noteDto.Text,
                Id = noteDto.Id
            };

            return View(model);
        }
예제 #3
0
        public ActionResult Add(NoteViewModel model)
        {
            _notesService.AddNote(model.Text);

            return RedirectToAction("Index");
        }
예제 #4
0
        public ActionResult Add()
        {
            NoteViewModel model = new NoteViewModel();

            return View(model);
        }