public async Task <IActionResult> Contact(Models.ContactUsModel model) { var authClient = await _repository.GetAuthorizedVantagePointClientAsync(); //set up the query string to post contacts: string requestUri = $"contact"; //this only works because the model and the contact class in VantagePoint //share the same names! var result = await _repository.PostAsync(authClient, requestUri, model); return(RedirectToAction("ThankYou", model)); }
public ActionResult ContactUs(Models.ContactUsModel model) { if (ModelState.IsValid) { ContactUs obj = new ContactUs(); obj.FullName = model.FullName; obj.EmailID = model.EmailID; obj.Subjects = model.Subject; obj.Comments = model.Comments; dbobj.ContactUs.Add(obj); dbobj.SaveChanges(); SendEmailToAdmin(obj); } ModelState.Clear(); return(RedirectToAction("ContactUs")); }
public IActionResult ThankYou(Models.ContactUsModel model) { ViewData["FirstName"] = model.FirstName; return(View()); }