public IActionResult Index(SunshinePeople sp) { if (ModelState.IsValid) { return(RedirectToAction("Index", "Home")); } else { return(View(sp)); } }
public IActionResult Appointments(IFormCollection data) { SunshinePeople sp = new SunshinePeople(); sp.FullName = data["full-name"]; sp.DateOfBirth = Convert.ToDateTime(data["dob"]); sp.AppointmentDate = Convert.ToDateTime(data["AppTime"]); //Add to database ViewData["Message"] = "Confimred your Appointment Successfully"; return(View()); }