Esempio n. 1
0
        private void LockRequestPage_RequestLock(object sender, CustomEventArgs.AccessionOrderReturnEventArgs e)
        {
            if (e.AccessionOrder.AccessionLock.IsLockStillAquired() == true)
            {
                UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.AccessionOrder.MasterAccessionNo, AppMessaging.AccessionLockMessage.GetMyAddress(), e.AccessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
                YellowstonePathology.Store.RedisServerProd1.Instance.Subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
                this.ShowLockRequestSentPage(e.AccessionOrder);
            }
            else
            {
                e.AccessionOrder.AccessionLock.RefreshLock();
                this.RunLockAquiredActionList();

                if (this.m_MessagingDialog != null)
                {
                    this.m_MessagingDialog.Close();
                    this.m_MessagingDialog = null;
                }

                if (this.LockWasReleased != null)
                {
                    this.LockWasReleased(this, new EventArgs());
                }
            }
        }
Esempio n. 2
0
        public void StartSendRequest(YellowstonePathology.Business.Test.AccessionOrder accessionOrder, Navigation.PageNavigator pageNavigator)
        {
            if (accessionOrder.AccessionLock.IsLockStillAquired() == true)
            {
                this.m_PageNavigator            = pageNavigator;
                this.m_PageNavigatorWasPassedIn = true;

                UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(accessionOrder.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), accessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
                YellowstonePathology.Store.RedisServerProd1.Instance.Subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
                this.ShowLockRequestSentPage(accessionOrder);
            }
            else
            {
                accessionOrder.AccessionLock.RefreshLock();
                this.RunLockAquiredActionList();

                if (this.m_MessagingDialog != null)
                {
                    this.m_MessagingDialog.Close();
                    this.m_MessagingDialog = null;
                }

                if (this.LockWasReleased != null)
                {
                    this.LockWasReleased(this, new EventArgs());
                }
            }
        }
Esempio n. 3
0
 private void Button_PublishClick(object sender, RoutedEventArgs e)
 {
     string masterAccessionno = "16-12345";
     YellowstonePathology.Business.User.SystemUser user = YellowstonePathology.Business.User.SystemIdentity.Instance.User;
     UI.AppMessaging.AccessionLockMessage message = new AppMessaging.AccessionLockMessage(masterAccessionno, System.Environment.MachineName, user.UserName, AppMessaging.AccessionLockMessageIdEnum.ASK);
     string messageJSON = message.ToJSON();
     this.m_SUB.Publish(masterAccessionno, messageJSON);
 }
Esempio n. 4
0
        private void Button_PublishClick(object sender, RoutedEventArgs e)
        {
            string masterAccessionno = "16-12345";

            YellowstonePathology.Business.User.SystemUser user    = YellowstonePathology.Business.User.SystemIdentity.Instance.User;
            UI.AppMessaging.AccessionLockMessage          message = new AppMessaging.AccessionLockMessage(masterAccessionno, System.Environment.MachineName, user.UserName, AppMessaging.AccessionLockMessageIdEnum.ASK);
            string messageJSON = message.ToJSON();

            this.m_SUB.Publish(masterAccessionno, messageJSON);
        }
Esempio n. 5
0
        public LockRequestResponseReceivedPage(AccessionLockMessage message, System.Windows.Visibility closeButtonVisibility, System.Windows.Visibility nextButtonVisibility)
        {
            this.m_Message = message;
            this.SetDisplayMessage(message);

            InitializeComponent();
            DataContext = this;

            this.ButtonClose.Visibility = closeButtonVisibility;
            this.ButtonNext.Visibility  = nextButtonVisibility;
        }
Esempio n. 6
0
        private void LockRequestReceivedPage_Take(object sender, CustomEventArgs.AOAccessionLockMessageReturnEventArgs e)
        {
            this.RunLockReleasedActionList();
            this.m_MessagingDialog.Close();

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Save();
            e.AccessionOrder.AccessionLock.TransferLock(e.Message.From);

            UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.Message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), e.Message.From, AccessionLockMessageIdEnum.GIVE);
            YellowstonePathology.Store.RedisServerProd1.Instance.Subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
        }
