protected override object ExecuteSearchAsync(object parameters) { object data = null; if ((parameters != null) && (parameters is FindUserDetailsParameters)) { viewParameters = parameters as FindUserDetailsParameters; FindUserDetailsRequest serviceRequest = new FindUserDetailsRequest(); serviceRequest.FindUserDetailsParameters = viewParameters; _backendCallIsRunning = true; FindUserDetailsResponse serviceResponse = Service.FindUserDetails(serviceRequest); if ((serviceResponse != null) && (serviceResponse.FindUserDetailsResult != null)) { data = serviceResponse.FindUserDetailsResult; UserSessionService.UserId = serviceResponse.FindUserDetailsResult.UserIdentity; } } return(data); }
public FindUserDetailsResult Execute(FindUserDetailsParameters parameters) { ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings[schemaName]; string connectionString = settings.ConnectionString; FindUserDetailsResult result = null; string _userIdentity = string.Empty; using (TransactionScope scope = new TransactionScope()) { FindUserLogonDetailsAction findUserLogonDetailsAction = new FindUserLogonDetailsAction(); IList <FindUserLogonDetailsResult> findUserLogonDetailsResult = findUserLogonDetailsAction.Execute(new FindUserLogonDetailsParameters() { UserIdentity = parameters.UserIdentity, UserPrincipalIdentity = parameters.UserPrincipalIdentity }); if ((findUserLogonDetailsResult != null) && (findUserLogonDetailsResult.Count > 0)) { _userIdentity = findUserLogonDetailsResult[0].UserIdentity; } else { _userIdentity = parameters.UserIdentity; } FindUserNodesAction findUserNodesAction = new FindUserNodesAction(); IList <FindUserNodesResult> findUserNodesResult = findUserNodesAction.Execute(new FindUserNodesParameters() { UserIdentity = _userIdentity }); result = new FindUserDetailsResult() { UserIdentity = _userIdentity }; if ((findUserLogonDetailsResult != null) && (findUserLogonDetailsResult.Count > 0)) { result.UserName = findUserLogonDetailsResult[0].UserName; result.RecentNodeIdentity = findUserLogonDetailsResult[0].RecentNodeIdentity; result.LastLogonTime = findUserLogonDetailsResult[0].LastLogonTime; } else { // Get identity from the current thread result.UserName = Thread.CurrentPrincipal.Identity.Name; if (string.IsNullOrEmpty(result.UserName)) { result.UserName = _userIdentity; } result.LastLogonTime = DateTime.Now; } result.UserNodes = findUserNodesResult; scope.Complete(); return(result); } }
public void UpdateView(FindUserDetailsParameters viewParameters) { this.viewParameters = viewParameters; if (View.IsVisible) { _forceUpdate = false; ExecuteSearch(viewParameters); } else { _forceUpdate = true; } }
public override void OnViewReady() { viewParameters = new FindUserDetailsParameters(); _forceUpdate = true; }