Exemplo n.º 1
0
        protected string GetNoShowHtml()
        {
            StringBuilder html   = new StringBuilder();
            var           noData = ResponseRepository
                                   .GetRepository()
                                   .GetAllResponses().
                                   Where(r => !r.WillAttend.Value);

            foreach (var rsvp in noData)
            {
                html.Append(String.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td>",
                                          rsvp.Name, rsvp.Email, rsvp.Phone));
            }
            return(html.ToString());
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                GuestResponse rsvp = new GuestResponse();

                if (TryUpdateModel(rsvp, new FormValueProvider(ModelBindingExecutionContext)))
                {
                    ResponseRepository.GetRepository().AddResponse(rsvp);
                    if (rsvp.WillAttend.HasValue && rsvp.WillAttend.Value)
                    {
                        Response.Redirect("seeyouthere.html");
                    }
                    else
                    {
                        Response.Redirect("sorryyoucantcome.html");
                    }
                }
            }
        }