Exemplo n.º 1
0
        private void DataService_OnPostSuccessfull(object sender, DataServiceEventArgs e)
        {
            HttpResponseMessage result        = e.Result;
            Task <string>       resultContent = result.Content.ReadAsStringAsync();
            TokenModel          token         = JsonConvert.DeserializeObject <TokenModel>(resultContent.Result);

            if (token.Expires_In == 0)
            {
                OnAutenticationFailed?.Invoke(this, new FailEventArgs(e.ParentMethodName, "Verifique sus credenciales"));
                return;
            }

            OnAuthenticatedSuccesfull?.Invoke(this, new AuthenticateEventArgs(true, token, e.ParentMethodName));
        }
Exemplo n.º 2
0
 private void DataService_OnPostFailed(object sender, FailEventArgs e)
 {
     OnAutenticationFailed?.Invoke(this, new FailEventArgs(e.MethodError, e.ErrorMessage));
 }