public ActionResult Index() { ViewBag.Message = ""; var model = new HomePageModel(); using (ProfileContext db = new ProfileContext()) { model.Mails = db.Mails.ToList(); model.UserSuggestions = db.UserSuggestions.ToList(); } return View(model); }
public ActionResult SendSuggestion(HomePageModel model) { SaveSuggestion(model.Email, model.UserName, model.Body); return RedirectToAction("Index","Home"); }
public ActionResult SendMail(HomePageModel model) { SendEmail(model.Email, model.UserName, model.Subject, model.Body); SaveEmail(model.Email, model.UserName, model.Subject, model.Body); return RedirectToAction("Index", "Home"); }