Exemple #1
0
        /// <summary>
        /// Query has completed
        /// </summary>
        void m_patientDemographicsConsumer_QueryCompleted(object sender, PatientDemographicsQueryCompletedEventArgs e)
        {
            this.gridSearch.Opacity = 0;
            this.gridSearch.IsHitTestVisible = false;
            this.waitBar.IsEnabled = false;

            this.lstResult.DataContext = e.Results;
            
        }
        /// <summary>
        /// Begin send callback
        /// </summary>
        private void OnBeginSend(IAsyncResult result)
        {
            // End send operation
            var sendResult = this.m_clientConnector.EndSend(result);

            // Check to make sure the message made it
            if (sendResult.Code != ResultCode.Accepted &&
                sendResult.Code != ResultCode.AcceptedNonConformant)
            {
                return;
            }

            // Receive the response
            var receiveResult = this.m_clientConnector.Receive(sendResult);

            try
            {
                var resultMsg = receiveResult.Structure as PRPA_IN201306UV02;

                // Process results, this is a sample so we'll just stuff the message results
                // in the event arg and notify the handler
                if (this.QueryCompleted != null)
                {
                    PatientDemographicsQueryCompletedEventArgs e;
                    if (resultMsg.Acknowledgement[0].TypeCode != AcknowledgementType.ApplicationAcknowledgementAccept)
                    {
                        e = new PatientDemographicsQueryCompletedEventArgs();
                    }
                    else
                    {
                        e = new PatientDemographicsQueryCompletedEventArgs(resultMsg.controlActProcess.Subject);
                    }
                    this.m_dispatcher.BeginInvoke(this.QueryCompleted, this, e);
                }
            }
            finally
            {
                this.m_clientConnector.Close();
            }
        }
        /// <summary>
        /// Begin send callback
        /// </summary>
        private void OnBeginSend(IAsyncResult result)
        {
            // End send operation
            var sendResult  = this.m_clientConnector.EndSend(result);
            // Check to make sure the message made it
            if (sendResult.Code != ResultCode.Accepted &&
                sendResult.Code != ResultCode.AcceptedNonConformant)
                return;

            // Receive the response
            var receiveResult = this.m_clientConnector.Receive(sendResult);

            try
            {
                var resultMsg = receiveResult.Structure as PRPA_IN201306UV02;

                // Process results, this is a sample so we'll just stuff the message results
                // in the event arg and notify the handler
                if (this.QueryCompleted != null)
                {

                    PatientDemographicsQueryCompletedEventArgs e;
                    if (resultMsg.Acknowledgement[0].TypeCode != AcknowledgementType.ApplicationAcknowledgementAccept)
                        e = new PatientDemographicsQueryCompletedEventArgs();
                    else
                        e = new PatientDemographicsQueryCompletedEventArgs(resultMsg.controlActProcess.Subject);
                    this.m_dispatcher.BeginInvoke(this.QueryCompleted, this, e);
                }
            }
            finally
            {
                this.m_clientConnector.Close();
            }
        }