Exemplo n.º 1
0
        public ActionResult Register(RegistrationViewModel model, FormCollection formData)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            try
            {
                User u = model.ToUser();
                db.Users.Add(u);
                db.SaveChanges();

                FormsAuthentication.SetAuthCookie(u.EmailAddress, true);
                return RedirectToAction("Dashboard", "Finance");
            }
            catch
            {
                return View(model);
            }
        }
Exemplo n.º 2
0
 public ActionResult Register()
 {
     var model = new RegistrationViewModel();
     return View(model);
 }