public ActionResult NurseryRegister(Nursery nursery) { if (ModelState.IsValid) { using (ENDbContext db = new ENDbContext()) { db.Nurseries.Add(nursery); db.SaveChanges(); } ModelState.Clear(); ViewBag.Message = nursery.NurseryName + " which is at location " + nursery.Location + " successfully registered."; } return(RedirectToAction("NurseryAuthenticate")); }
public ActionResult UserRegister(User user) { if (ModelState.IsValid) { using (ENDbContext db = new ENDbContext()) { db.Users.Add(user); db.SaveChanges(); } ModelState.Clear(); ViewBag.Message = user.FirstName + " " + user.LastName + " successfully registered."; } return(RedirectToAction("UserAuthenticate")); }