Esempio n. 7
0
 private void SetDisplayMessage(AccessionLockMessage message)
 {
     if (message.MessageId == AccessionLockMessageIdEnum.GIVE)
     {
         this.m_DisplayMessage = this.m_Message.From + " says " + this.m_Message.MasterAccessionNo + " is all yours.";
     }
     else if (message.MessageId == AccessionLockMessageIdEnum.HOLD)
     {
         this.m_DisplayMessage = this.m_Message.From + " says hold your horses I'm working on " + this.m_Message.MasterAccessionNo + ".";
     }
 }
Esempio n. 8
0
        public void ShowResponseReceivedPage(AccessionLockMessage message)
        {
            LockRequestResponseReceivedPage lockRequestResponseReceivedPage = null;

            if (this.m_PageNavigatorWasPassedIn == false)
            {
                lockRequestResponseReceivedPage = new LockRequestResponseReceivedPage(message, System.Windows.Visibility.Visible, System.Windows.Visibility.Collapsed);
            }
            else
            {
                lockRequestResponseReceivedPage = new LockRequestResponseReceivedPage(message, System.Windows.Visibility.Collapsed, System.Windows.Visibility.Visible);
            }

            lockRequestResponseReceivedPage.LockWasReleased += LockRequestResponseReceivedPage_LockWasReleased;
            lockRequestResponseReceivedPage.HoldYourHorses  += LockRequestResponseReceivedPage_HoldYourHorses;
            this.m_PageNavigator.Navigate(lockRequestResponseReceivedPage);
        }
        public LockRequestReceivedPage(Business.Test.AccessionOrder accessionOrder, AccessionLockMessage message)
        {
            this.m_CurrentCountDown    = 7;
            this.m_AccessionOrder      = accessionOrder;
            this.m_Message             = message;
            this.m_DisplayMessage      = this.m_Message.From + " is asking for the lock on " + this.m_Message.MasterAccessionNo + ".";
            this.m_StopTimerOnNextTick = false;

            System.Windows.Threading.DispatcherTimer dispatchTimer = new System.Windows.Threading.DispatcherTimer();
            dispatchTimer.Interval = new TimeSpan(0, 0, 1);
            dispatchTimer.Tick    += DispatchTimer_Tick;
            dispatchTimer.Start();

            InitializeComponent();

            DataContext = this;
        }
Esempio n. 10
0
        public void HandleMessageReceived(AccessionLockMessage message, Business.Test.AccessionOrder accessionOrder)
        {
            switch (message.MessageId)
            {
            case UI.AppMessaging.AccessionLockMessageIdEnum.ASK:
                HandleASKRecieved(accessionOrder, message);
                break;

            case UI.AppMessaging.AccessionLockMessageIdEnum.HOLD:
                ShowResponseReceivedPage(message);
                break;

            case UI.AppMessaging.AccessionLockMessageIdEnum.GIVE:
                ShowResponseReceivedPage(message);
                RunLockAquiredActionList();
                break;
            }
        }
Esempio n. 11
0
        public void Start(YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            if (accessionOrder.AccessionLock.IsLockAquiredByMe == false)
            {
                if (this.m_MessagingDialog == null)
                {
                    this.m_MessagingDialog = new MessagingDialog();
                }
                this.m_MessagingDialog.Topmost = true;
                this.m_PageNavigator           = this.m_MessagingDialog.PageNavigator;
                this.m_MessagingDialog.Closed += MessagingDialog_Closed;

                UI.AppMessaging.AccessionLockMessage message         = new AccessionLockMessage(accessionOrder.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), accessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
                AppMessaging.LockRequestPage         lockRequestPage = new AppMessaging.LockRequestPage(accessionOrder);
                lockRequestPage.RequestLock += LockRequestPage_RequestLock;

                this.m_MessagingDialog.PageNavigator.Navigate(lockRequestPage);
                this.m_MessagingDialog.Show();
            }
        }
