コード例 #1
0
        public TrackingHistoryResult GetHistoryEntries(int page, int itemsPerPage)
        {
            TrackingHistoryResult returnResult = new TrackingHistoryResult();

            if (this.broker == null)
            {
                returnResult.Message = "No broker";
            }
            else
            {
                DsioGetTrackingCommand command = new DsioGetTrackingCommand(this.broker);

                //command.AddGetAllParameters();
                command.AddGetAllParameters(page, itemsPerPage);

                RpcResponse response = command.Execute();

                returnResult.Success = (response.Status == RpcResponseStatus.Success);
                returnResult.Message = response.InformationalMessage;

                if (returnResult.Success)
                {
                    returnResult.TrackingEntries = GetTrackingEntries(command.TrackingItems);
                    returnResult.TotalEntries    = command.TotalResults;
                }
            }

            return(returnResult);
        }
コード例 #2
0
        public void TestGetTracking_AllEntries()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetTrackingCommand command = new DsioGetTrackingCommand(broker);

                command.AddGetAllParameters(1, 5);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsNotNull(command.TrackingItems);

                if (command.TrackingItems.Count > 0)
                {
                    foreach (DsioTrackingItem item in command.TrackingItems)
                    {
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.Id));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.Dfn));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.PatientName));
                        //Assert.IsFalse(string.IsNullOrWhiteSpace(item.Reason));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.Source));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.TrackingItemDateTime));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.TrackingType));
                        Assert.IsFalse(string.IsNullOrWhiteSpace(item.User));
                    }
                }
                broker.Disconnect();
            }
        }