Exemplo n.º 1
0
        private GuestBook GetGuestbook()
        {
            var messages = this.agent.GetGuestBookMessages();

            var guestbook = new GuestBook
                                {
                                    GuestBookMessages = messages
                                };
            return guestbook;
        }
Exemplo n.º 2
0
        public ActionResult Send(GuestBookMessage guestBookMessage)
        {
            if (!ModelState.IsValid)
            {
                var guestbook = new GuestBook
                                    {
                                        GuestBookMessages = this.agent.GetGuestBookMessages()
                                    };

                return this.View("Index", guestbook);
            }

            agent.SaveGuestBookMessage(guestBookMessage);

            return this.RedirectToAction("Index");
        }