Ejemplo n.º 1
0
        public ActionResult LogOn(LogOnViewModel model)
        {
            var signInResult = this.formAuthenticationService.SignIn(model.UserName, model.Password);

            if(signInResult == SignInResult.Success )
            {
                if(!string.IsNullOrEmpty(model.ReturnURL))
                {
                    return Redirect(model.ReturnURL);
                }
                else
                {
                   return RedirectToAction("Index", "Donor");
                }
            }
            else
            {
                this.flashMessenger.AddMessage("Wrong Login", FlashMessageType.Failure);
                return View("Logon", model);
            }
        }
Ejemplo n.º 2
0
        public ActionResult LogOn(LogOnViewModel model)
        {
            var signInResult = this.authenticationService.SignIn(model.UserName, model.Password);

            if(signInResult == SignInResult.Success )
            {
                FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
              
                if(!string.IsNullOrEmpty(model.ReturnURL))
                {
                    return Redirect(model.ReturnURL);
                }
                else
                {
                   return RedirectToAction("Index", "Donor");
                }
            }
            else
            {
                return View("LogOn", model);
            }
        }