public void ValidarNipDesbloqueo(string nip)
 {
     ReqValidarNipDesbloqueo reqVND = new ReqValidarNipDesbloqueo();
     reqVND.nuevoNip = nip;
     reqVND.token = this.Token;
     reqVND.fechaHora = this.FechaHora != null ? this.FechaHora : string.Empty; ;
     reqVND.tipoOTP = this.TipoOTP != null ? this.TipoOTP : string.Empty;
     Services.ValidarNipDesbloqueo(
           base.ServiceRequest,
           (_) =>
           {
               if (!_.ErrorInMakingRequest)
               {
                   switch (_.Error.clave)
                   {
                       case Errors.Generic.OK:
                           if (null != ProcessSuccess)
                           {
                               base._dispatcher.BeginInvoke(() =>
                               {
                                   ProcessSuccess(PS.Service.VALIDAR_NIP_DESBLOQUEO);
                               });
                           }
                           break;
                       default:
                           this._dispatcher.BeginInvoke(() =>
                           {
                               ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = false, Error = _.Error });
                           });
                           break;
                   }
               }
               else
               {
                   if (null != ProcesoError)
                   {
                       base._dispatcher.BeginInvoke(() =>
                       {
                           ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = _.ErrorInMakingRequest });
                       });
                   }
               }
           },
           reqVND);
 }
Esempio n. 2
0
        public static void ValidarNipDesbloqueo(ServiceRequest2 serviceRequest, ServiceRequestEventHandler<string> asyncCallback, ReqValidarNipDesbloqueo requestData)
        {
#if OFFLINE
            serviceRequest.BeginWebRequestOffline<ResValidarNipDesbloqueo, string>(Services._serviceValidarNipDesbloqueo, asyncCallback, json._jsonValidarNipDesbloqueo);
#else
            new Thread(() => { serviceRequest.BeginWebRequest<ResValidarNipDesbloqueo, string, ReqValidarNipDesbloqueo>(service._serviceValidarNipDesbloqueo, asyncCallback, requestData); }).Start();
#endif
        }