public IActionResult Index(MEnquiry mEnquiry) { if (!ModelState.IsValid) { return(View(mEnquiry)); } _context.MEnquiry.Add(mEnquiry); _context.SaveChanges(); TempData["Success"] = "Your Enquiry Save Successfully We'll Contact Back!!"; ModelState.Clear(); return(View()); }
public IActionResult ContactUs(MContactUs ObjmContactUs) { if (!ModelState.IsValid) { return(View(ObjmContactUs)); } _context.MContactUs.Add(ObjmContactUs); _context.SaveChanges(); SendMail(ObjmContactUs.CEmailId, ObjmContactUs.CSubject, ObjmContactUs.CMessage, ObjmContactUs.CName); return(RedirectToAction("ContactUsThanks", new { Name = ObjmContactUs.CName, Email = ObjmContactUs.CEmailId })); }