BExIS.Web.Shell.Areas.SAM.Controllers.AccountController.LogOn C# (CSharp) Метод

LogOn() приватный Метод

private LogOn ( AccountLogOnModel model ) : System.Web.Mvc.ActionResult
model BExIS.Web.Shell.Areas.SAM.Models.AccountLogOnModel
Результат System.Web.Mvc.ActionResult
        public ActionResult LogOn(AccountLogOnModel model)
        {
            if (ModelState.IsValid)
            {
                #region Authenticator

                AuthenticatorManager authenticatorManager = new AuthenticatorManager();
                Authenticator authenticator = authenticatorManager.GetAuthenticatorById(model.AuthenticatorList.Id);
                Assembly assembly = Assembly.Load(authenticator.AssemblyPath);
                Type type = assembly.GetType(authenticator.ClassPath);

                #endregion Authenticator

                #region AuthenticationManager

                IAuthenticationManager authenticationManager = (IAuthenticationManager)Activator.CreateInstance(type, authenticator.ConnectionString);

                #endregion AuthenticationManager

                if (authenticationManager.ValidateUser(model.Username, model.Password))
                {
                    SubjectManager subjectManager = new SubjectManager();

                    if (!subjectManager.ExistsUsernameWithAuthenticatorId(model.Username, model.AuthenticatorList.Id))
                    {
                        subjectManager.CreateUser(model.Username, model.AuthenticatorList.Id);
                    }

                    FormsAuthentication.SetAuthCookie(model.Username, false);

                    return Json(new { success = true });
                }
                else
                {
                    ModelState.AddModelError("", "The Username or Password provided is incorrect.");
                }
            }

            return PartialView("_LogOnPartial", model);
        }

Same methods

AccountController::LogOn ( string returnUrl ) : System.Web.Mvc.ActionResult