Пример #1
0
 public void IniciaEnrolamientoS2U()
 {
     ReqIniciaEnrolamientoS2U reqIES2U = new ReqIniciaEnrolamientoS2U();
     reqIES2U.collectData = new CollectData() { HardwareID = Global.GetDeviceUniqueId() };
     Services.IniciaEnrolamientoS2U(
           base.ServiceRequest,
           (_) =>
           {
               if (!_.ErrorInMakingRequest)
               {
                   switch (_.Error.clave)
                   {
                       case PE.Generic.OK:
                           this._imagenes.Clear();
                           if (null != _.Dto.EnrolaBean.ImagenRSABean) _.Dto.EnrolaBean.ImagenRSABean.ForEach((__) => { this._imagenes.Add(new ImagenRSAItemViewModel(__)); });
                           if (null != _.Dto.EnrolaBean.PreguntaRSABean) _.Dto.EnrolaBean.PreguntaRSABean.ForEach((__) => { this._preguntas.Add(new PreguntaItemViewModel(__)); });
                           if (null != ProcessSuccess)
                           {
                               base._dispatcher.BeginInvoke(() =>
                               {
                                   ProcessSuccess(PS.Service.INICIA_ENROLAMIENTO_S2U);
                               });
                           }
                           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 });
                       });
                   }
               }
           },
           reqIES2U);
 }
Пример #2
0
        public static void IniciaEnrolamientoS2U(ServiceRequest2 serviceRequest, ServiceRequestEventHandler<DtoIniciaEnrolamientoS2U> asyncCallback, ReqIniciaEnrolamientoS2U requestData)
        {
#if OFFLINE
            serviceRequest.BeginWebRequestOffline<ResIniciaEnrolamientoS2U, DtoIniciaEnrolamientoS2U>(Services._serviceIniciaEnrolamientoS2U, asyncCallback, json._jsonIniciaEnrolamientoS2U);
#else
            new Thread(() => { serviceRequest.BeginWebRequest<ResIniciaEnrolamientoS2U, DtoIniciaEnrolamientoS2U, ReqIniciaEnrolamientoS2U>(service._serviceIniciaEnrolamientoS2U, asyncCallback, requestData); }).Start();
#endif
        }