Esempio n. 1
0
        public void TestCreateTrackingLog()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioCreateTrackingLogCommand command = new DsioCreateTrackingLogCommand(broker);

                string   dfn       = TestConfiguration.DefaultPatientDfn;
                string   eventType = "0";
                string   reason    = "Pregnant";
                string[] comment   = new string[] { "line1", "line2" };

                command.AddCommandArguments(dfn, eventType, reason, comment);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                eventType = "1";

                command.AddCommandArguments(dfn, eventType, reason, comment);

                response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                broker.Disconnect();
            }
        }
Esempio n. 2
0
        public BrokerOperationResult Add(string dfn, TrackingEntryType eventType, string reason, string comment)
        {
            BrokerOperationResult result = new BrokerOperationResult();

            if (this.broker != null)
            {
                DsioCreateTrackingLogCommand command = new DsioCreateTrackingLogCommand(this.broker);
                string eventTypeString = ((int)eventType).ToString();

                string[] commentArray = (string.IsNullOrWhiteSpace(comment)) ? null : Util.Split(comment);
                command.AddCommandArguments(dfn, eventTypeString, reason, commentArray);

                RpcResponse response = command.Execute();

                result.Success = (response.Status == RpcResponseStatus.Success);
                result.Message = response.InformationalMessage;
            }
            else
            {
                result.Message = "No broker";
            }

            return(result);
        }
Esempio n. 3
0
        public void TestCreateTrackingLog()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioCreateTrackingLogCommand command = new DsioCreateTrackingLogCommand(broker);

                //string dfn = "307";
                //string eventType = "2";
                //string reason = "Pregnant";
                //string[] comment = null;

                //string dfn = "715";
                //string eventType = "1";
                //string reason = "Pregnant";
                //string[] comment = null;


                //string dfn = "100007";
                //string dfn = "313";
                //string dfn = "28";
                string   dfn       = "126";
                string   eventType = "1";
                string   reason    = "Pregnant";
                string[] comment   = new string[] { "line1", "line2" };

                command.AddCommandArguments(dfn, eventType, reason, comment);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                broker.Disconnect();
            }
        }