Beispiel #1
0
        public ActionResult Index(Login login)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (this._loginProvider.Login(login.Username, login.Password, false).Successful)
                    {
                        FormsAuthentication.SetAuthCookie(login.Username, false);
                        return this.RedirectToRoute("Investors-Current-Unitholders-Members");
                    }
                    else
                    {
                        this.ModelState.AddModelError("Email", "Invalid username or password, please try again");
                    }
                }
                catch (Exception exception)
                {
                    this.ModelState.AddModelError("Email", "There was a problem logging you in. Please try again." + exception.Message);
                }
            }

            if (login.LoginLocation == LoginLocation.Home)
            {
                return this.RedirectToRoute("Home");

            }
            else
            {
                return this.RedirectToRoute("Investors-Current-Unitholders");
            }
        }
Beispiel #2
0
 public PageViewModel(Login login)
 {
     this._login = login;
 }