Exemplo n.º 1
0
 public void BorrarSrv()
 {
     ReqBorrarSrv reqBS = new ReqBorrarSrv();
     reqBS.emisoras = new List<Emisora>() { 
                 new Emisora() { 
                       convenio = this._servicio.Source.convenio,
                       emisora = this._servicio.Source.emisora,
                       fechaActiv = this._servicio.Source.fechaActiv,
                       fechaReg = this._servicio.Source.fechaReg,
                       status = this._servicio.Source.status,
                 }
           };
     reqBS.token = string.IsNullOrEmpty(this.Token) ? string.Empty : this.Token;
     reqBS.tipoOTP = string.IsNullOrEmpty(this.TipoOTP) ? string.Empty : this.TipoOTP;
     reqBS.fechaHora = string.IsNullOrEmpty(this.FechaHora) ? string.Empty : this.FechaHora;
     reqBS.codDivisa = string.Empty;
     Services.BorrarSrv(
           base.ServiceRequest,
           (_) =>
           {
               if (!_.ErrorInMakingRequest)
               {
                   switch (_.Error.clave)
                   {
                       case PE.Generic.OK:
                           this.Fecha = _.Dto.fecha;
                           this.Hora = _.Dto.hora;
                           this.ReferenciaOperacion = _.Dto.referencia;
                           if (null != ProcessSuccess)
                           {
                               base._dispatcher.BeginInvoke(() =>
                               {
                                   ProcessSuccess(PS.Service.BORRAR_SRV);
                               });
                           }
                           break;
                       default:
                           if (null != ProcesoError)
                           {
                               base._dispatcher.BeginInvoke(() =>
                               {
                                   ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = false, Error = _.Error });
                               });
                           }
                           break;
                   }
               }
               else
               {
                   if (null != ProcesoError)
                   {
                       base._dispatcher.BeginInvoke(() =>
                       {
                           ProcesoError(new Global.ViewModelEventArgs() { ErrorInMakingRequest = _.ErrorInMakingRequest });
                       });
                   }
               }
           },
           reqBS);
 }
Exemplo n.º 2
0
        public static void BorrarSrv(ServiceRequest2 serviceRequest, ServiceRequestEventHandler<DtoBorrarSrv> asyncCallback, ReqBorrarSrv requestData)
        {
#if OFFLINE
            serviceRequest.BeginWebRequestOffline<ResBorrarSrv, DtoBorrarSrv>(Services._serviceBorrarSrv, asyncCallback, json._jsonBorrarSrv);
#else
            new Thread(() => { serviceRequest.BeginWebRequest<ResBorrarSrv, DtoBorrarSrv, ReqBorrarSrv>(service._serviceBorrarSrv, asyncCallback, requestData); }).Start();
#endif
        }