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

            _notesService.EditNote(noteDto);

            return RedirectToAction("Index");
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public ActionResult Add(NoteViewModel model)
        {
            _notesService.AddNote(model.Text);

            return RedirectToAction("Index");
        }
Esempio n. 4
0
        public ActionResult Add()
        {
            NoteViewModel model = new NoteViewModel();

            return View(model);
        }