public void LoadSugestions(string hint) { this.Parameters.SearchChars = hint; StoreProceduresAsync.GetServiceCodeByName( this.parameters, (ss, ee) => { Trace.WriteLine("Resultado Para :" + this.Parameters.SearchChars); if (ee.Cancelled) { Trace.WriteLine("Lista Cancelada"); } else if (ee.Error != null) { Trace.WriteLine("Lista Error: + " + ee.Error.Message); } else { var service = ee.Result as List <PRO_ConvenioPrestPortafoSeleccAutoComplete_Result>; if (service != null) { Trace.WriteLine("Lista: " + service.Count); this.Sugestions.Clear(); foreach (var autoCompleteResult in service) { this.Sugestions.Add(autoCompleteResult); } } } this.OnListaCargada(); }); }
private bool Autenticar(string login, string pass) { try { if (Membership.ValidateUser(login, pass)) { var usuarioActual = new NeuronCloudIdentity(login); var principal = new NeuronCloudPrincipal(usuarioActual); ConfiguracionGlobal.SetIPrincipalActual(principal); Thread.CurrentPrincipal = ConfiguracionGlobal.IPrincipalActual; StoreProceduresAsync.GetClaimsAsync(login, (sender, args) => { if (args.Cancelled) { MessageBox.Show("Error Funciones"); } else if (args.Error != null) { MessageBox.Show("Error Funciones:\n" + args.Error.Message); } else { bool resultClaims; if (args.Result is bool) { resultClaims = (bool)args.Result; } else { resultClaims = false; } if (!resultClaims) { MessageBox.Show("Error Obteniendo autorización"); } this.ViewModel.UpdateClaims(); } }); return(true); } } catch (Exception exception) { Debug.WriteLine("Error en Validacion: " + exception.Message); } return(false); }