public ActionResult Create(User user) { if (ModelState.IsValid) { db.Users.Add(user); db.SaveChanges(); if (user.Email != null) { try { EmailHelper.SendEmail(user.Email, "FelixAndRover Registration", "<h1>Registration Successful</h1><p>You have successfully registered to Felix and Rover App..</p>"); } catch { } } return RedirectToAction("Index"); } ViewBag.VetList = new SelectList(db.Vets, "Id", "Name"); return View(user); }
public ActionResult Edit(User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.VetList = new SelectList(db.Vets, "Id", "Name"); return View(user); }