Exemplo n.º 1
0
        public ActionResult Edit(ChangeNoteText command)
        {
            ChannelHelper.Use(NoteController.channelFactory.CreateChannel(), (client) => client.Execute(new ExecuteRequest(command)));

            // Return user back to the index that
            // displays all the notes.));
            return(RedirectToAction("Index", "Note"));
        }
Exemplo n.º 2
0
        public ActionResult Edit(ChangeNoteText command)
        {
            var service = new MyNotesCommandServiceClient();

            service.ChangeNoteText(command);

            // Return user back to the index that
            // displays all the notes.));
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        public ActionResult Edit(Guid id)
        {
            NoteItem item;

            using (var context = new ReadModelContainer())
            {
                item = context.NoteItemSet.Single(note => note.Id == id);
            }

            var command = new ChangeNoteText();

            command.NoteId  = id;
            command.NewText = item.Text;

            return(View(command));
        }
Exemplo n.º 4
0
        public ActionResult Edit(Guid id)
        {
            Note note;

            using (var context = new ReadModelContext())
            {
                note = context.Notes.Single(n => n.Id == id);
            }

            var command = new ChangeNoteText();

            command.Id   = id;
            command.Text = note.Text;

            return(View(command));
        }
Exemplo n.º 5
0
        public ActionResult Edit(ChangeNoteText command)
        {
            Guid summaryId;

            using (var context = new ReadModelContainer())
            {
                var query = from item in context.TotalsPerDayItemSet
                            where item.Date == System.DateTime.Today
                            orderby item.Date descending
                            select item.SummaryId;

                Guid.TryParse(query.ToString(), out summaryId);
            }
            command.SummaryId = summaryId;

            var service = new MyNotesCommandServiceClient();

            service.ChangeNoteText(command);

            // Return user back to the index that
            // displays all the notes.));
            return(RedirectToAction("Index"));
        }
Exemplo n.º 6
0
 public void ChangeNoteText(ChangeNoteText command)
 {
     _service.Execute(command);
 }