public ActionResult Update(int id, Note note) { var original = _repository.FindById<Note>(id); original.NoteText = note.NoteText; _repository.Commit(); _appScope.AddSuccess("Note was successfully updated."); return new EmptyResult(); }
public ActionResult Create(int contactId, Note note) { var contact = _repository.FindById<Contact>(contactId); note.DateAdded = DateTime.Now; contact.AddNote(note); _repository.Commit(); _appScope.AddSuccess(string.Format("Note was successfully created for {0}", contact.EmailAddress)); return RedirectToAction("Index", new { contactId }); }
public ActionResult New(int contactId) { var note = new Note(); return View(note); }
public virtual void RemoveNote(Note note) { Notes.Remove(note); }
public virtual void AddNote(Note note) { note.Contact = this; Notes.Add(note); }