public static bool NoteDelete(Note note) { Note.DeleteNote( new NoteCriteria { NoteId = note.NoteId }); FeedService.FeedAdd("Deleted", note); return true; }
public NoteFormModel Map(Note note, NoteFormModel model, bool ignoreBrokenRules) { Csla.Data.DataMapper.Map(note, model, true); model.Tab = "Task"; model.IsNew = note.IsNew; model.IsValid = note.IsValid; if (!ignoreBrokenRules) { foreach (var brokenRule in note.BrokenRulesCollection) { this.ModelState.AddModelError(string.Empty, brokenRule.Description); } } return model; }
public static Note NoteUpdate(Note note) { note = note.Save(); FeedService.FeedAdd("Updated", note); return note; }
public static Note NoteSave(Note note) { if (!note.IsValid) { return note; } Note result; if (note.IsNew) { result = NoteService.NoteInsert(note); } else { result = NoteService.NoteUpdate(note); } return result; }
public static Note NoteInsert(Note note) { note = note.Save(); FeedService.FeedAdd("Created", note); return note; }
private void Map(FormCollection source, Note destination) { destination.Body = source["Body"]; }