Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }