Beispiel #1
0
        public PartialViewResult Note()
        {
            var model = new Note();

            ViewBag.EditMode = false;
            return PartialView(model);
        }
Beispiel #2
0
        public PartialViewResult EditNote(Note note)
        {
            var model = NotesList.Instance.Notes.First(x => x.Id == note.Id);

            NotesList.Instance.Notes.Remove(model);
            NotesList.AddNote(note);

            return PartialView("Notes", NotesList.Instance.Notes);
        }
Beispiel #3
0
 public ActionResult AddNote(Note note)
 {
     if (ModelState.IsValid)
     {
         NotesList.AddNote(note);
         return PartialView("Notes", NotesList.Instance.Notes);
     }
     else
     {
         ViewBag.EditMode = false;
         return View("Note", note);
     }
 }
Beispiel #4
0
 public static void AddNote(Note note)
 {
     NotesList.instance.Notes.Add(note);
 }