Beispiel #1
0
        public static bool NoteDelete(Note note)
        {
            Note.DeleteNote(
                new NoteCriteria
                    {
                        NoteId = note.NoteId
                    });

            FeedService.FeedAdd("Deleted", note);

            return true;
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        public static Note NoteUpdate(Note note)
        {
            note = note.Save();

            FeedService.FeedAdd("Updated", note);

            return note;
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        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"];
 }