Esempio n. 12
0
        public void HandleASKRecieved(Business.Test.AccessionOrder accessionOrder, AccessionLockMessage message)
        {
            if (this.m_AlwaysHoldList.Exists(e => e == System.Environment.MachineName.ToUpper()))
            {
                UI.AppMessaging.AccessionLockMessage holdMessage = new AccessionLockMessage(message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), message.From, AccessionLockMessageIdEnum.HOLD);
                YellowstonePathology.Store.RedisServerProd1.Instance.Subscriber.Publish(holdMessage.MasterAccessionNo, JsonConvert.SerializeObject(holdMessage));
            }
            else
            {
                if (this.m_MessagingDialog == null)
                {
                    this.m_MessagingDialog = new MessagingDialog();
                }
                this.m_PageNavigator           = this.m_MessagingDialog.PageNavigator;
                this.m_MessagingDialog.Closed += MessagingDialog_Closed;

                AppMessaging.LockRequestReceivedPage lockRequestReceivedPage = new AppMessaging.LockRequestReceivedPage(accessionOrder, message);
                lockRequestReceivedPage.Take += LockRequestReceivedPage_Take;
                lockRequestReceivedPage.Hold += LockRequestReceivedPage_Hold;

                this.m_MessagingDialog.PageNavigator.Navigate(lockRequestReceivedPage);
                this.m_MessagingDialog.Show();
            }
        }
Esempio n. 13
0
        private void LockRequestReceivedPage_Take(object sender, CustomEventArgs.AOAccessionLockMessageReturnEventArgs e)
        {
            this.RunLockReleasedActionList();
            this.m_MessagingDialog.Close();

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.Save();
            e.AccessionOrder.AccessionLock.TransferLock(e.Message.From);

            UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.Message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), e.Message.From, AccessionLockMessageIdEnum.GIVE);
            ISubscriber subscriber = Business.RedisConnection.Instance.GetSubscriber();
            subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
        }
Esempio n. 14
0
 private void LockRequestReceivedPage_Hold(object sender, CustomEventArgs.AccessionLockMessageReturnEventArgs e)
 {
     UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.Message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), e.Message.From, AccessionLockMessageIdEnum.HOLD);
     ISubscriber subscriber = Business.RedisConnection.Instance.GetSubscriber();
     subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
     this.m_MessagingDialog.Close();
 }
Esempio n. 15
0
 private void LockRequestPage_RequestLock(object sender, CustomEventArgs.AccessionOrderReturnEventArgs e)
 {
     if(e.AccessionOrder.AccessionLock.IsLockStillAquired() == true)
     {
         UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.AccessionOrder.MasterAccessionNo, AppMessaging.AccessionLockMessage.GetMyAddress(), e.AccessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
         ISubscriber subscriber = Business.RedisConnection.Instance.GetSubscriber();
         subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
         this.ShowLockRequestSentPage(e.AccessionOrder);
     }
     else
     {
         e.AccessionOrder.AccessionLock.RefreshLock();
         this.RunLockAquiredActionList();
         this.m_MessagingDialog.Close();
         this.m_MessagingDialog = null;
     }
 }
Esempio n. 16
0
        public void StartSendRequest(YellowstonePathology.Business.Test.AccessionOrder accessionOrder, Navigation.PageNavigator pageNavigator)
        {
            if (accessionOrder.AccessionLock.IsLockStillAquired() == true)
            {
                this.m_PageNavigator = pageNavigator;
                this.m_PageNavigatorWasPassedIn = true;

                UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(accessionOrder.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), accessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
                ISubscriber subscriber = Business.RedisConnection.Instance.GetSubscriber();
                subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));

                this.ShowLockRequestSentPage(accessionOrder);
            }
            else
            {
                accessionOrder.AccessionLock.RefreshLock();
                this.RunLockAquiredActionList();
                this.m_MessagingDialog.Close();
                this.m_MessagingDialog = null;
            }
        }
