mirror of
				https://github.com/rudollee/LearningMVC.git
				synced 2025-10-31 02:07:13 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			707 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			707 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Web;
 | |
| using System.Web.Mvc;
 | |
| using PartyInvites.Models;
 | |
| 
 | |
| namespace PartyInvites.Controllers
 | |
| {
 | |
|     public class HomeController : Controller
 | |
|     {
 | |
|         // GET: Home
 | |
|         public ActionResult Index()
 | |
|         {
 | |
| 			int hour = DateTime.Now.Hour;
 | |
| 			//ViewBag.Greeting = hour < 12 ? "Good Morning" : "Good Afternoon";
 | |
|             return View();
 | |
|         }
 | |
| 
 | |
| 		[HttpGet]
 | |
| 		public ViewResult RsvpForm()
 | |
| 		{
 | |
| 			return View();
 | |
| 		}
 | |
| 
 | |
| 		[HttpPost]
 | |
| 		public ViewResult RsvpForm(GuestResponse guestResponse)
 | |
| 		{
 | |
| 			if (ModelState.IsValid)
 | |
| 			{
 | |
| 				return View("Thanks", guestResponse);
 | |
| 			}
 | |
| 			else
 | |
| 			{
 | |
| 				return View();
 | |
| 			}
 | |
| 		}
 | |
|     }
 | |
| } |