public ActionResult Create(Bell model) { try { BellwetherContext ctx = new BellwetherContext(); model.User = new User() {UserName = User.Identity.Name}; ctx.Bells.Add(model); ctx.SaveChanges(); return RedirectToAction("Index", new { controller = "Home"} ); } catch { return View(); } }
// // GET: /Admin/BellAdmin/Create public ActionResult Create() { var bell = new Bell(); return View(bell); }