Esempio n. 17
0
        public void Start(YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            if(accessionOrder.AccessionLock.IsLockAquiredByMe == false)
            {
                if(this.m_MessagingDialog == null) this.m_MessagingDialog = new MessagingDialog();
                this.m_PageNavigator = this.m_MessagingDialog.PageNavigator;
                this.m_MessagingDialog.Closed += MessagingDialog_Closed;

                UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(accessionOrder.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), accessionOrder.AccessionLock.Address, AccessionLockMessageIdEnum.ASK);
                AppMessaging.LockRequestPage lockRequestPage = new AppMessaging.LockRequestPage(accessionOrder);
                lockRequestPage.RequestLock += LockRequestPage_RequestLock;

                this.m_MessagingDialog.PageNavigator.Navigate(lockRequestPage);
                this.m_MessagingDialog.Show();
            }
        }
Esempio n. 18
0
        public void ShowResponseReceivedPage(AccessionLockMessage message)
        {
            LockRequestResponseReceivedPage lockRequestResponseReceivedPage = null;
            if(this.m_PageNavigatorWasPassedIn == false)
            {
                lockRequestResponseReceivedPage = new LockRequestResponseReceivedPage(message, System.Windows.Visibility.Visible, System.Windows.Visibility.Collapsed);
            }
            else
            {
                lockRequestResponseReceivedPage = new LockRequestResponseReceivedPage(message, System.Windows.Visibility.Collapsed, System.Windows.Visibility.Visible);
            }

            lockRequestResponseReceivedPage.LockWasReleased += LockRequestResponseReceivedPage_LockWasReleased;
            lockRequestResponseReceivedPage.HoldYourHorses += LockRequestResponseReceivedPage_HoldYourHorses;
            this.m_PageNavigator.Navigate(lockRequestResponseReceivedPage);
        }
Esempio n. 19
0
 public void HandleMessageReceived(AccessionLockMessage message, Business.Test.AccessionOrder accessionOrder)
 {
     switch (message.MessageId)
     {
         case UI.AppMessaging.AccessionLockMessageIdEnum.ASK:
             HandleASKRecieved(accessionOrder, message);
             break;
         case UI.AppMessaging.AccessionLockMessageIdEnum.HOLD:
             ShowResponseReceivedPage(message);
             break;
         case UI.AppMessaging.AccessionLockMessageIdEnum.GIVE:
             ShowResponseReceivedPage(message);
             RunLockAquiredActionList();
             break;
     }
 }
Esempio n. 20
0
        public void HandleASKRecieved(Business.Test.AccessionOrder accessionOrder, AccessionLockMessage message)
        {
            if (this.m_AlwaysHoldList.Exists(e => e == System.Environment.MachineName.ToUpper()))
            {
                UI.AppMessaging.AccessionLockMessage holdMessage = new AccessionLockMessage(message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), message.From, AccessionLockMessageIdEnum.HOLD);
                ISubscriber subscriber = Business.RedisConnection.Instance.GetSubscriber();
                subscriber.Publish(holdMessage.MasterAccessionNo, JsonConvert.SerializeObject(holdMessage));
            }
            else
            {
                if(this.m_MessagingDialog == null) this.m_MessagingDialog = new MessagingDialog();
                this.m_PageNavigator = this.m_MessagingDialog.PageNavigator;
                this.m_MessagingDialog.Closed += MessagingDialog_Closed;

                AppMessaging.LockRequestReceivedPage lockRequestReceivedPage = new AppMessaging.LockRequestReceivedPage(accessionOrder, message);
                lockRequestReceivedPage.Take += LockRequestReceivedPage_Take;
                lockRequestReceivedPage.Hold += LockRequestReceivedPage_Hold;

                this.m_MessagingDialog.PageNavigator.Navigate(lockRequestReceivedPage);
                this.m_MessagingDialog.Show();
            }
        }
Esempio n. 21
0
 private void LockRequestReceivedPage_Hold(object sender, CustomEventArgs.AccessionLockMessageReturnEventArgs e)
 {
     UI.AppMessaging.AccessionLockMessage message = new AccessionLockMessage(e.Message.MasterAccessionNo, AccessionLockMessage.GetMyAddress(), e.Message.From, AccessionLockMessageIdEnum.HOLD);
     YellowstonePathology.Store.RedisServerProd1.Instance.Subscriber.Publish(message.MasterAccessionNo, JsonConvert.SerializeObject(message));
     this.m_MessagingDialog.Close();
 }