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

            ViewBag.EditMode = false;
            return PartialView(model);
        }
예제 #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);
        }
예제 #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);
     }
 }
예제 #4
0
 public static void AddNote(Note note)
 {
     NotesList.instance.Notes.Add(note);
 }