public ActionResult RegisterIndex(LogonRegisterContainerModel model) { PersonModel profileModel = new PersonModel(); profileModel.Email = model.Register.Email; profileModel.FirstName = model.Register.Name; profileModel.LastName = model.Register.Surename; ViewBag.ListCountry = businessLayer.ListAllCountries(); return View("../Profile/Create",profileModel); }
public ActionResult LogOnIndex(LogonRegisterContainerModel model, string returnUrl) { if (ModelState.IsValid) { var loginProfile = businessLayer.Login(model.LogOn.Email, model.LogOn.Password); if (loginProfile != null) { FormsService.SignIn(model.LogOn.Email, model.LogOn.RememberMe); this.Response.Cookies.Add(new HttpCookie("UserFullName",loginProfile.Email)); if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToAction("MyAccount", "Home"); } } else { ModelState.AddModelError("", "The user name or password provided is incorrect."); } } // If we got this far, something failed, redisplay form return View("LogOn", model.LogOn); }