public Response <User> CheckLogin(GetUserByCheckLoginRequest request) { Response <User> response = new Response <User>(); if (request == null || string.IsNullOrEmpty(request.Name) || string.IsNullOrEmpty(request.Password)) { ArgumentNullException ex = new ArgumentNullException("CheckLogin request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } LoginAccessor accessor = new LoginAccessor(); try { response.Result = accessor.CheckLoginUser(request.Name, request.Password); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
public string Post(LoginViewModel value) { string Url = ""; LoginAccessor la = new LoginAccessor(); var user = la.LogIn(value); if (user.Result != null) { var session = HttpContext.Current.Session; var owinAuthentication = new OwinAuthenticationService(new HttpContextWrapper(HttpContext.Current)); owinAuthentication.SignIn((UserModel)user.GetType().GetProperty("Result").GetValue(user)); session[Config.GetAppSetting("SessionKey")] = (UserModel)user.GetType().GetProperty("Result").GetValue(user); Url = "../PR/PRShop"; } return(Url); }
public LoginPageAccessor() { this.Login = new LoginAccessor(); }