public PartialViewResult Note() { var model = new Note(); ViewBag.EditMode = false; return PartialView(model); }
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); }
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); } }
public static void AddNote(Note note) { NotesList.instance.Notes.Add(note); }