public void Get_Connection()
        {
            try
            {
                label1.Text = "";

                ConnectionInfoRequest  connectionInfoRequest  = new ConnectionInfoRequest();
                ConnectionInfoResponse connectionInfoResponse = new ConnectionInfoResponse();


                connectionInfoRequest.AgentId        = 15;
                connectionInfoRequest.AgentPassword  = "******";
                connectionInfoRequest.RMSClientNo    = 3038;
                connectionInfoRequest.ClientPassword = "******";

                //pass conInfo and get info and store to a variable
                connectionInfoResponse = client.GetConnectionInfo(connectionInfoRequest);


                // 'The secret token for this Client/Agent combination. This should be refreshed every hour
                _Token = connectionInfoResponse.Token;

                // Create an instance of the public service client with the correct endpoint URL for this client
                _PublicServiceClient = GetPublicWebServiceClientInstance(connectionInfoResponse.WebserviceURL);


                label1.Text = client.TestCall();
            }

            catch (Exception ex)
            {
                label1.Text = "Error:" + ex.Message;
            }
        }
示例#2
0
 private void InitPosServices(IReactiveDeliveryClient reactiveDeliveryClient, Action showWnd, IShellContainerVm vm,
                              ConnectionInfoResponse response)
 {
     try
     {
         PosService.DeletePosFoldersDataAndNewDataIfPosIsDown();
         SyncPosFiles.GetUnsyncFiles(reactiveDeliveryClient, showWnd, vm, response);
     }
     catch (Exception ex)
     {
         Log.Error("Error al iniciar los servicios de POS: ", ex);
     }
 }
示例#3
0
        private static void OnGetUnsynFilesOk(IStale <ResponseMessageData <SyncFranchiseModel> > obj, Action showWnd, IShellContainerVm vm,
                                              ConnectionInfoResponse responseAccount)
        {
            if (obj.IsStale)
            {
                OnGetUnsynFilesError(ResNetwork.ERROR_NETWORK_DOWN, showWnd);
                return;
            }

            if (obj.Data.IsSuccess == false)
            {
                OnGetUnsynFilesError(obj.Data.Message, showWnd);
                return;
            }

            var respMsg = SyncFileService.StartSyncFiles(obj.Data.LstData.ToList());

            if (respMsg.IsSuccess == false)
            {
                OnGetUnsynFilesError(respMsg.Message, showWnd);
                return;
            }

            RxApp.MainThreadScheduler.Schedule(_ =>
            {
                try
                {
                    vm.ChangeCurrentView((StatusScreen)responseAccount.NxWn, false);
                    MessageBus.Current.SendMessage(responseAccount.Msg, SharedMessageConstants.INITIALIZE_ERROR_CHECK);
                    showWnd();
                }
                catch (Exception)
                {
                    OnGetUnsynFilesError("La respuesta del servidor es incorrecta. Revise que tenga la versión correcta en el cliente o en el servidor", showWnd);
                }
            });
        }
示例#4
0
        public static void GetUnsyncFiles(IReactiveDeliveryClient reactiveDeliveryClient, Action showWnd, IShellContainerVm vm, ConnectionInfoResponse response)
        {
            var showWndSec = showWnd;

            reactiveDeliveryClient.ExecutionProxy.ExecuteRequest <ResponseMessageData <SyncFranchiseModel>, ResponseMessageData <SyncFranchiseModel> >
                (SharedConstants.Server.FRANCHISE_HUB, SharedConstants.Server.LIST_SYNC_FILES_FRANCHISE_HUB_METHOD, TransferDto.SameType)
            .ObserveOn(reactiveDeliveryClient.ConcurrencyService.Dispatcher)
            .SubscribeOn(reactiveDeliveryClient.ConcurrencyService.TaskPool)
            .Subscribe(e => OnGetUnsynFilesOk(e, showWnd, vm, response), i => OnGetUnsynFilesError(i, showWndSec));
        }