e.g. 3.12 The Thanks View

chap3
Jason Zhu 2021-07-14 21:26:34 +10:00
parent a97e2ae35a
commit c53172cfb7
3 changed files with 31 additions and 2 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PartyInvites.Models;
namespace PartyInvites.Controllers
{
@ -34,10 +35,10 @@ namespace PartyInvites.Controllers
}
[HttpPost]
public ActionResult RsvpFrom()
public ActionResult RsvpForm(GuestResponse guestResponse)
{
// TODO: Email guestResponse to the part organizer
return View("Thanks", guestResponse);
return View("Thanks" ,guestResponse);
}
}
}

View File

@ -146,6 +146,7 @@
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Views\Home\RsvpForm.cshtml" />
<Content Include="Views\Home\Thanks.cshtml" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>

View File

@ -0,0 +1,27 @@
@model PartyInvites.Models.GuestResponse
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>Thanks</title>
</head>
<body>
<div>
<h1>Thank you, @Model.Name</h1>
@if (Model.WillAttend == true)
{
@:It's great that you're coming. The drinks are already in the fridge
}
else
{
@:Sorry to hear that you can't make it, but thanks for letting us know
}
</div>
</body>
</html>